base-screen 0.4.0 → 0.4.2

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 (368) hide show
  1. package/README.md +5 -2
  2. package/dist/_internal/contracts/diagnostics/material-error.d.ts +1 -1
  3. package/dist/_internal/contracts/diagnostics/material-error.js +1 -1
  4. package/dist/_internal/contracts/document/blueprint-graph.d.ts +3 -3
  5. package/dist/_internal/contracts/document/blueprint-graph.js +4 -4
  6. package/dist/_internal/contracts/document/component-states.d.ts +1 -1
  7. package/dist/_internal/contracts/document/component-states.js +1 -1
  8. package/dist/_internal/contracts/document/image-url.js +1 -1
  9. package/dist/_internal/contracts/document/json-schema.js +1 -1
  10. package/dist/_internal/contracts/document/limits.d.ts +5 -5
  11. package/dist/_internal/contracts/document/limits.js +5 -5
  12. package/dist/_internal/contracts/document/references.js +3 -3
  13. package/dist/_internal/contracts/document/schema.d.ts +2 -2
  14. package/dist/_internal/contracts/document/schema.js +3 -3
  15. package/dist/_internal/contracts/document/sub-canvas.d.ts +2 -2
  16. package/dist/_internal/contracts/document/sub-canvas.js +2 -2
  17. package/dist/_internal/contracts/document/theme.d.ts +2 -2
  18. package/dist/_internal/contracts/document/theme.js +2 -2
  19. package/dist/_internal/contracts/document/validate-blueprint.d.ts +1 -1
  20. package/dist/_internal/contracts/document/validate-blueprint.js +1 -1
  21. package/dist/_internal/contracts/document/validate-component.js +2 -2
  22. package/dist/_internal/contracts/document/validate-data-source.js +2 -2
  23. package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +1 -1
  24. package/dist/_internal/contracts/document/validate-sub-canvas.js +1 -1
  25. package/dist/_internal/contracts/document/validate-value-ref.js +1 -1
  26. package/dist/_internal/contracts/index.d.ts +1 -1
  27. package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +1 -1
  28. package/dist/_internal/contracts/migration/migrate-document.js +2 -2
  29. package/dist/_internal/contracts/push/delivery.d.ts +1 -1
  30. package/dist/_internal/contracts/push/delivery.js +1 -1
  31. package/dist/_internal/contracts/push/level-scale.d.ts +1 -1
  32. package/dist/_internal/contracts/push/level-scale.js +1 -1
  33. package/dist/_internal/contracts/types/document.d.ts +19 -19
  34. package/dist/_internal/contracts/types/execution.d.ts +3 -3
  35. package/dist/_internal/contracts/types/host.d.ts +23 -5
  36. package/dist/_internal/contracts/types/host.js +1 -1
  37. package/dist/_internal/contracts/types/push.d.ts +3 -3
  38. package/dist/_internal/contracts/types/variable.d.ts +3 -3
  39. package/dist/_internal/contracts/variable/parse.js +5 -1
  40. package/dist/_internal/core/blueprint/runtime-compile.d.ts +1 -1
  41. package/dist/_internal/core/blueprint/runtime-compile.js +1 -1
  42. package/dist/_internal/core/blueprint/runtime-dispatch.js +1 -1
  43. package/dist/_internal/core/blueprint/runtime-simulate.d.ts +1 -1
  44. package/dist/_internal/core/blueprint/runtime-simulate.js +1 -1
  45. package/dist/_internal/core/blueprint/runtime-types.d.ts +4 -4
  46. package/dist/_internal/core/commands/apply-collection-commands.d.ts +1 -1
  47. package/dist/_internal/core/commands/apply-collection-commands.js +1 -1
  48. package/dist/_internal/core/commands/apply-component-commands.d.ts +1 -1
  49. package/dist/_internal/core/commands/apply-component-commands.js +2 -2
  50. package/dist/_internal/core/commands/apply.js +2 -2
  51. package/dist/_internal/core/commands/types.d.ts +5 -5
  52. package/dist/_internal/core/data/data-candidates.d.ts +1 -1
  53. package/dist/_internal/core/data/data-candidates.js +1 -1
  54. package/dist/_internal/core/data/data-source-dependents.d.ts +1 -1
  55. package/dist/_internal/core/data/data-source-dependents.js +1 -1
  56. package/dist/_internal/core/data/dataset-profile.d.ts +2 -2
  57. package/dist/_internal/core/data/dataset-profile.js +2 -2
  58. package/dist/_internal/core/data/host-dataset.d.ts +2 -2
  59. package/dist/_internal/core/data/host-dataset.js +2 -2
  60. package/dist/_internal/core/data/sample-values.d.ts +1 -1
  61. package/dist/_internal/core/data/sample-values.js +1 -1
  62. package/dist/_internal/core/data/value-ref.d.ts +2 -2
  63. package/dist/_internal/core/data/value-ref.js +1 -1
  64. package/dist/_internal/core/state/state-preset.d.ts +1 -1
  65. package/dist/_internal/core/validation/layout-audit.d.ts +2 -2
  66. package/dist/_internal/core/validation/layout-audit.js +1 -1
  67. package/dist/_internal/core/validation/legibility.js +1 -1
  68. package/dist/_internal/core/validation/validate-semantics.js +1 -1
  69. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +1 -1
  70. package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +1 -1
  71. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-catalog-controller.d.ts +21 -0
  72. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +7 -2
  73. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +1 -1
  74. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-effective-value.d.ts +1 -1
  75. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +1 -1
  76. package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +1 -1
  77. package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +1 -1
  78. package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +2 -2
  79. package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +3 -3
  80. package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +1 -1
  81. package/dist/_internal/engine/browser/controllers/designer-intent-controller.d.ts +5 -0
  82. package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +1 -1
  83. package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +1 -1
  84. package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +1 -1
  85. package/dist/_internal/engine/browser/controllers/designer-text-edit-controller.d.ts +2 -2
  86. package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +7 -1
  87. package/dist/_internal/engine/browser/controllers/gesture/designer-drag-gesture.d.ts +6 -1
  88. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +1 -1
  89. package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +1 -1
  90. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +6 -6
  91. package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +7 -0
  92. package/dist/_internal/engine/browser/controllers/variables/designer-variable-catalog-controller.d.ts +9 -1
  93. package/dist/_internal/engine/browser/controllers/variables/designer-variable-editor-controller.d.ts +6 -1
  94. package/dist/_internal/engine/browser/controllers/variables/designer-variables-controller.d.ts +16 -1
  95. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +2 -0
  96. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +2 -0
  97. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +1 -1
  98. package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +1 -1
  99. package/dist/_internal/engine/browser/dom/color/designer-color-palette-model.d.ts +3 -3
  100. package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +2 -2
  101. package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +1 -1
  102. package/dist/_internal/engine/browser/dom/dataset/designer-data-group-dom.d.ts +1 -1
  103. package/dist/_internal/engine/browser/dom/dataset/designer-data-panel-notice.d.ts +1 -1
  104. package/dist/_internal/engine/browser/dom/dataset/designer-data-state.d.ts +1 -1
  105. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-authoring-dom.d.ts +1 -1
  106. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-catalog-dom.d.ts +1 -1
  107. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-sections.d.ts +1 -1
  108. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +11 -4
  109. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +1 -1
  110. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +1 -1
  111. package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +1 -1
  112. package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
  113. package/dist/_internal/engine/browser/dom/designer-text-edit-dom.d.ts +2 -2
  114. package/dist/_internal/engine/browser/dom/designer-variable-inspector-dom.d.ts +7 -0
  115. package/dist/_internal/engine/browser/dom/designer-variables-dom.d.ts +5 -1
  116. package/dist/_internal/engine/browser/dom/designer-variables-editor-dom.d.ts +30 -1
  117. package/dist/_internal/engine/browser/dom/designer-variables-toolbar-dom.d.ts +4 -2
  118. package/dist/_internal/engine/browser/dom/intent/designer-intent-reference-picker-dom.d.ts +2 -0
  119. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +1 -1
  120. package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +3 -3
  121. package/dist/_internal/engine/browser/dom/menu/designer-plugin-command-menu.d.ts +5 -2
  122. package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +1 -1
  123. package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +2 -2
  124. package/dist/_internal/engine/browser/dom/panel/designer-multi-selection-dom.d.ts +1 -1
  125. package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +2 -2
  126. package/dist/_internal/engine/browser/dom/panel/designer-property-transactions.d.ts +1 -1
  127. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-dom.d.ts +1 -1
  128. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-mount.d.ts +1 -1
  129. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-summary-dom.d.ts +1 -1
  130. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +4 -4
  131. package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
  132. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-capabilities.d.ts +1 -1
  133. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +5 -5
  134. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +1 -1
  135. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +2 -2
  136. package/dist/_internal/engine/common/operations/canvas/canvas-background-image.d.ts +1 -1
  137. package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +1 -1
  138. package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +1 -1
  139. package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +4 -4
  140. package/dist/_internal/engine/common/operations/designer-clipboard.d.ts +5 -1
  141. package/dist/_internal/engine/common/operations/designer-text-edit-operations.d.ts +1 -1
  142. package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +3 -3
  143. package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +1 -1
  144. package/dist/_internal/engine/common/operations/intent/designer-parameter-intent.d.ts +1 -1
  145. package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +2 -2
  146. package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +1 -1
  147. package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +1 -1
  148. package/dist/_internal/engine/common/operations/plugin/designer-plugin-commands.d.ts +2 -0
  149. package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +9 -9
  150. package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +6 -6
  151. package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +1 -1
  152. package/dist/_internal/engine/common/session/designer-artboard.d.ts +1 -1
  153. package/dist/_internal/engine/common/session/designer-session.d.ts +1 -1
  154. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +3 -3
  155. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +85 -68
  156. package/dist/_internal/engine/{designer-blueprint-workbench-panel-BWSglfAb.js → designer-blueprint-workbench-panel-DVvKcSvJ.js} +70 -70
  157. package/dist/_internal/engine/{designer-dataset-controller-DdbY4ILC.js → designer-dataset-controller-bSR5OB6n.js} +1461 -1355
  158. package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +2 -2
  159. package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +2 -2
  160. package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +4 -4
  161. package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +2 -2
  162. package/dist/_internal/engine/designer-element/api/designer-element-host-resource-selection.d.ts +1 -1
  163. package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +10 -10
  164. package/dist/_internal/engine/designer-element/runtime/designer-element-plugin-commands.d.ts +3 -3
  165. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +2 -2
  166. package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +1 -1
  167. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +7 -7
  168. package/dist/_internal/engine/{designer-field-primitives-Crn464Qg.js → designer-field-primitives-C_StzrUa.js} +197 -178
  169. package/dist/_internal/engine/{designer-left-panel-groups-dom-DFdLWxxY.js → designer-left-panel-groups-dom-DBpI3Nc2.js} +19 -19
  170. package/dist/_internal/engine/{host-resource-selection-CWrPLVOc.js → host-resource-selection-BCRU23WQ.js} +446 -446
  171. package/dist/_internal/engine/index.js +3665 -3247
  172. package/dist/_internal/host-kit/index.d.ts +1 -1
  173. package/dist/_internal/host-kit/index.js +1 -1
  174. package/dist/_internal/host-kit/intent/index.d.ts +2 -1
  175. package/dist/_internal/host-kit/intent/index.js +1 -0
  176. package/dist/_internal/host-kit/intent/intent-behavior.d.ts +5 -5
  177. package/dist/_internal/host-kit/intent/intent-behavior.js +7 -7
  178. package/dist/_internal/host-kit/intent/intent-block.d.ts +11 -4
  179. package/dist/_internal/host-kit/intent/intent-block.js +87 -8
  180. package/dist/_internal/host-kit/intent/intent-catalog.d.ts +9 -6
  181. package/dist/_internal/host-kit/intent/intent-catalog.js +1 -1
  182. package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +10 -10
  183. package/dist/_internal/host-kit/intent/intent-compile.d.ts +1 -1
  184. package/dist/_internal/host-kit/intent/intent-compile.js +4 -4
  185. package/dist/_internal/host-kit/intent/intent-data-check.d.ts +4 -4
  186. package/dist/_internal/host-kit/intent/intent-data-context.d.ts +7 -7
  187. package/dist/_internal/host-kit/intent/intent-data-context.js +2 -2
  188. package/dist/_internal/host-kit/intent/intent-dataset.d.ts +4 -4
  189. package/dist/_internal/host-kit/intent/intent-dataset.js +2 -2
  190. package/dist/_internal/host-kit/intent/intent-format.d.ts +2 -2
  191. package/dist/_internal/host-kit/intent/intent-format.js +2 -2
  192. package/dist/_internal/host-kit/intent/intent-freeform.d.ts +48 -0
  193. package/dist/_internal/host-kit/intent/intent-freeform.js +412 -0
  194. package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +2 -2
  195. package/dist/_internal/host-kit/intent/intent-layout.d.ts +2 -2
  196. package/dist/_internal/host-kit/intent/intent-layout.js +2 -2
  197. package/dist/_internal/host-kit/intent/intent-parse.d.ts +2 -0
  198. package/dist/_internal/host-kit/intent/intent-parse.js +13 -12
  199. package/dist/_internal/host-kit/intent/intent-prepare.d.ts +7 -4
  200. package/dist/_internal/host-kit/intent/intent-prepare.js +54 -2
  201. package/dist/_internal/host-kit/intent/intent-session.d.ts +6 -6
  202. package/dist/_internal/host-kit/intent/intent-session.js +4 -4
  203. package/dist/_internal/host-kit/intent/intent-stream.js +2 -2
  204. package/dist/_internal/host-kit/intent/intent-style.d.ts +1 -1
  205. package/dist/_internal/host-kit/intent/intent-style.js +1 -1
  206. package/dist/_internal/host-kit/intent/intent-types.d.ts +55 -12
  207. package/dist/_internal/host-kit/intent/intent-types.js +1 -1
  208. package/dist/_internal/host-kit/push-result.d.ts +1 -1
  209. package/dist/_internal/host-kit/push-result.js +1 -1
  210. package/dist/_internal/host-kit/sse-subscribe.d.ts +1 -1
  211. package/dist/_internal/host-kit/sse-subscribe.js +1 -1
  212. package/dist/_internal/host-kit/subscription-hub.d.ts +3 -3
  213. package/dist/_internal/host-kit/subscription-hub.js +1 -1
  214. package/dist/_internal/material/base-material.d.ts +3 -3
  215. package/dist/_internal/material/editor-descriptor.d.ts +3 -3
  216. package/dist/_internal/plugin-core/contracts.d.ts +18 -16
  217. package/dist/_internal/plugin-core/contracts.js +1 -0
  218. package/dist/_internal/plugin-core/contribution-kind.d.ts +5 -5
  219. package/dist/_internal/plugin-core/contribution-kind.js +14 -6
  220. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +1 -1
  221. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +2 -2
  222. package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +1 -1
  223. package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +1 -1
  224. package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +2 -2
  225. package/dist/_internal/plugin-core/editor/editor-descriptor.js +1 -1
  226. package/dist/_internal/plugin-core/fragment/fragment.d.ts +4 -4
  227. package/dist/_internal/plugin-core/fragment/fragment.js +1 -1
  228. package/dist/_internal/plugin-core/material/material-manifest-fields.js +1 -1
  229. package/dist/_internal/plugin-core/material/material-manifest.js +1 -1
  230. package/dist/_internal/plugin-core/material/material-theme.d.ts +2 -2
  231. package/dist/_internal/plugin-core/material/material-theme.js +2 -2
  232. package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +5 -1
  233. package/dist/_internal/plugin-manager/contribution-kind-plan.js +20 -12
  234. package/dist/_internal/plugin-manager/manager.js +47 -30
  235. package/dist/_internal/plugin-manager/resolver.js +7 -13
  236. package/dist/_internal/plugin-manager/types.d.ts +2 -2
  237. package/dist/_internal/plugin-sdk/authoring-finding.d.ts +3 -3
  238. package/dist/_internal/plugin-sdk/fragment-audit.d.ts +6 -6
  239. package/dist/_internal/plugin-sdk/fragment-audit.js +8 -8
  240. package/dist/_internal/plugin-sdk/fragment-definition.d.ts +3 -3
  241. package/dist/_internal/plugin-sdk/fragment-definition.js +3 -3
  242. package/dist/_internal/plugin-sdk/material-config-groups.d.ts +2 -2
  243. package/dist/_internal/plugin-sdk/material-definition.d.ts +5 -1
  244. package/dist/_internal/plugin-sdk/material-definition.js +3 -3
  245. package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +9 -8
  246. package/dist/_internal/plugin-sdk/material-editor-audit.js +19 -11
  247. package/dist/_internal/plugin-sdk/material-isolated-csp.d.ts +1 -1
  248. package/dist/_internal/plugin-sdk/material-isolated-csp.js +1 -1
  249. package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +3 -3
  250. package/dist/_internal/plugin-sdk/material-isolated-runtime.js +3 -3
  251. package/dist/_internal/plugin-sdk/material-isolated.d.ts +9 -9
  252. package/dist/_internal/plugin-sdk/material-isolated.js +28 -8
  253. package/dist/_internal/plugin-sdk/material-package.d.ts +3 -3
  254. package/dist/_internal/plugin-sdk/material-package.js +7 -7
  255. package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +13 -6
  256. package/dist/_internal/plugin-sdk/material-rendered-element.js +36 -7
  257. package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +19 -11
  258. package/dist/_internal/plugin-sdk/material-spec-audit.js +85 -19
  259. package/dist/_internal/plugin-sdk/material-spec.d.ts +66 -21
  260. package/dist/_internal/plugin-sdk/material-spec.js +166 -42
  261. package/dist/_internal/plugin-sdk/material-style-keys.d.ts +6 -6
  262. package/dist/_internal/plugin-sdk/material-style-keys.js +7 -7
  263. package/dist/_internal/plugin-sdk/material-template-audit.d.ts +1 -1
  264. package/dist/_internal/plugin-sdk/material-template-audit.js +3 -3
  265. package/dist/_internal/plugin-sdk/material-template-expression.d.ts +3 -3
  266. package/dist/_internal/plugin-sdk/material-template-expression.js +2 -2
  267. package/dist/_internal/plugin-sdk/material-template-render.d.ts +1 -1
  268. package/dist/_internal/plugin-sdk/material-template.d.ts +6 -6
  269. package/dist/_internal/plugin-sdk/material-template.js +2 -2
  270. package/dist/_internal/plugin-sdk/plugin-package.d.ts +2 -2
  271. package/dist/_internal/plugin-sdk/plugin-package.js +3 -3
  272. package/dist/_internal/plugin-sdk/plugin-registration.d.ts +2 -5
  273. package/dist/_internal/plugin-sdk/plugin-registration.js +3 -3
  274. package/dist/_internal/renderer/renderer/renderer-candidates.d.ts +1 -1
  275. package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +1 -1
  276. package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +1 -1
  277. package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +1 -1
  278. package/dist/_internal/renderer/renderer/renderer-state.d.ts +2 -2
  279. package/dist/_internal/renderer/renderer/renderer-theme.d.ts +1 -1
  280. package/dist/_internal/renderer/renderer/renderer-types.d.ts +1 -1
  281. package/dist/_internal/renderer/renderer/renderer.d.ts +5 -5
  282. package/dist/_internal/renderer/resource/data-source-runtime.d.ts +3 -3
  283. package/dist/_internal/renderer/resource/push-window.d.ts +1 -1
  284. package/dist/_internal/renderer/resource/request-coordinator.d.ts +1 -1
  285. package/dist/_internal/renderer/resource/source-query-port.d.ts +3 -3
  286. package/dist/_internal/renderer/sub-canvas-layer.d.ts +2 -2
  287. package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +1 -1
  288. package/dist/_internal/renderer/viewer/viewer.d.ts +3 -3
  289. package/dist/auto-register.js +9 -9
  290. package/dist/contracts.js +1 -1
  291. package/dist/contracts.js.map +1 -1
  292. package/dist/core.js.map +1 -1
  293. package/dist/dataset-port-D993nOlT.js.map +1 -1
  294. package/dist/dataset-profile-Dk6xdtsM.js.map +1 -1
  295. package/dist/{designer-CFOvOmLn.js → designer-DzBm8tXS.js} +2 -2
  296. package/dist/{designer-CFOvOmLn.js.map → designer-DzBm8tXS.js.map} +1 -1
  297. package/dist/designer-auto-register.js +5 -5
  298. package/dist/{designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js → designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js} +111 -111
  299. package/dist/designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js.map +1 -0
  300. package/dist/{designer-dataset-controller-DdbY4ILC-CMdGdGbr.js → designer-dataset-controller-bSR5OB6n-DfUP24S6.js} +1052 -946
  301. package/dist/designer-dataset-controller-bSR5OB6n-DfUP24S6.js.map +1 -0
  302. package/dist/{designer-field-primitives-Crn464Qg-Bi7q8s5J.js → designer-field-primitives-C_StzrUa-QZpcn0yX.js} +198 -179
  303. package/dist/designer-field-primitives-C_StzrUa-QZpcn0yX.js.map +1 -0
  304. package/dist/{designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js} +17 -17
  305. package/dist/{designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js.map → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js.map} +1 -1
  306. package/dist/designer.js +5 -5
  307. package/dist/{dist-CHK9BTXX.js → dist-YCmniYuO.js} +4801 -4383
  308. package/dist/dist-YCmniYuO.js.map +1 -0
  309. package/dist/engine.js +4 -4
  310. package/dist/fragment-B-oP0Fru.js.map +1 -1
  311. package/dist/host-kit.js +979 -554
  312. package/dist/host-kit.js.map +1 -1
  313. package/dist/{host-resource-selection-CWrPLVOc-DPDq3jau.js → host-resource-selection-BCRU23WQ-Cedz0d14.js} +206 -206
  314. package/dist/host-resource-selection-BCRU23WQ-Cedz0d14.js.map +1 -0
  315. package/dist/image-url-D6mUcjY1.js.map +1 -1
  316. package/dist/index.js +9 -9
  317. package/dist/legibility-CS28ivEz.js.map +1 -1
  318. package/dist/level-scale-CwHqFEVd.js.map +1 -1
  319. package/dist/{manager-CeB4Jnr9.js → manager-BcvdcZjM.js} +230 -210
  320. package/dist/manager-BcvdcZjM.js.map +1 -0
  321. package/dist/{material-DeVkzSoT.js → material-ReRzBIbb.js} +2 -2
  322. package/dist/{material-DeVkzSoT.js.map → material-ReRzBIbb.js.map} +1 -1
  323. package/dist/material-auto-register.js +1 -1
  324. package/dist/{material-definition-BeW34dJr.js → material-definition-BcjFM-B-.js} +9 -9
  325. package/dist/material-definition-BcjFM-B-.js.map +1 -0
  326. package/dist/material-manifest-B1XatGPx.js.map +1 -1
  327. package/dist/material-theme-C91eus78.js.map +1 -1
  328. package/dist/material.js +2 -2
  329. package/dist/migrate-document-BM888PtC.js.map +1 -1
  330. package/dist/{parse-aZat9tAS.js → parse-1U_-Qtn4.js} +2 -2
  331. package/dist/parse-1U_-Qtn4.js.map +1 -0
  332. package/dist/parse-Ji7kE9ZT.js.map +1 -1
  333. package/dist/{plugin-CstHQ5ws.js → plugin-BH-4oNvT.js} +60 -52
  334. package/dist/plugin-BH-4oNvT.js.map +1 -0
  335. package/dist/plugin-core.js +1 -1
  336. package/dist/plugin-manager.js +1 -1
  337. package/dist/{plugin-package-DWifuHi1.js → plugin-package-Cj-3iLv3.js} +2068 -1905
  338. package/dist/plugin-package-Cj-3iLv3.js.map +1 -0
  339. package/dist/{plugin-registration-DTwBvnHX.js → plugin-registration-C9_IxTxc.js} +9 -9
  340. package/dist/{plugin-registration-DTwBvnHX.js.map → plugin-registration-C9_IxTxc.js.map} +1 -1
  341. package/dist/plugin-sdk.js +6 -6
  342. package/dist/{plugins-QDL0yIql.js → plugins-CwATlfr0.js} +2 -2
  343. package/dist/{plugins-QDL0yIql.js.map → plugins-CwATlfr0.js.map} +1 -1
  344. package/dist/plugins.js +8 -8
  345. package/dist/runtime-dispatch-C0gyIrTv.js.map +1 -1
  346. package/dist/runtime-simulate-aSYO9yDX.js.map +1 -1
  347. package/dist/{src-Bm7u11mN-Bi1hDVkh.js → src-Bm7u11mN-DFLnFQSk.js} +19 -19
  348. package/dist/{src-Bm7u11mN-Bi1hDVkh.js.map → src-Bm7u11mN-DFLnFQSk.js.map} +1 -1
  349. package/dist/{text-BSTz0pFQ.js → text-DfKom8EG.js} +2 -2
  350. package/dist/{text-BSTz0pFQ.js.map → text-DfKom8EG.js.map} +1 -1
  351. package/dist/theme-CcBXf4Ay.js.map +1 -1
  352. package/dist/value-ref-XkLuckGV.js.map +1 -1
  353. package/dist/{viewer-CrJupI8I-BJiz1cvW.js → viewer-CrJupI8I-CeQS58mA.js} +4 -4
  354. package/dist/{viewer-CrJupI8I-BJiz1cvW.js.map → viewer-CrJupI8I-CeQS58mA.js.map} +1 -1
  355. package/dist/viewer-auto-register.js +1 -1
  356. package/dist/viewer.js +1 -1
  357. package/dist/viewport-BNIRWjiT.js.map +1 -1
  358. package/package.json +13 -13
  359. package/dist/designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map +0 -1
  360. package/dist/designer-dataset-controller-DdbY4ILC-CMdGdGbr.js.map +0 -1
  361. package/dist/designer-field-primitives-Crn464Qg-Bi7q8s5J.js.map +0 -1
  362. package/dist/dist-CHK9BTXX.js.map +0 -1
  363. package/dist/host-resource-selection-CWrPLVOc-DPDq3jau.js.map +0 -1
  364. package/dist/manager-CeB4Jnr9.js.map +0 -1
  365. package/dist/material-definition-BeW34dJr.js.map +0 -1
  366. package/dist/parse-aZat9tAS.js.map +0 -1
  367. package/dist/plugin-CstHQ5ws.js.map +0 -1
  368. package/dist/plugin-package-DWifuHi1.js.map +0 -1
package/dist/host-kit.js CHANGED
@@ -6,14 +6,15 @@ import { t as s } from "./migrate-document-BM888PtC.js";
6
6
  import { n as c } from "./runtime-simulate-aSYO9yDX.js";
7
7
  import { o as l, r as u } from "./dataset-profile-Dk6xdtsM.js";
8
8
  import { t as d } from "./state-preset-DtpygJOH.js";
9
- import { n as f } from "./legibility-CS28ivEz.js";
9
+ import { o as f } from "./contrast-DRPezUIl.js";
10
+ import { n as p } from "./legibility-CS28ivEz.js";
10
11
  //#region ../host-kit/dist/http.js
11
- var p = {
12
+ var m = {
12
13
  code: "NETWORK",
13
14
  message: "网络请求失败,请确认后端服务已启动。",
14
15
  status: 0
15
16
  };
16
- function m(e) {
17
+ function h(e) {
17
18
  let t = e.fetch ?? fetch, n = e.baseUrl.replace(/\/+$/, "");
18
19
  return { async request(e, r = {}) {
19
20
  let { method: i = "GET", body: a, signal: o } = r;
@@ -32,7 +33,7 @@ function m(e) {
32
33
  data: s
33
34
  } : {
34
35
  ok: !1,
35
- error: h(s, r.status)
36
+ error: g(s, r.status)
36
37
  };
37
38
  } catch (e) {
38
39
  return e instanceof DOMException && e.name === "AbortError" ? {
@@ -44,12 +45,12 @@ function m(e) {
44
45
  }
45
46
  } : {
46
47
  ok: !1,
47
- error: p
48
+ error: m
48
49
  };
49
50
  }
50
51
  } };
51
52
  }
52
- function h(e, t) {
53
+ function g(e, t) {
53
54
  if (typeof e == "object" && e) {
54
55
  let n = e;
55
56
  if (typeof n.error == "string" && typeof n.message == "string") return {
@@ -64,22 +65,22 @@ function h(e, t) {
64
65
  status: t
65
66
  };
66
67
  }
67
- function g(e) {
68
+ function _(e) {
68
69
  let t = new URLSearchParams();
69
70
  for (let [n, r] of Object.entries(e)) r !== void 0 && r !== "" && t.set(n, String(r));
70
71
  let n = t.toString();
71
72
  return n === "" ? "" : `?${n}`;
72
73
  }
73
- function _(e) {
74
+ function v(e) {
74
75
  if (e === void 0) return;
75
76
  let t = new AbortController();
76
77
  return e.aborted ? (t.abort(), t.signal) : (e.addEventListener("abort", () => t.abort(), { once: !0 }), t.signal);
77
78
  }
78
79
  //#endregion
79
80
  //#region ../host-kit/dist/operation.js
80
- async function v(e, t, n, r) {
81
+ async function y(e, t, n, r) {
81
82
  try {
82
- let i = _(n);
83
+ let i = v(n);
83
84
  if (i === void 0) throw Error("缺少取消信号。");
84
85
  return await e.execute(t, i, r);
85
86
  } catch (e) {
@@ -92,7 +93,7 @@ async function v(e, t, n, r) {
92
93
  };
93
94
  }
94
95
  }
95
- function y(e, t, n, r) {
96
+ function b(e, t, n, r) {
96
97
  if (e !== void 0) try {
97
98
  let i = { ...t };
98
99
  Reflect.deleteProperty(i, "signal");
@@ -104,7 +105,7 @@ function y(e, t, n, r) {
104
105
  Promise.resolve(a).catch(() => {});
105
106
  } catch {}
106
107
  }
107
- function b(e, t, n, r = (e) => e) {
108
+ function x(e, t, n, r = (e) => e) {
108
109
  return {
109
110
  async execute(r, i) {
110
111
  let a;
@@ -135,30 +136,30 @@ function b(e, t, n, r = (e) => e) {
135
136
  }
136
137
  //#endregion
137
138
  //#region ../host-kit/dist/dataset-port.js
138
- var x = 6e4;
139
- function S(i) {
139
+ var S = 6e4;
140
+ function C(i) {
140
141
  let a;
141
142
  async function o(e, t, n, r, i, a) {
142
- if (n.aborted) return D();
143
- let o = await v(e, t, n, a);
144
- if (n.aborted || !o.ok && o.error.code === "ABORTED") return D();
143
+ if (n.aborted) return O();
144
+ let o = await y(e, t, n, a);
145
+ if (n.aborted || !o.ok && o.error.code === "ABORTED") return O();
145
146
  let s;
146
- if (!o.ok) s = E(T(o.error), o.error.message);
147
+ if (!o.ok) s = D(E(o.error), o.error.message);
147
148
  else try {
148
149
  let n = r(e.response ? e.response(o.data, t) : o.data);
149
- s = n.ok ? n : E("HOST_DATASET_INVALID", "数据集响应格式无效。");
150
+ s = n.ok ? n : D("HOST_DATASET_INVALID", "数据集响应格式无效。");
150
151
  } catch {
151
- s = E("HOST_DATASET_INVALID", "数据集响应格式无效。");
152
+ s = D("HOST_DATASET_INVALID", "数据集响应格式无效。");
152
153
  }
153
- return n.aborted ? D() : (y(i, t, s, o.ok ? void 0 : o.error), s);
154
+ return n.aborted ? O() : (b(i, t, s, o.ok ? void 0 : o.error), s);
154
155
  }
155
156
  let s = i.groups;
156
157
  return {
157
158
  queryScope: "dataset",
158
159
  ...s === void 0 ? {} : { async groups(e) {
159
- if (e.signal.aborted) return D();
160
+ if (e.signal.aborted) return O();
160
161
  let n = a;
161
- if (n !== void 0 && Date.now() - n.at < x) return {
162
+ if (n !== void 0 && Date.now() - n.at < S) return {
162
163
  ok: !0,
163
164
  value: n.value,
164
165
  diagnostics: []
@@ -174,13 +175,13 @@ function S(i) {
174
175
  query: (t, n) => o(i.query, t, n.signal, e, i.onQueryResult, n.context)
175
176
  };
176
177
  }
177
- function C(e) {
178
- let t = m(e);
179
- return S({
180
- groups: b(t, e.mapping?.groups, () => ({ path: `/datasets${g({ limit: 1 })}` }), (e) => {
178
+ function w(e) {
179
+ let t = h(e);
180
+ return C({
181
+ groups: x(t, e.mapping?.groups, () => ({ path: `/datasets${_({ limit: 1 })}` }), (e) => {
181
182
  if (!(typeof e != "object" || !e || Array.isArray(e))) return "groups" in e ? e.groups : [];
182
183
  }),
183
- list: b(t, e.mapping?.list, (e) => ({ path: `/datasets${g({
184
+ list: x(t, e.mapping?.list, (e) => ({ path: `/datasets${_({
184
185
  query: e.query,
185
186
  limit: e.limit,
186
187
  groupId: e.groupId,
@@ -191,19 +192,19 @@ function C(e) {
191
192
  ..."nextCursor" in e ? { nextCursor: e.nextCursor } : {}
192
193
  };
193
194
  }),
194
- describe: b(t, e.mapping?.describe, (e) => ({ path: `/datasets/${encodeURIComponent(e.datasetId)}` })),
195
- query: b(t, e.mapping?.query, (e) => ({ path: `/datasets/${encodeURIComponent(e.datasetId)}/query${g(w(e.params))}` }))
195
+ describe: x(t, e.mapping?.describe, (e) => ({ path: `/datasets/${encodeURIComponent(e.datasetId)}` })),
196
+ query: x(t, e.mapping?.query, (e) => ({ path: `/datasets/${encodeURIComponent(e.datasetId)}/query${_(T(e.params))}` }))
196
197
  });
197
198
  }
198
- function w(e) {
199
+ function T(e) {
199
200
  let t = {};
200
201
  for (let [n, r] of Object.entries(e)) (typeof r == "string" || typeof r == "number" || typeof r == "boolean") && (t[n] = r);
201
202
  return t;
202
203
  }
203
- function T(e) {
204
+ function E(e) {
204
205
  return e.code === "HOST_KIT_MAPPING" ? "HOST_DATASET_INVALID" : e.code === "UNKNOWN_DATASET" || e.status === 404 ? "HOST_DATASET_UNAVAILABLE" : e.status === 400 || e.status === 422 ? "HOST_DATASET_PARAMETER_INVALID" : "HOST_DATASET_UNAVAILABLE";
205
206
  }
206
- function E(e, t) {
207
+ function D(e, t) {
207
208
  return {
208
209
  ok: !1,
209
210
  diagnostics: [{
@@ -214,7 +215,7 @@ function E(e, t) {
214
215
  }]
215
216
  };
216
217
  }
217
- function D() {
218
+ function O() {
218
219
  return {
219
220
  ok: !1,
220
221
  diagnostics: []
@@ -222,7 +223,7 @@ function D() {
222
223
  }
223
224
  //#endregion
224
225
  //#region ../host-kit/dist/intent/intent-behavior.js
225
- var O = /* @__PURE__ */ new Set([
226
+ var k = /* @__PURE__ */ new Set([
226
227
  "AGENT_INTERACTION_SOURCE_UNKNOWN",
227
228
  "AGENT_INTERACTION_TARGET_UNKNOWN",
228
229
  "AGENT_INTERACTION_EVENT_UNKNOWN",
@@ -232,7 +233,7 @@ var O = /* @__PURE__ */ new Set([
232
233
  "AGENT_STATE_FIELD_TYPE",
233
234
  "AGENT_INTERACTION_STATE_UNKNOWN"
234
235
  ]);
235
- function k(e) {
236
+ function A(e) {
236
237
  let t = [], n = (e) => ({
237
238
  kind: "block",
238
239
  origin: e.origin,
@@ -252,26 +253,26 @@ function k(e) {
252
253
  else r.kind === "grid" ? t.push(...r.blocks.map(n)) : t.push(...r.main.map(n), ...r.rail.map(n));
253
254
  return t;
254
255
  }
255
- function A(e, t) {
256
+ function j(e, t) {
256
257
  let n = e.find((e) => e.key === t) ?? e.find((e) => (e.ident ?? e.origin) === t);
257
258
  if (n !== void 0) return n;
258
259
  let r = e.filter((e) => e.title.trim() === t.trim());
259
260
  return r.length === 1 ? r[0] : void 0;
260
261
  }
261
- function ee(e, t) {
262
+ function M(e, t) {
262
263
  let n = [], r = e.interactions ?? [];
263
264
  if (r.length === 0 || t === void 0) return {
264
265
  intent: e,
265
266
  warnings: n
266
267
  };
267
- let i = k(e), a = /* @__PURE__ */ new Map();
268
+ let i = A(e), a = /* @__PURE__ */ new Map();
268
269
  for (let e of r) {
269
270
  if (e.kind !== "filter") continue;
270
- let r = A(i, e.from);
271
+ let r = j(i, e.from);
271
272
  if (r === void 0) continue;
272
- let o = M(r, e.field, t);
273
+ let o = P(r, e.field, t);
273
274
  for (let r of e.to) {
274
- let s = A(i, r), c = s === void 0 ? void 0 : j(s);
275
+ let s = j(i, r), c = s === void 0 ? void 0 : N(s);
275
276
  if (s === void 0 || c === void 0) continue;
276
277
  let l = t.datasets.find((e) => e.datasetId === c.datasetId)?.parameters?.find((t) => t.name === e.param);
277
278
  if (l === void 0 || !l.required || l.defaultValue !== void 0 || c.params !== void 0 && Object.hasOwn(c.params, e.param)) continue;
@@ -339,21 +340,21 @@ function ee(e, t) {
339
340
  warnings: n
340
341
  };
341
342
  }
342
- function j(e) {
343
+ function N(e) {
343
344
  if (e.kpi?.bind !== void 0) return e.kpi.bind;
344
345
  if (e.block?.bind.kind === "dataset") return e.block.bind;
345
346
  }
346
- function M(e, t, n) {
347
+ function P(e, t, n) {
347
348
  if (t === void 0) return;
348
349
  let r = e.block?.bind;
349
- if (r?.kind === "table") return [...new Set(r.table.rows.map((e) => e[t]).filter(N))];
350
- let i = j(e);
350
+ if (r?.kind === "table") return [...new Set(r.table.rows.map((e) => e[t]).filter(F))];
351
+ let i = N(e);
351
352
  if (i !== void 0) return n?.datasets.find((e) => e.datasetId === i.datasetId)?.values?.[t];
352
353
  }
353
- function N(e) {
354
+ function F(e) {
354
355
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
355
356
  }
356
- function te(e) {
357
+ function ee(e) {
357
358
  let t = {
358
359
  variables: [],
359
360
  blueprint: {
@@ -361,13 +362,13 @@ function te(e) {
361
362
  edges: []
362
363
  },
363
364
  behaviors: []
364
- }, n = k(e.intent), r = new P(e, t);
365
+ }, n = A(e.intent), r = new te(e, t);
365
366
  for (let t of e.intent.interactions ?? []) t.kind === "filter" ? r.filter(t, n) : t.kind === "show" && r.show(t, n);
366
367
  for (let e of n) e.kpi?.states !== void 0 && r.states(e, e.kpi);
367
368
  for (let t of e.intent.interactions ?? []) t.kind === "state" && r.setState(t, n);
368
369
  return t;
369
370
  }
370
- var P = class {
371
+ var te = class {
371
372
  input;
372
373
  output;
373
374
  #e = 0;
@@ -422,7 +423,7 @@ var P = class {
422
423
  });
423
424
  }
424
425
  sourceEvent(e, t) {
425
- let n = A(t, e.from), r = n === void 0 ? void 0 : this.mainOf(n);
426
+ let n = j(t, e.from), r = n === void 0 ? void 0 : this.mainOf(n);
426
427
  if (n === void 0 || r === void 0) {
427
428
  this.warn("AGENT_INTERACTION_SOURCE_UNKNOWN", e.origin, `No compiled block is addressed by "${e.from}".`);
428
429
  return;
@@ -455,7 +456,7 @@ var P = class {
455
456
  }
456
457
  let o = this.payloadPath(e, n);
457
458
  if (o === void 0) return;
458
- let s = o[0] === "row" ? o[1] : o[0] === "x" ? ae(n.component) : o[0] === "value" ? ie(n.component) : void 0, c = M(n.item, s, this.input.references), l = [];
459
+ let s = o[0] === "row" ? o[1] : o[0] === "x" ? ae(n.component) : o[0] === "value" ? ie(n.component) : void 0, c = P(n.item, s, this.input.references), l = [];
459
460
  for (let n of e.to) {
460
461
  let r = this.filterTarget(e, n, t);
461
462
  r !== void 0 && l.push(r);
@@ -593,7 +594,7 @@ var P = class {
593
594
  this.warn("AGENT_INTERACTION_EVENT_UNKNOWN", e.origin, `${e.event} carries no value that can drive a filter.`);
594
595
  }
595
596
  filterTarget(e, t, n) {
596
- let r = A(n, t), i = r === void 0 ? void 0 : this.mainOf(r);
597
+ let r = j(n, t), i = r === void 0 ? void 0 : this.mainOf(r);
597
598
  if (r === void 0 || i === void 0) {
598
599
  this.warn("AGENT_INTERACTION_TARGET_UNKNOWN", e.origin, `No compiled block is addressed by "${t}".`);
599
600
  return;
@@ -606,7 +607,7 @@ var P = class {
606
607
  });
607
608
  return;
608
609
  }
609
- let d = s?.params?.[e.param], f = N(d?.value) ? d.value : u.defaultValue;
610
+ let d = s?.params?.[e.param], f = F(d?.value) ? d.value : u.defaultValue;
610
611
  if (f === void 0) {
611
612
  this.warn("AGENT_INTERACTION_TARGET_INVALID", e.origin, `Parameter ${e.param} of ${this.nameOf(r)} has no starting value.`, {
612
613
  target: this.nameOf(r),
@@ -685,7 +686,7 @@ var P = class {
685
686
  if (d === void 0) continue;
686
687
  s = !0;
687
688
  let f = d.after;
688
- N(f) && (o === void 0 || o.includes(f)) && (l = !0);
689
+ F(f) && (o === void 0 || o.includes(f)) && (l = !0);
689
690
  }
690
691
  return l ? "changes" : s ? "not-allowed" : "same";
691
692
  }
@@ -699,7 +700,7 @@ var P = class {
699
700
  }
700
701
  let a = [];
701
702
  for (let r of e.to) {
702
- let i = A(t, r), o = i === void 0 ? void 0 : this.rootOf(i);
703
+ let i = j(t, r), o = i === void 0 ? void 0 : this.rootOf(i);
703
704
  if (i === void 0 || o === void 0) {
704
705
  this.warn("AGENT_INTERACTION_TARGET_UNKNOWN", e.origin, `No compiled block is addressed by "${r}".`);
705
706
  continue;
@@ -825,7 +826,7 @@ var P = class {
825
826
  }
826
827
  let a = e.state.toLowerCase() === "reset", o = [], s = "";
827
828
  for (let r of e.to) {
828
- let i = A(t, r), c = i === void 0 ? void 0 : this.mainOf(i);
829
+ let i = j(t, r), c = i === void 0 ? void 0 : this.mainOf(i);
829
830
  if (i === void 0 || c === void 0) {
830
831
  this.warn("AGENT_INTERACTION_TARGET_UNKNOWN", e.origin, `No compiled block is addressed by "${r}".`);
831
832
  continue;
@@ -1042,7 +1043,7 @@ function he(e, t) {
1042
1043
  function ge(e, t, n, r) {
1043
1044
  let i = n.catalog.materials.find((t) => t.type === e.type);
1044
1045
  if (i === void 0) {
1045
- r.sink.warnings.push(F("AGENT_MATERIAL_UNKNOWN", e, `The catalog has no material ${e.type}.`));
1046
+ r.sink.warnings.push(I("AGENT_MATERIAL_UNKNOWN", e, `The catalog has no material ${e.type}.`));
1046
1047
  return;
1047
1048
  }
1048
1049
  let a = _e(i, e, n, r);
@@ -1079,9 +1080,10 @@ function ge(e, t, n, r) {
1079
1080
  y: t.y + d,
1080
1081
  width: t.width,
1081
1082
  height: t.height - d
1082
- }, p = e.title.trim() === "" ? i.name : e.title, m = we(f), h = {
1083
+ }, p = e.title.trim() === "" ? i.name : e.title, m = Ee(f), h = {
1083
1084
  ...a.style ?? {},
1084
- ...Ce(i, e, m.height)
1085
+ ...Ce(i, e.style),
1086
+ ...Te(i, e, m.height)
1085
1087
  };
1086
1088
  n.push(i, p, m, {
1087
1089
  props: xe(i, e.props),
@@ -1096,13 +1098,13 @@ function _e(e, t, n, r) {
1096
1098
  let { datasetId: r } = t.bind, a = n.references?.datasets.find((e) => e.datasetId === r);
1097
1099
  if (a !== void 0) {
1098
1100
  let n = de(a, t.bind.params);
1099
- if (!n.ok && n.invalid.length > 0) return i.warnings.push(F("AGENT_DATASET_PARAM_INVALID", t, `Parameter(s) ${n.invalid.join(", ")} of dataset ${r} are not declared or not allowed.`)), null;
1101
+ if (!n.ok && n.invalid.length > 0) return i.warnings.push(I("AGENT_DATASET_PARAM_INVALID", t, `Parameter(s) ${n.invalid.join(", ")} of dataset ${r} are not declared or not allowed.`)), null;
1100
1102
  if (!n.ok) return i.warnings.push({
1101
- ...F("AGENT_DATASET_PARAM_REQUIRED", t, `Dataset ${r} requires parameter(s) ${n.missing.map((e) => e.name).join(", ")} without a default; the block is skipped.`),
1103
+ ...I("AGENT_DATASET_PARAM_REQUIRED", t, `Dataset ${r} requires parameter(s) ${n.missing.map((e) => e.name).join(", ")} without a default; the block is skipped.`),
1102
1104
  detail: he(a, n.missing)
1103
1105
  }), null;
1104
1106
  let o = t.bind.fields === void 0 ? void 0 : pe(e, a, t.bind.fields);
1105
- if (o !== void 0 && !o.ok) return i.warnings.push(F(o.code, t, o.message)), null;
1107
+ if (o !== void 0 && !o.ok) return i.warnings.push(I(o.code, t, o.message)), null;
1106
1108
  let s = me(i, a, n.params);
1107
1109
  if (o !== void 0) return {
1108
1110
  dataValue: {
@@ -1126,12 +1128,12 @@ function _e(e, t, n, r) {
1126
1128
  ...c === null ? {} : { dataBinding: { fields: c } }
1127
1129
  };
1128
1130
  }
1129
- i.warnings.push(F("AGENT_DATASET_UNKNOWN", t, `Dataset ${r} is not part of this round's references; the block is skipped.`));
1131
+ i.warnings.push(I("AGENT_DATASET_UNKNOWN", t, `Dataset ${r} is not part of this round's references; the block is skipped.`));
1130
1132
  }
1131
1133
  let r = t.bind.kind === "table" ? t.bind.table : void 0;
1132
- if (r === void 0) return i.warnings.push(F("AGENT_BLOCK_DATA_MISSING", t, `${e.type} is a data material but no table was given.`)), null;
1134
+ if (r === void 0) return i.warnings.push(I("AGENT_BLOCK_DATA_MISSING", t, `${e.type} is a data material but no table was given.`)), null;
1133
1135
  let a = ve(e, r);
1134
- return a === null ? (i.warnings.push(F("AGENT_BLOCK_BINDING_UNSATISFIED", t, `The binding roles of ${e.type} cannot be satisfied by these ${r.columns.length} columns; the block degraded to an empty one.`)), {}) : {
1136
+ return a === null ? (i.warnings.push(I("AGENT_BLOCK_BINDING_UNSATISFIED", t, `The binding roles of ${e.type} cannot be satisfied by these ${r.columns.length} columns; the block degraded to an empty one.`)), {}) : {
1135
1137
  dataValue: {
1136
1138
  kind: "inline",
1137
1139
  value: be(r),
@@ -1143,7 +1145,7 @@ function _e(e, t, n, r) {
1143
1145
  if (e.data === "scalar") {
1144
1146
  if (t.bind.kind === "asset") {
1145
1147
  let { assetId: a } = t.bind, o = n.catalog.assets.find((e) => e.id === a);
1146
- if (o === void 0) return i.warnings.push(F("AGENT_ASSET_UNKNOWN", t, `Asset ${a} is not in the host asset list.`)), null;
1148
+ if (o === void 0) return i.warnings.push(I("AGENT_ASSET_UNKNOWN", t, `Asset ${a} is not in the host asset list.`)), null;
1147
1149
  let s = `agent-ds-${i.dataSources.length + 1}`;
1148
1150
  return i.dataSources.push({
1149
1151
  id: s,
@@ -1163,10 +1165,10 @@ function _e(e, t, n, r) {
1163
1165
  }
1164
1166
  };
1165
1167
  }
1166
- if (e.asset) return i.warnings.push(F("AGENT_BLOCK_ASSET_REQUIRED", t, `${e.type} needs an assetId but only text was given; the block is skipped.`)), null;
1168
+ if (e.asset) return i.warnings.push(I("AGENT_BLOCK_ASSET_REQUIRED", t, `${e.type} needs an assetId but only text was given; the block is skipped.`)), null;
1167
1169
  let a = t.bind.kind === "text" ? t.bind.text : "";
1168
- return a === "" ? (i.warnings.push(F("AGENT_BLOCK_DATA_MISSING", t, `${e.type} is a value material but no text was given.`)), null) : {
1169
- ...n.textMaterial !== void 0 && e.type === n.textMaterial.type ? { style: Se(e, {
1170
+ return a === "" ? (i.warnings.push(I("AGENT_BLOCK_DATA_MISSING", t, `${e.type} is a value material but no text was given.`)), null) : {
1171
+ ...n.textMaterial !== void 0 && e.type === n.textMaterial.type ? { style: we(e, {
1170
1172
  fontSize: 18,
1171
1173
  color: n.palette.text,
1172
1174
  lineSpacing: a.includes("\n") ? 8 : 0
@@ -1179,7 +1181,7 @@ function _e(e, t, n, r) {
1179
1181
  }
1180
1182
  return {};
1181
1183
  }
1182
- function F(e, t, n) {
1184
+ function I(e, t, n) {
1183
1185
  return {
1184
1186
  severity: "warning",
1185
1187
  code: e,
@@ -1241,7 +1243,10 @@ function xe(e, t) {
1241
1243
  continue;
1242
1244
  }
1243
1245
  if (t.kind === "number") {
1244
- typeof i == "number" && Number.isFinite(i) && (n[r] = i);
1246
+ if (typeof i == "number" && Number.isFinite(i)) {
1247
+ let e = t.min ?? -Infinity, a = t.max ?? Infinity;
1248
+ n[r] = Math.min(a, Math.max(e, i));
1249
+ }
1245
1250
  continue;
1246
1251
  }
1247
1252
  if (t.kind === "boolean") {
@@ -1253,18 +1258,61 @@ function xe(e, t) {
1253
1258
  }
1254
1259
  return n;
1255
1260
  }
1256
- function Se(e, t) {
1261
+ var Se = [
1262
+ "fontSize",
1263
+ "fontWeight",
1264
+ "color",
1265
+ "fill",
1266
+ "backgroundColor",
1267
+ "align",
1268
+ "textAlign",
1269
+ "lineSpacing"
1270
+ ];
1271
+ function Ce(e, t) {
1272
+ if (t === void 0) return {};
1273
+ let n = e.defaults.style, r = p(1920), i = {};
1274
+ for (let e of Se) {
1275
+ let a = t[e];
1276
+ if (!(a === void 0 || !(e in n))) {
1277
+ if (e === "fontSize") {
1278
+ typeof a == "number" && Number.isFinite(a) && (i.fontSize = Math.max(r, Math.round(a)));
1279
+ continue;
1280
+ }
1281
+ if (e === "fontWeight") {
1282
+ if (typeof n.fontWeight == "number") {
1283
+ let e = typeof a == "number" ? a : Number(a);
1284
+ typeof a != "boolean" && Number.isFinite(e) && (i.fontWeight = e);
1285
+ continue;
1286
+ }
1287
+ let e = typeof a == "number" ? a : Number(a);
1288
+ typeof a != "boolean" && Number.isFinite(e) ? i.fontWeight = e >= 600 ? "700" : "400" : a === "bold" || a === "bolder" ? i.fontWeight = "700" : (a === "normal" || a === "lighter") && (i.fontWeight = "400");
1289
+ continue;
1290
+ }
1291
+ if (e === "lineSpacing") {
1292
+ typeof a == "number" && Number.isFinite(a) && (i.lineSpacing = a);
1293
+ continue;
1294
+ }
1295
+ if (e === "align" || e === "textAlign") {
1296
+ (a === "left" || a === "center" || a === "right") && (i[e] = a);
1297
+ continue;
1298
+ }
1299
+ (e === "color" || e === "fill" || e === "backgroundColor") && typeof a == "string" && f(a) !== void 0 && (i[e] = a);
1300
+ }
1301
+ }
1302
+ return i;
1303
+ }
1304
+ function we(e, t) {
1257
1305
  let n = e.defaults.style, r = {};
1258
1306
  return t.fontSize !== void 0 && "fontSize" in n && (r.fontSize = t.fontSize), t.fontWeight !== void 0 && "fontWeight" in n && (r.fontWeight = t.fontWeight), t.color !== void 0 && "color" in n && (r.color = t.color), t.lineSpacing !== void 0 && "lineSpacing" in n && (r.lineSpacing = t.lineSpacing), r;
1259
1307
  }
1260
- function Ce(e, t, n) {
1308
+ function Te(e, t, n) {
1261
1309
  if (!("rowHeight" in e.defaults.style)) return {};
1262
1310
  let r = t.bind.kind === "table" ? t.bind.table.rows.length : 0;
1263
1311
  if (r === 0) return {};
1264
1312
  let i = e.defaults.style.rowHeight, a = typeof i == "number" && i > 0 ? i : 32, o = Math.floor((n - 4) / (r + 1));
1265
1313
  return { rowHeight: Math.min(a, Math.max(20, o)) };
1266
1314
  }
1267
- function we(e) {
1315
+ function Ee(e) {
1268
1316
  return {
1269
1317
  x: e.x + 16,
1270
1318
  y: e.y + 16,
@@ -1274,65 +1322,65 @@ function we(e) {
1274
1322
  }
1275
1323
  //#endregion
1276
1324
  //#region ../host-kit/dist/intent/intent-catalog.js
1277
- function Te(e) {
1325
+ function De(e) {
1278
1326
  return e.materials.find((e) => e.data === "scalar" && typeof e.defaults.style.fontSize == "number");
1279
1327
  }
1280
- var Ee = /(?:^|[-.])(?:ellipse|oval|circle|triangle|polygon|star|arrow|line|rule|connector|divider)(?:$|[-.])/i, De = /(?:^|[-.])(?:rectangle|rect|card|panel|surface|box|frame|tile)(?:$|[-.])/i, Oe = /(椭圆|圆形|圆|三角|多边形|星形|箭头|线条|连线|分隔线)/, ke = /(矩形|方形|底板|卡片|面板|背景|容器|框架|色块)/;
1281
- function Ae(e) {
1328
+ var Oe = /(?:^|[-.])(?:ellipse|oval|circle|triangle|polygon|star|arrow|line|rule|connector|divider)(?:$|[-.])/i, ke = /(?:^|[-.])(?:rectangle|rect|card|panel|surface|box|frame|tile)(?:$|[-.])/i, Ae = /(椭圆|圆形|圆|三角|多边形|星形|箭头|线条|连线|分隔线)/, je = /(矩形|方形|底板|卡片|面板|背景|容器|框架|色块)/;
1329
+ function Me(e) {
1282
1330
  let t, n = -1;
1283
1331
  for (let r of e.materials) {
1284
- if (r.data !== "none" || r.children === !0 || typeof r.defaults.style.fill != "string" || Ee.test(r.type) || Oe.test(r.name)) continue;
1332
+ if (r.data !== "none" || r.children === !0 || typeof r.defaults.style.fill != "string" || Oe.test(r.type) || Ae.test(r.name)) continue;
1285
1333
  let e = 0;
1286
- /(?:^|[-.])rect(?:angle)?(?:$|[-.])/i.test(r.type) && (e += 4), De.test(r.type) && (e += 2), r.name.includes("矩形") && (e += 3), ke.test(r.name) && (e += 1), "borderRadius" in r.defaults.style && (e += 1), e > n && (t = r, n = e);
1334
+ /(?:^|[-.])rect(?:angle)?(?:$|[-.])/i.test(r.type) && (e += 4), ke.test(r.type) && (e += 2), r.name.includes("矩形") && (e += 3), je.test(r.name) && (e += 1), "borderRadius" in r.defaults.style && (e += 1), e > n && (t = r, n = e);
1287
1335
  }
1288
1336
  return t;
1289
1337
  }
1290
- function je(e) {
1338
+ function Ne(e) {
1291
1339
  return e.materials.find((e) => e.children === !0 && e.data === "none");
1292
1340
  }
1293
1341
  //#endregion
1294
1342
  //#region ../host-kit/dist/intent/intent-format.js
1295
- var Me = "—", Ne = /^(?:[万亿千]|[KMBk](?![a-z]))/;
1296
- function I(...e) {
1343
+ var Pe = "—", Fe = /^(?:[万亿千]|[KMBk](?![a-z]))/;
1344
+ function Ie(...e) {
1297
1345
  return /[⺀-鿿豈-﫿＀-￯]/.test(e.join("")) ? "zh" : "en";
1298
1346
  }
1299
- function L(e, t = "zh") {
1300
- if (e.value === null) return Me;
1301
- let n = e.unit ?? "", r = Math.abs(e.value), [i, a] = n === "%" || Ne.test(n) ? [e.value, ""] : t === "en" ? r >= 1e9 ? [e.value / 1e9, "B"] : r >= 1e6 ? [e.value / 1e6, "M"] : [e.value, ""] : r >= 1e8 ? [e.value / 1e8, "亿"] : r >= 1e4 ? [e.value / 1e4, "万"] : [e.value, ""], o = e.precision ?? (a === "" ? Number.isInteger(i) ? 0 : Math.min(2, Le(i)) : 1), s = ze(i.toFixed(o));
1347
+ function Le(e, t = "zh") {
1348
+ if (e.value === null) return Pe;
1349
+ let n = e.unit ?? "", r = Math.abs(e.value), [i, a] = n === "%" || Fe.test(n) ? [e.value, ""] : t === "en" ? r >= 1e9 ? [e.value / 1e9, "B"] : r >= 1e6 ? [e.value / 1e6, "M"] : [e.value, ""] : r >= 1e8 ? [e.value / 1e8, "亿"] : r >= 1e4 ? [e.value / 1e4, "万"] : [e.value, ""], o = e.precision ?? (a === "" ? Number.isInteger(i) ? 0 : Math.min(2, Ve(i)) : 1), s = Ue(i.toFixed(o));
1302
1350
  if (n === "%") return `${s}%`;
1303
1351
  if (t === "en") return n === "" ? `${s}${a}` : `${s}${a} ${n}`;
1304
1352
  let c = `${a}${n}`;
1305
1353
  return c === "" ? s : `${s} ${c}`;
1306
1354
  }
1307
- function Pe(e, t = "zh") {
1355
+ function Re(e, t = "zh") {
1308
1356
  let n = e.delta;
1309
1357
  if (n === void 0) return "";
1310
- let r = Fe(n) ? "" : n.value > 0 ? "+" : "-", i = Math.abs(n.value);
1311
- return n.unit === "percent" ? `${r}${Re(i.toFixed(1))}%` : n.unit === "point" ? `${r}${Re(i.toFixed(1))}${t === "en" ? " pp" : " 个百分点"}` : `${r}${L({
1358
+ let r = ze(n) ? "" : n.value > 0 ? "+" : "-", i = Math.abs(n.value);
1359
+ return n.unit === "percent" ? `${r}${He(i.toFixed(1))}%` : n.unit === "point" ? `${r}${He(i.toFixed(1))}${t === "en" ? " pp" : " 个百分点"}` : `${r}${Le({
1312
1360
  value: i,
1313
1361
  ...e.unit === void 0 ? {} : { unit: e.unit }
1314
1362
  }, t)}`;
1315
1363
  }
1316
- function Fe(e) {
1364
+ function ze(e) {
1317
1365
  return e.value === 0 || e.unit !== "absolute" && Number(Math.abs(e.value).toFixed(1)) === 0;
1318
1366
  }
1319
- function Ie(e, t) {
1320
- return e.direction === "neutral" || Fe(e) ? t.muted : e.direction === "up-good" == e.value > 0 ? "theme:success" : "theme:danger";
1367
+ function Be(e, t) {
1368
+ return e.direction === "neutral" || ze(e) ? t.muted : e.direction === "up-good" == e.value > 0 ? "theme:success" : "theme:danger";
1321
1369
  }
1322
- function Le(e) {
1370
+ function Ve(e) {
1323
1371
  let t = String(e), n = t.indexOf(".");
1324
1372
  return n < 0 ? 0 : t.length - n - 1;
1325
1373
  }
1326
- function Re(e) {
1374
+ function He(e) {
1327
1375
  return e.includes(".") ? e.replace(/\.?0+$/, "") : e;
1328
1376
  }
1329
- function ze(e) {
1377
+ function Ue(e) {
1330
1378
  let [t, n] = e.split("."), r = (t ?? "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1331
1379
  return n === void 0 ? r : `${r}.${n}`;
1332
1380
  }
1333
1381
  //#endregion
1334
1382
  //#region ../host-kit/dist/intent/intent-kpi-bind.js
1335
- function Be(e, t, n) {
1383
+ function We(e, t, n) {
1336
1384
  let r = e.bind;
1337
1385
  if (r === void 0) return !1;
1338
1386
  let i = (t, r, i) => (n.sink.warnings.push({
@@ -1356,7 +1404,7 @@ function Be(e, t, n) {
1356
1404
  fontSize: 18,
1357
1405
  color: n.palette.muted
1358
1406
  }), n.push(s, "指标值", t.value, {
1359
- style: Se(s, {
1407
+ style: we(s, {
1360
1408
  fontSize: 42,
1361
1409
  fontWeight: "700",
1362
1410
  color: n.palette.text
@@ -1371,16 +1419,16 @@ function Be(e, t, n) {
1371
1419
  }
1372
1420
  //#endregion
1373
1421
  //#region ../host-kit/dist/intent/intent-layout.js
1374
- var Ve = 1920, He = 1080, Ue = 1026, We = 1.35, Ge = 1792, Ke = 430;
1375
- function qe(e) {
1376
- let t = [], n = 24 * Math.max(0, e.length - 1), r = e.map(Je);
1422
+ var Ge = 1920, Ke = 1080, qe = 1026, Je = 1.35, Ye = 1792, Xe = 430;
1423
+ function Ze(e) {
1424
+ let t = [], n = 24 * Math.max(0, e.length - 1), r = e.map(Qe);
1377
1425
  for (let [e, n] of r.entries()) if (n.kind === "band") {
1378
- let r = $e(n.count);
1426
+ let r = rt(n.count);
1379
1427
  n.count > 0 && r < 240 && t.push({
1380
1428
  regionIndex: e,
1381
1429
  reason: "width",
1382
1430
  requiredPx: 240 * n.count + 24 * (n.count - 1),
1383
- availablePx: Ge
1431
+ availablePx: Ye
1384
1432
  });
1385
1433
  }
1386
1434
  let i = r.reduce((e, t) => e + (t.kind === "band" ? t.height : 0), 0), a = r.flatMap((e, t) => e.kind === "band" ? [] : [{
@@ -1418,48 +1466,48 @@ function qe(e) {
1418
1466
  let l = [], u = 172;
1419
1467
  for (let [e, t] of r.entries()) {
1420
1468
  let n = t.kind === "band" ? t.height : c.get(e) ?? t.minHeight;
1421
- l.push(Ze(t, u, n)), u += n + 24;
1469
+ l.push(tt(t, u, n)), u += n + 24;
1422
1470
  }
1423
1471
  return {
1424
1472
  ok: !0,
1425
1473
  regions: l
1426
1474
  };
1427
1475
  }
1428
- function Je(e) {
1476
+ function Qe(e) {
1429
1477
  if (e.kind === "band") return {
1430
1478
  kind: "band",
1431
1479
  count: e.count,
1432
1480
  height: 148
1433
1481
  };
1434
1482
  if (e.kind === "grid") {
1435
- let t = tt(e.slots.map((e, t) => ({
1483
+ let t = at(e.slots.map((e, t) => ({
1436
1484
  ...e,
1437
1485
  index: t
1438
1486
  })));
1439
1487
  return {
1440
1488
  kind: "grid",
1441
1489
  rows: t,
1442
- weight: t.reduce((e, t) => e + Ye(t), 0),
1443
- minHeight: Xe(t.length)
1490
+ weight: t.reduce((e, t) => e + $e(t), 0),
1491
+ minHeight: et(t.length)
1444
1492
  };
1445
1493
  }
1446
- let t = (e) => e.reduce((e, t) => e + (t.data ? We : 1), 0);
1494
+ let t = (e) => e.reduce((e, t) => e + (t.data ? Je : 1), 0);
1447
1495
  return {
1448
1496
  kind: "split",
1449
1497
  region: e,
1450
1498
  weight: Math.max(t(e.main), t(e.rail)),
1451
- minHeight: Xe(Math.max(e.main.length, e.rail.length))
1499
+ minHeight: et(Math.max(e.main.length, e.rail.length))
1452
1500
  };
1453
1501
  }
1454
- function Ye(e) {
1455
- return e.some((e) => e.data) ? We : 1;
1502
+ function $e(e) {
1503
+ return e.some((e) => e.data) ? Je : 1;
1456
1504
  }
1457
- function Xe(e) {
1505
+ function et(e) {
1458
1506
  return e === 0 ? 0 : 120 * e + 24 * (e - 1);
1459
1507
  }
1460
- function Ze(e, t, n) {
1508
+ function tt(e, t, n) {
1461
1509
  if (e.kind === "band") {
1462
- let r = $e(e.count), i = [];
1510
+ let r = rt(e.count), i = [];
1463
1511
  for (let a = 0; a < e.count; a += 1) i.push({
1464
1512
  x: 64 + a * (r + 24),
1465
1513
  y: t,
@@ -1472,15 +1520,15 @@ function Ze(e, t, n) {
1472
1520
  };
1473
1521
  }
1474
1522
  if (e.kind === "grid") {
1475
- let r = rt(e.rows, n - 24 * (e.rows.length - 1)), i = Array(e.rows.reduce((e, t) => e + t.length, 0)), a = t;
1523
+ let r = st(e.rows, n - 24 * (e.rows.length - 1)), i = Array(e.rows.reduce((e, t) => e + t.length, 0)), a = t;
1476
1524
  return e.rows.forEach((e, t) => {
1477
- let n = nt(e), o = r[t] ?? 120, s = 0;
1525
+ let n = ot(e), o = r[t] ?? 120, s = 0;
1478
1526
  e.forEach((e, t) => {
1479
1527
  let r = n[t] ?? 1;
1480
1528
  i[e.index] = {
1481
1529
  x: 64 + s * 454,
1482
1530
  y: a,
1483
- width: Ke * r + 24 * (r - 1),
1531
+ width: Xe * r + 24 * (r - 1),
1484
1532
  height: o
1485
1533
  }, s += r;
1486
1534
  }), a += o + 24;
@@ -1489,18 +1537,18 @@ function Ze(e, t, n) {
1489
1537
  boxes: i
1490
1538
  };
1491
1539
  }
1492
- let { region: r } = e, i = r.ratio === "even" ? 884 : Ke, a = r.ratio === "even" ? i : 1768 - i, o = r.railSide === "left" ? 64 + i + 24 : 64, s = r.railSide === "left" ? 64 : 64 + a + 24;
1540
+ let { region: r } = e, i = r.ratio === "even" ? 884 : Xe, a = r.ratio === "even" ? i : 1768 - i, o = r.railSide === "left" ? 64 + i + 24 : 64, s = r.railSide === "left" ? 64 : 64 + a + 24;
1493
1541
  return {
1494
1542
  kind: "split",
1495
- main: Qe(r.main, o, t, a, n),
1496
- rail: Qe(r.rail, s, t, i, n)
1543
+ main: nt(r.main, o, t, a, n),
1544
+ rail: nt(r.rail, s, t, i, n)
1497
1545
  };
1498
1546
  }
1499
- function Qe(e, t, n, r, i) {
1547
+ function nt(e, t, n, r, i) {
1500
1548
  let a = e.map((e, t) => [{
1501
1549
  data: e.data,
1502
1550
  index: t
1503
- }]), o = rt(a, i - 24 * (a.length - 1)), s = [], c = n;
1551
+ }]), o = st(a, i - 24 * (a.length - 1)), s = [], c = n;
1504
1552
  for (let [e, n] of o.entries()) s[e] = {
1505
1553
  x: t,
1506
1554
  y: c,
@@ -1509,22 +1557,22 @@ function Qe(e, t, n, r, i) {
1509
1557
  }, c += n + 24;
1510
1558
  return s;
1511
1559
  }
1512
- function $e(e) {
1513
- return e <= 0 ? 0 : Math.floor((Ge - 24 * (e - 1)) / e);
1560
+ function rt(e) {
1561
+ return e <= 0 ? 0 : Math.floor((Ye - 24 * (e - 1)) / e);
1514
1562
  }
1515
- function et(e) {
1563
+ function it(e) {
1516
1564
  return Number.isFinite(e) ? Math.min(4, Math.max(1, Math.round(e))) : 1;
1517
1565
  }
1518
- function tt(e) {
1566
+ function at(e) {
1519
1567
  let t = [], n = [], r = 0;
1520
1568
  for (let i of e) {
1521
- let e = et(i.span);
1569
+ let e = it(i.span);
1522
1570
  r + e > 4 && n.length > 0 && (t.push(n), n = [], r = 0), n.push(i), r += e;
1523
1571
  }
1524
1572
  return n.length > 0 && t.push(n), t;
1525
1573
  }
1526
- function nt(e) {
1527
- let t = e.map((e) => et(e.span)), n = 4 - t.reduce((e, t) => e + t, 0);
1574
+ function ot(e) {
1575
+ let t = e.map((e) => it(e.span)), n = 4 - t.reduce((e, t) => e + t, 0);
1528
1576
  if (n <= 0 || t.length === 0) return t;
1529
1577
  let r = t.map((e, t) => ({
1530
1578
  span: e,
@@ -1536,9 +1584,9 @@ function nt(e) {
1536
1584
  }
1537
1585
  return t;
1538
1586
  }
1539
- function rt(e, t) {
1587
+ function st(e, t) {
1540
1588
  if (e.length === 0) return [];
1541
- let n = Math.max(120, Math.min(200, Math.floor(t / e.length))), r = e.map(Ye), i = r.reduce((e, t) => e + t, 0) || 1, a = r.map((e) => Math.max(n, Math.floor(t * e / i))), o = a.reduce((e, t) => e + t, 0) - t;
1589
+ let n = Math.max(120, Math.min(200, Math.floor(t / e.length))), r = e.map($e), i = r.reduce((e, t) => e + t, 0) || 1, a = r.map((e) => Math.max(n, Math.floor(t * e / i))), o = a.reduce((e, t) => e + t, 0) - t;
1542
1590
  for (; o > 0;) {
1543
1591
  let e = 0;
1544
1592
  a.forEach((t, n) => {
@@ -1553,12 +1601,12 @@ function rt(e, t) {
1553
1601
  }
1554
1602
  //#endregion
1555
1603
  //#region ../host-kit/dist/intent/intent-style.js
1556
- var it = [
1604
+ var ct = [
1557
1605
  "deep-tech",
1558
1606
  "light-biz",
1559
1607
  "warm-care",
1560
1608
  "ink-finance"
1561
- ], at = {
1609
+ ], lt = {
1562
1610
  "deep-tech": {
1563
1611
  id: "deep-tech",
1564
1612
  label: "深色科技(深蓝底、冷色强调,适合监控、实时、指挥类)",
@@ -1607,31 +1655,31 @@ var it = [
1607
1655
  footer: "#8f9aab"
1608
1656
  }
1609
1657
  }
1610
- }, ot = "deep-tech";
1611
- function st(e) {
1658
+ }, ut = "deep-tech";
1659
+ function dt(e) {
1612
1660
  if (typeof e == "string") {
1613
- let t = it.find((t) => t === e.trim());
1614
- if (t !== void 0) return at[t];
1661
+ let t = ct.find((t) => t === e.trim());
1662
+ if (t !== void 0) return lt[t];
1615
1663
  }
1616
- return at[ot];
1664
+ return lt[ut];
1617
1665
  }
1618
1666
  //#endregion
1619
1667
  //#region ../host-kit/dist/intent/intent-compile.js
1620
- var ct = 5, lt = 20;
1621
- function ut(e) {
1622
- let { catalog: t, references: n, stream: r } = e, i = r === void 0 ? ee(e.intent, n) : void 0, a = i?.intent ?? e.intent, o = st(a.style).palette, s = I(a.title, a.subtitle), c = {
1668
+ var ft = 5, pt = 20;
1669
+ function mt(e) {
1670
+ let { catalog: t, references: n, stream: r } = e, i = r === void 0 ? M(e.intent, n) : void 0, a = i?.intent ?? e.intent, o = dt(a.style).palette, s = Ie(a.title, a.subtitle), c = {
1623
1671
  diagnostics: [],
1624
1672
  warnings: [...i?.warnings ?? []],
1625
1673
  dataSources: []
1626
- }, l = r === void 0 ? pt(a) : mt(r), u = qe(l.map((e) => e.layout));
1674
+ }, l = r === void 0 ? vt(a) : yt(r), u = Ze(l.map((e) => e.layout));
1627
1675
  if (!u.ok) return {
1628
1676
  ok: !1,
1629
- diagnostics: u.issues.map((e) => gt(e, l))
1677
+ diagnostics: u.issues.map((e) => xt(e, l))
1630
1678
  };
1631
1679
  let d = [], f = {}, p = "", m = "", h = (e, t = e) => {
1632
1680
  p = e, m = t;
1633
- }, g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), v = 0, y = Te(t), b = Ae(t), x = je(t), S = null, C = !1, w = (e, t, n, r = {}) => {
1634
- let i = r.pending === !0, a = wt(p), o = i ? a.pendingOffset : _.get(p) ?? 0;
1681
+ }, g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), v = 0, y = De(t), b = Me(t), x = Ne(t), S = null, C = !1, w = (e, t, n, r = {}) => {
1682
+ let i = r.pending === !0, a = kt(p), o = i ? a.pendingOffset : _.get(p) ?? 0;
1635
1683
  i || _.set(p, o + 1);
1636
1684
  let s = i ? `agent-${a.key}-pending` : `agent-${a.key}-${o}`;
1637
1685
  return f[s] = m, d.push({
@@ -1657,7 +1705,7 @@ function ut(e) {
1657
1705
  ...e.defaults.props,
1658
1706
  ...r.props
1659
1707
  },
1660
- style: xt({
1708
+ style: Et({
1661
1709
  ...e.defaults.style,
1662
1710
  ...r.style
1663
1711
  }),
@@ -1675,7 +1723,7 @@ function ut(e) {
1675
1723
  S = null;
1676
1724
  }, D = (e, t, n, r = {}, i = !1) => {
1677
1725
  y !== void 0 && t !== "" && w(y, e, n, {
1678
- style: Se(y, {
1726
+ style: we(y, {
1679
1727
  color: o.text,
1680
1728
  ...r
1681
1729
  }),
@@ -1714,7 +1762,7 @@ function ut(e) {
1714
1762
  fontSize: 20,
1715
1763
  color: o.muted
1716
1764
  });
1717
- let k = vt(o.card), A = {
1765
+ let k = Ct(o.card), A = {
1718
1766
  catalog: t,
1719
1767
  textMaterial: y,
1720
1768
  push: w,
@@ -1726,7 +1774,7 @@ function ut(e) {
1726
1774
  }, j = {
1727
1775
  sink: c,
1728
1776
  onAsset: () => v += 1
1729
- }, M = (e, t) => {
1777
+ }, N = (e, t) => {
1730
1778
  h(e.path, e.block?.origin ?? e.path), e.block === void 0 ? O("占位", t, k, !0) : ge(e.block, t, A, j);
1731
1779
  };
1732
1780
  for (let [t, r] of l.entries()) {
@@ -1734,8 +1782,8 @@ function ut(e) {
1734
1782
  r.kind === "band" && i.kind === "band" ? r.kpis.forEach((t, r) => {
1735
1783
  let a = i.boxes[r];
1736
1784
  if (h(t.path, t.kpi?.origin ?? t.path), T("指标卡", a), O(x === void 0 ? "指标卡" : "底板", a, k), t.kpi !== void 0) {
1737
- let r = t.kpi, i = a.x + lt, l = a.width - 40;
1738
- r.bind !== void 0 && Be(r, {
1785
+ let r = t.kpi, i = a.x + pt, l = a.width - 40;
1786
+ r.bind !== void 0 && We(r, {
1739
1787
  label: {
1740
1788
  x: i,
1741
1789
  y: a.y + 18,
@@ -1756,19 +1804,19 @@ function ut(e) {
1756
1804
  language: s,
1757
1805
  push: w,
1758
1806
  pushText: D
1759
- }) || _t(r, a, o, e.mode, s, D);
1807
+ }) || St(r, a, o, e.mode, s, D);
1760
1808
  }
1761
1809
  E();
1762
- }) : r.kind === "grid" && i.kind === "grid" ? r.blocks.forEach((e, t) => M(e, i.boxes[t])) : r.kind === "split" && i.kind === "split" && (r.main.forEach((e, t) => M(e, i.main[t])), r.rail.forEach((e, t) => M(e, i.rail[t])));
1810
+ }) : r.kind === "grid" && i.kind === "grid" ? r.blocks.forEach((e, t) => N(e, i.boxes[t])) : r.kind === "split" && i.kind === "split" && (r.main.forEach((e, t) => N(e, i.main[t])), r.rail.forEach((e, t) => N(e, i.rail[t])));
1763
1811
  }
1764
- let N = e.mode === "llm" ? s === "en" ? "model output" : "模型输出" : e.mode === "deterministic" ? s === "en" ? "deterministic fallback · model not called" : "确定性兜底 · 未调用模型" : "";
1765
- if (h(""), D("页脚", s === "en" ? `Generated by the sample agent${N === "" ? "" : ` · ${N}`} · component catalog from the host designer (${t.materials.length} materials)` : `生成自示例智能体${N === "" ? "" : ` · ${N}`} · 组件目录来自宿主设计器(${t.materials.length} 种可用物料)`, {
1812
+ let P = e.mode === "llm" ? s === "en" ? "model output" : "模型输出" : e.mode === "deterministic" ? s === "en" ? "deterministic fallback · model not called" : "确定性兜底 · 未调用模型" : "";
1813
+ if (h(""), D("页脚", s === "en" ? `Generated by the sample agent${P === "" ? "" : ` · ${P}`} · component catalog from the host designer (${t.materials.length} materials)` : `生成自示例智能体${P === "" ? "" : ` · ${P}`} · 组件目录来自宿主设计器(${t.materials.length} 种可用物料)`, {
1766
1814
  x: 64,
1767
- y: Ue,
1815
+ y: qe,
1768
1816
  width: 1600,
1769
1817
  height: 26
1770
1818
  }, {
1771
- fontSize: bt,
1819
+ fontSize: Tt,
1772
1820
  color: o.footer
1773
1821
  }), C && c.warnings.push({
1774
1822
  severity: "warning",
@@ -1779,7 +1827,7 @@ function ut(e) {
1779
1827
  ok: !1,
1780
1828
  diagnostics: c.diagnostics
1781
1829
  };
1782
- let P = r === void 0 ? te({
1830
+ let F = r === void 0 ? ee({
1783
1831
  intent: a,
1784
1832
  catalog: t,
1785
1833
  references: n,
@@ -1805,17 +1853,17 @@ function ut(e) {
1805
1853
  materials: [...g],
1806
1854
  warnings: c.warnings,
1807
1855
  sources: f,
1808
- behaviors: P?.behaviors ?? [],
1856
+ behaviors: F?.behaviors ?? [],
1809
1857
  document: {
1810
1858
  canvas: {
1811
- width: Ve,
1812
- height: He,
1859
+ width: Ge,
1860
+ height: Ke,
1813
1861
  backgroundColor: o.canvas
1814
1862
  },
1815
1863
  components: d,
1816
- variables: P?.variables ?? [],
1864
+ variables: F?.variables ?? [],
1817
1865
  ...c.dataSources.length === 0 ? {} : { dataSources: c.dataSources },
1818
- blueprint: P?.blueprint ?? {
1866
+ blueprint: F?.blueprint ?? {
1819
1867
  nodes: [],
1820
1868
  edges: []
1821
1869
  }
@@ -1823,21 +1871,21 @@ function ut(e) {
1823
1871
  }
1824
1872
  };
1825
1873
  }
1826
- function dt(e, t) {
1874
+ function ht(e, t) {
1827
1875
  return e.origin === "kpis" || e.origin === "blocks" ? e.origin : `regions[${t}]`;
1828
1876
  }
1829
- function R(e, t, n) {
1877
+ function gt(e, t, n) {
1830
1878
  return e === "kpis" || e === "blocks" ? `${e}[${n}]` : `${e}.${t}[${n}]`;
1831
1879
  }
1832
- var ft = (e) => e.bind.kind === "table" || e.bind.kind === "dataset";
1833
- function pt(e) {
1880
+ var _t = (e) => e.bind.kind === "table" || e.bind.kind === "dataset";
1881
+ function vt(e) {
1834
1882
  return e.regions.map((e, t) => {
1835
- let n = dt(e, t), r = (e, t) => e.map((e, r) => ({
1836
- path: e.ident ?? R(n, t, r),
1883
+ let n = ht(e, t), r = (e, t) => e.map((e, r) => ({
1884
+ path: e.ident ?? gt(n, t, r),
1837
1885
  block: e
1838
1886
  }));
1839
1887
  if (e.kind === "band") {
1840
- let t = n === "kpis" ? e.items.slice(0, ct) : e.items;
1888
+ let t = n === "kpis" ? e.items.slice(0, ft) : e.items;
1841
1889
  return {
1842
1890
  kind: "band",
1843
1891
  path: n,
@@ -1847,7 +1895,7 @@ function pt(e) {
1847
1895
  count: t.length
1848
1896
  },
1849
1897
  kpis: t.map((e, t) => ({
1850
- path: e.ident ?? R(n, "items", t),
1898
+ path: e.ident ?? gt(n, "items", t),
1851
1899
  kpi: e
1852
1900
  }))
1853
1901
  };
@@ -1860,7 +1908,7 @@ function pt(e) {
1860
1908
  kind: "grid",
1861
1909
  slots: e.blocks.map((e) => ({
1862
1910
  span: e.span,
1863
- data: ft(e)
1911
+ data: _t(e)
1864
1912
  }))
1865
1913
  },
1866
1914
  blocks: r(e.blocks, "blocks")
@@ -1872,26 +1920,26 @@ function pt(e) {
1872
1920
  kind: "split",
1873
1921
  ratio: e.ratio,
1874
1922
  railSide: e.railSide,
1875
- main: e.main.map((e) => ({ data: ft(e) })),
1876
- rail: e.rail.map((e) => ({ data: ft(e) }))
1923
+ main: e.main.map((e) => ({ data: _t(e) })),
1924
+ rail: e.rail.map((e) => ({ data: _t(e) }))
1877
1925
  },
1878
1926
  main: r(e.main, "main"),
1879
1927
  rail: r(e.rail, "rail")
1880
1928
  };
1881
1929
  });
1882
1930
  }
1883
- function mt(e) {
1931
+ function yt(e) {
1884
1932
  let { skeleton: t } = e;
1885
1933
  return t.regions.map((n, r) => {
1886
- let i = ht(t, n, r), a = (t, n) => Array.from({ length: t }, (t, r) => {
1887
- let a = R(i, n, r);
1934
+ let i = bt(t, n, r), a = (t, n) => Array.from({ length: t }, (t, r) => {
1935
+ let a = gt(i, n, r);
1888
1936
  return {
1889
1937
  path: a,
1890
1938
  block: e.blocks[a]
1891
1939
  };
1892
1940
  });
1893
1941
  if (n.kind === "band") {
1894
- let r = t.flat === !0 ? Math.min(n.count, ct) : n.count;
1942
+ let r = t.flat === !0 ? Math.min(n.count, ft) : n.count;
1895
1943
  return {
1896
1944
  kind: "band",
1897
1945
  path: i,
@@ -1901,7 +1949,7 @@ function mt(e) {
1901
1949
  count: r
1902
1950
  },
1903
1951
  kpis: Array.from({ length: r }, (t, n) => {
1904
- let r = R(i, "items", n);
1952
+ let r = gt(i, "items", n);
1905
1953
  return {
1906
1954
  path: r,
1907
1955
  kpi: e.kpis[r]
@@ -1928,10 +1976,10 @@ function mt(e) {
1928
1976
  };
1929
1977
  });
1930
1978
  }
1931
- function ht(e, t, n) {
1979
+ function bt(e, t, n) {
1932
1980
  return e.flat === !0 ? t.kind === "band" ? "kpis" : "blocks" : `regions[${n}]`;
1933
1981
  }
1934
- function gt(e, t) {
1982
+ function xt(e, t) {
1935
1983
  return {
1936
1984
  severity: "error",
1937
1985
  code: "LAYOUT_CAPACITY_EXCEEDED",
@@ -1939,8 +1987,8 @@ function gt(e, t) {
1939
1987
  message: e.reason === "width" ? `The band needs ${e.requiredPx}px to keep every card at least 240px wide, but only ${e.availablePx}px is available; use fewer cards.` : `The regions need ${e.requiredPx}px of height but only ${e.availablePx}px is available (short by ${e.requiredPx - e.availablePx}px); use fewer blocks.`
1940
1988
  };
1941
1989
  }
1942
- function _t(e, t, n, r, i, a) {
1943
- let o = t.width - 40, s = t.x + lt;
1990
+ function St(e, t, n, r, i, a) {
1991
+ let o = t.width - 40, s = t.x + pt;
1944
1992
  a("指标名", e.label, {
1945
1993
  x: s,
1946
1994
  y: t.y + 18,
@@ -1949,7 +1997,7 @@ function _t(e, t, n, r, i, a) {
1949
1997
  }, {
1950
1998
  fontSize: 18,
1951
1999
  color: n.muted
1952
- }), a("指标值", L(e, i), {
2000
+ }), a("指标值", Le(e, i), {
1953
2001
  x: s,
1954
2002
  y: t.y + 50,
1955
2003
  width: o,
@@ -1958,25 +2006,25 @@ function _t(e, t, n, r, i, a) {
1958
2006
  fontSize: 42,
1959
2007
  fontWeight: "700",
1960
2008
  color: n.text
1961
- }, r === "llm" && e.value !== null), e.delta !== void 0 && a("同比", Pe(e, i), {
2009
+ }, r === "llm" && e.value !== null), e.delta !== void 0 && a("同比", Re(e, i), {
1962
2010
  x: s,
1963
2011
  y: t.y + 108,
1964
2012
  width: o,
1965
2013
  height: 24
1966
2014
  }, {
1967
2015
  fontSize: 16,
1968
- color: Ie(e.delta, n)
2016
+ color: Be(e.delta, n)
1969
2017
  });
1970
2018
  }
1971
- function vt(e) {
1972
- let t = e === void 0 ? null : yt(e);
2019
+ function Ct(e) {
2020
+ let t = e === void 0 ? null : wt(e);
1973
2021
  if (t === null) return {};
1974
2022
  let n = Math.max(...t), r = Math.min(...t);
1975
2023
  if (n === 0) return {};
1976
2024
  let i = (n + r) / 510;
1977
2025
  return (n - r) / (n + r === 0 ? 1 : 255 - Math.abs(n + r - 255)) < .45 || i > .6 ? {} : { opacity: .3 };
1978
2026
  }
1979
- function yt(e) {
2027
+ function wt(e) {
1980
2028
  let t = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
1981
2029
  if (t === null) return null;
1982
2030
  let n = t[1], r = n.length === 3 ? [...n].map((e) => e + e).join("") : n;
@@ -1986,26 +2034,26 @@ function yt(e) {
1986
2034
  Number.parseInt(r.slice(4, 6), 16)
1987
2035
  ];
1988
2036
  }
1989
- var bt = f(Ve);
1990
- function xt(e) {
2037
+ var Tt = p(Ge);
2038
+ function Et(e) {
1991
2039
  let t = e.fontSize;
1992
- return typeof t == "number" && t < bt ? {
2040
+ return typeof t == "number" && t < Tt ? {
1993
2041
  ...e,
1994
- fontSize: bt
2042
+ fontSize: Tt
1995
2043
  } : e;
1996
2044
  }
1997
- var St = {
2045
+ var Dt = {
1998
2046
  items: "k",
1999
2047
  blocks: "b",
2000
2048
  main: "m",
2001
2049
  rail: "s"
2002
- }, Ct = {
2050
+ }, Ot = {
2003
2051
  items: 0,
2004
2052
  blocks: 0,
2005
2053
  main: 0,
2006
2054
  rail: 64
2007
2055
  };
2008
- function wt(e) {
2056
+ function kt(e) {
2009
2057
  if (e === "title") return {
2010
2058
  key: "title",
2011
2059
  layer: 1,
@@ -2038,8 +2086,8 @@ function wt(e) {
2038
2086
  if (n !== null) {
2039
2087
  let e = n[2], t = Number(n[1]), r = Number(n[3]);
2040
2088
  return {
2041
- key: `r${t}-${St[e]}${r}`,
2042
- layer: 100 + t * 140 + Ct[e] + r * 8,
2089
+ key: `r${t}-${Dt[e]}${r}`,
2090
+ layer: 100 + t * 140 + Ot[e] + r * 8,
2043
2091
  pendingOffset: 7
2044
2092
  };
2045
2093
  }
@@ -2051,7 +2099,7 @@ function wt(e) {
2051
2099
  }
2052
2100
  //#endregion
2053
2101
  //#region ../host-kit/dist/intent/intent-compile-types.js
2054
- function Tt(e, t) {
2102
+ function At(e, t) {
2055
2103
  let n = [];
2056
2104
  return e > 0 && n.push({
2057
2105
  kind: "band",
@@ -2066,17 +2114,17 @@ function Tt(e, t) {
2066
2114
  }
2067
2115
  //#endregion
2068
2116
  //#region ../host-kit/dist/intent/intent-data-context.js
2069
- function Et(e, t) {
2117
+ function jt(e, t) {
2070
2118
  let n = Object.keys(t).sort().map((e) => [e, t[e]]);
2071
2119
  return JSON.stringify([e, n]);
2072
2120
  }
2073
- var Dt = 4, Ot = [
2121
+ var Mt = 4, Nt = [
2074
2122
  "string",
2075
2123
  "number",
2076
2124
  "boolean",
2077
2125
  "date"
2078
2126
  ];
2079
- async function kt(e) {
2127
+ async function Pt(e) {
2080
2128
  let t = [], n = [...new Set(e.datasetIds)];
2081
2129
  n.length > 4 && t.push({
2082
2130
  severity: "warning",
@@ -2084,9 +2132,9 @@ async function kt(e) {
2084
2132
  path: "",
2085
2133
  message: "Only the first 4 referenced datasets are profiled."
2086
2134
  });
2087
- let r = n.slice(0, 4).map(() => []), i = await Promise.all(n.slice(0, 4).map((t, n) => At(t, n, e, r[n] ?? [])));
2135
+ let r = n.slice(0, 4).map(() => []), i = await Promise.all(n.slice(0, 4).map((t, n) => Ft(t, n, e, r[n] ?? [])));
2088
2136
  for (let e of r) t.push(...e);
2089
- let a = i.filter((e) => e !== void 0), o = a.map((e) => e.profile), s = l(o, Mt(e.catalog), { maxPerDataset: e.maxCandidatesPerDataset ?? 12 }), c = /* @__PURE__ */ new Map();
2137
+ let a = i.filter((e) => e !== void 0), o = a.map((e) => e.profile), s = l(o, Lt(e.catalog), { maxPerDataset: e.maxCandidatesPerDataset ?? 12 }), c = /* @__PURE__ */ new Map();
2090
2138
  for (let e of a) e.sample !== void 0 && c.set(e.sample.key, e.sample.value);
2091
2139
  return {
2092
2140
  profiles: o,
@@ -2098,11 +2146,11 @@ async function kt(e) {
2098
2146
  type: e.type,
2099
2147
  fields: e.fields
2100
2148
  })),
2101
- references: a.map((e) => Ft(e.definition, e.profile, e.sample?.value)),
2149
+ references: a.map((e) => Bt(e.definition, e.profile, e.sample?.value)),
2102
2150
  warnings: t
2103
2151
  };
2104
2152
  }
2105
- async function At(e, t, n, r) {
2153
+ async function Ft(e, t, n, r) {
2106
2154
  let i = new AbortController(), a = () => i.abort();
2107
2155
  n.signal.aborted ? a() : n.signal.addEventListener("abort", a, { once: !0 });
2108
2156
  let o = setTimeout(a, n.timeoutMs ?? 3e3);
@@ -2112,7 +2160,7 @@ async function At(e, t, n, r) {
2112
2160
  signal: i.signal
2113
2161
  });
2114
2162
  if (!a.ok) {
2115
- r.push(jt("AGENT_DATASET_UNKNOWN", e, "describe failed"));
2163
+ r.push(It("AGENT_DATASET_UNKNOWN", e, "describe failed"));
2116
2164
  return;
2117
2165
  }
2118
2166
  let o = a.value, s = {}, c = !1;
@@ -2136,22 +2184,22 @@ async function At(e, t, n, r) {
2136
2184
  } catch {
2137
2185
  l = void 0;
2138
2186
  }
2139
- return l === void 0 && r.push(jt("AGENT_DATASET_SAMPLE_UNAVAILABLE", e, "sample query failed")), {
2187
+ return l === void 0 && r.push(It("AGENT_DATASET_SAMPLE_UNAVAILABLE", e, "sample query failed")), {
2140
2188
  definition: o,
2141
2189
  profile: u(o, l),
2142
2190
  ...l === void 0 ? {} : { sample: {
2143
- key: Et(e, s),
2191
+ key: jt(e, s),
2144
2192
  value: l
2145
2193
  } }
2146
2194
  };
2147
2195
  } catch {
2148
- r.push(jt("AGENT_DATASET_UNKNOWN", e, "describe failed"));
2196
+ r.push(It("AGENT_DATASET_UNKNOWN", e, "describe failed"));
2149
2197
  return;
2150
2198
  } finally {
2151
2199
  clearTimeout(o);
2152
2200
  }
2153
2201
  }
2154
- function jt(e, t, n) {
2202
+ function It(e, t, n) {
2155
2203
  return {
2156
2204
  severity: "warning",
2157
2205
  code: e,
@@ -2160,7 +2208,7 @@ function jt(e, t, n) {
2160
2208
  detail: { datasetId: t }
2161
2209
  };
2162
2210
  }
2163
- function Mt(e) {
2211
+ function Lt(e) {
2164
2212
  return e.materials.filter((e) => e.children !== !0 && e.roles.length > 0 && (e.data === "tabular" || e.data === "scalar")).map((e) => ({
2165
2213
  type: e.type,
2166
2214
  name: e.name,
@@ -2168,26 +2216,26 @@ function Mt(e) {
2168
2216
  id: e.id,
2169
2217
  minFields: e.min,
2170
2218
  maxFields: e.max,
2171
- valueTypes: [...e.valueTypes ?? Ot]
2219
+ valueTypes: [...e.valueTypes ?? Nt]
2172
2220
  }))
2173
2221
  }));
2174
2222
  }
2175
- var Nt = 24;
2176
- function Pt(e) {
2223
+ var Rt = 24;
2224
+ function zt(e) {
2177
2225
  if (e === void 0 || e.rows.length === 0) return;
2178
2226
  let t = {};
2179
2227
  for (let n of e.fields) {
2180
2228
  let r = /* @__PURE__ */ new Set();
2181
2229
  for (let t of e.rows) {
2182
2230
  let e = t[n.id];
2183
- if ((typeof e == "string" || typeof e == "number" || typeof e == "boolean") && (r.add(e), r.size >= Nt)) break;
2231
+ if ((typeof e == "string" || typeof e == "number" || typeof e == "boolean") && (r.add(e), r.size >= Rt)) break;
2184
2232
  }
2185
2233
  r.size > 0 && (t[n.id] = [...r]);
2186
2234
  }
2187
2235
  return t;
2188
2236
  }
2189
- function Ft(e, t, n) {
2190
- let r = Pt(n);
2237
+ function Bt(e, t, n) {
2238
+ let r = zt(n);
2191
2239
  return {
2192
2240
  datasetId: e.datasetId,
2193
2241
  name: e.name,
@@ -2211,7 +2259,7 @@ function Ft(e, t, n) {
2211
2259
  } } : {}
2212
2260
  };
2213
2261
  }
2214
- function It(e) {
2262
+ function Vt(e) {
2215
2263
  return e.profiles.map((t) => ({
2216
2264
  datasetId: t.datasetId,
2217
2265
  profile: t,
@@ -2220,11 +2268,11 @@ function It(e) {
2220
2268
  }
2221
2269
  //#endregion
2222
2270
  //#region ../host-kit/dist/intent/intent-data-check.js
2223
- var Lt = /^(?:kpis\[\d+\]|regions\[\d+\]\.items\[\d+\])$/;
2224
- async function Rt(e) {
2225
- let t = Vt(e.document.dataSources ?? [], Bt(e.document.variables ?? [])), n = /* @__PURE__ */ new Set();
2271
+ var Ht = /^(?:kpis\[\d+\]|regions\[\d+\]\.items\[\d+\])$/;
2272
+ async function Ut(e) {
2273
+ let t = Kt(e.document.dataSources ?? [], Gt(e.document.variables ?? [])), n = /* @__PURE__ */ new Set();
2226
2274
  for (let t of e.document.components) {
2227
- let e = Ht(t.dataValue);
2275
+ let e = qt(t.dataValue);
2228
2276
  e !== void 0 && n.add(e);
2229
2277
  }
2230
2278
  let r = t.filter((e) => n.has(e.id));
@@ -2236,7 +2284,7 @@ async function Rt(e) {
2236
2284
  };
2237
2285
  let i = /* @__PURE__ */ new Map(), a = [], o = [], s = [], c = await Promise.all(r.map(async (t, n) => ({
2238
2286
  instance: t,
2239
- result: await zt(t, n, e)
2287
+ result: await Wt(t, n, e)
2240
2288
  })));
2241
2289
  for (let { instance: e, result: t } of c) t === void 0 ? o.push(e.name) : (i.set(e.id, t), a.push(e.name), t.rows.length === 0 && s.push(e.name));
2242
2290
  let l = [], u = /* @__PURE__ */ new Set(), d = (e, t) => {
@@ -2247,16 +2295,16 @@ async function Rt(e) {
2247
2295
  }));
2248
2296
  };
2249
2297
  for (let t of e.document.components) {
2250
- let n = Ht(t.dataValue), r = n === void 0 ? void 0 : i.get(n);
2298
+ let n = qt(t.dataValue), r = n === void 0 ? void 0 : i.get(n);
2251
2299
  if (r === void 0) continue;
2252
- let a = e.sources[t.id] ?? "", o = Ut(t.dataBinding);
2300
+ let a = e.sources[t.id] ?? "", o = Jt(t.dataBinding);
2253
2301
  if (r.rows.length === 0) continue;
2254
2302
  let s = new Set(r.fields.map((e) => e.id));
2255
2303
  if (o.some((e) => !s.has(e))) {
2256
2304
  d("DATA_FIELD_ABSENT", a);
2257
2305
  continue;
2258
2306
  }
2259
- o.some((e) => r.rows.every((t) => Wt(t[e]))) && d("DATA_FIELD_ALL_NULL", a), Lt.test(a) && r.rows.length > 1 && d("AGENT_KPI_MULTI_ROW", a);
2307
+ o.some((e) => r.rows.every((t) => Yt(t[e]))) && d("DATA_FIELD_ALL_NULL", a), Ht.test(a) && r.rows.length > 1 && d("AGENT_KPI_MULTI_ROW", a);
2260
2308
  }
2261
2309
  return {
2262
2310
  issues: l,
@@ -2265,8 +2313,8 @@ async function Rt(e) {
2265
2313
  empty: s
2266
2314
  };
2267
2315
  }
2268
- async function zt(e, t, n) {
2269
- let r = n.context?.samples.get(Et(e.datasetId, e.params));
2316
+ async function Wt(e, t, n) {
2317
+ let r = n.context?.samples.get(jt(e.datasetId, e.params));
2270
2318
  if (r !== void 0) return r;
2271
2319
  let i = new AbortController(), a = () => i.abort();
2272
2320
  if (n.signal.aborted) return;
@@ -2285,22 +2333,22 @@ async function zt(e, t, n) {
2285
2333
  clearTimeout(o);
2286
2334
  }
2287
2335
  }
2288
- function Bt(e) {
2336
+ function Gt(e) {
2289
2337
  let t = /* @__PURE__ */ new Map();
2290
2338
  for (let n of e) {
2291
- let e = z(n);
2339
+ let e = L(n);
2292
2340
  e !== null && typeof e.id == "string" && e.type === "static" && t.set(e.id, e.initialValue);
2293
2341
  }
2294
2342
  return t;
2295
2343
  }
2296
- function Vt(e, t) {
2344
+ function Kt(e, t) {
2297
2345
  let n = [];
2298
2346
  for (let r of e) {
2299
- let e = z(r), i = z(e?.source);
2347
+ let e = L(r), i = L(e?.source);
2300
2348
  if (e === null || i === null || i.kind !== "dataset" || typeof e.id != "string" || typeof i.datasetId != "string") continue;
2301
2349
  let a = {}, o = !0;
2302
- for (let [n, r] of Object.entries(z(e.params) ?? {})) {
2303
- let e = z(r), i = e?.kind === "inline" ? e.value : e?.kind === "variable" && typeof e.variableId == "string" ? t.get(e.variableId) : void 0;
2350
+ for (let [n, r] of Object.entries(L(e.params) ?? {})) {
2351
+ let e = L(r), i = e?.kind === "inline" ? e.value : e?.kind === "variable" && typeof e.variableId == "string" ? t.get(e.variableId) : void 0;
2304
2352
  typeof i == "string" || typeof i == "number" || typeof i == "boolean" ? a[n] = i : o = !1;
2305
2353
  }
2306
2354
  o && n.push({
@@ -2312,61 +2360,61 @@ function Vt(e, t) {
2312
2360
  }
2313
2361
  return n;
2314
2362
  }
2315
- function Ht(e) {
2316
- let t = z(e);
2363
+ function qt(e) {
2364
+ let t = L(e);
2317
2365
  return t?.kind === "data-source-field" && typeof t.dataSourceId == "string" ? t.dataSourceId : void 0;
2318
2366
  }
2319
- function Ut(e) {
2320
- let t = z(z(e)?.fields);
2367
+ function Jt(e) {
2368
+ let t = L(L(e)?.fields);
2321
2369
  return t === null ? [] : Object.values(t).flatMap((e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : []);
2322
2370
  }
2323
- function Wt(e) {
2371
+ function Yt(e) {
2324
2372
  return e == null || e === "";
2325
2373
  }
2326
- function z(e) {
2374
+ function L(e) {
2327
2375
  return typeof e == "object" && e && !Array.isArray(e) ? e : null;
2328
2376
  }
2329
2377
  //#endregion
2330
2378
  //#region ../host-kit/dist/intent/intent-parse.js
2331
- var Gt = 20, Kt = 40, qt = 12, Jt = 6, Yt = 24, Xt = 32, Zt = 160, Qt = 40, $t = 4, en = 8, tn = 24, nn = 12, rn = 8, an = 80, on = 5, sn = 4, cn = 6, ln = 8, un = /[⺀-鿿豈-﫿＀-￯]/;
2332
- function B(e, t) {
2333
- return e.slice(0, un.test(e) ? t : t * 2);
2379
+ var Xt = 20, Zt = 40, Qt = 12, $t = 6, en = 24, tn = 32, nn = 160, rn = 40, an = 4, on = 8, sn = 24, cn = 12, ln = 8, un = 80, dn = 5, fn = 8, pn = 6, mn = 8, hn = /[⺀-鿿豈-﫿＀-￯]/;
2380
+ function R(e, t) {
2381
+ return e.slice(0, hn.test(e) ? t : t * 2);
2334
2382
  }
2335
- var dn = /* @__PURE__ */ new Set([
2383
+ var gn = /* @__PURE__ */ new Set([
2336
2384
  "percent",
2337
2385
  "point",
2338
2386
  "absolute"
2339
- ]), fn = /* @__PURE__ */ new Set([
2387
+ ]), _n = /* @__PURE__ */ new Set([
2340
2388
  "up-good",
2341
2389
  "down-good",
2342
2390
  "neutral"
2343
- ]), pn = /* @__PURE__ */ new Set(["wide-narrow", "even"]), mn = /* @__PURE__ */ new Set(["left", "right"]), hn = [
2391
+ ]), vn = /* @__PURE__ */ new Set(["wide-narrow", "even"]), yn = /* @__PURE__ */ new Set(["left", "right"]), bn = [
2344
2392
  "pages",
2345
2393
  "facts",
2346
2394
  "variables",
2347
2395
  "states"
2348
2396
  ];
2349
- function gn(e, t) {
2350
- let n = [], r = Yn(e);
2351
- if (r === void 0) return W(n, "AGENT_SPEC_INVALID", "", "Intent output must be a JSON object.");
2352
- if (Object.prototype.hasOwnProperty.call(r, "panels")) return W(n, "AGENT_SPEC_INVALID", "", "The legacy \"panels\" shape is not accepted.");
2353
- let i = Xn(r.title, Gt), a = Xn(r.subtitle, Kt);
2354
- if (i === "" || a === "") return W(n, "AGENT_SPEC_INVALID", "", "Intent needs a non-empty title and subtitle.");
2355
- for (let e of hn) Object.prototype.hasOwnProperty.call(r, e) && n.push({
2397
+ function xn(e, t) {
2398
+ let n = [], r = er(e);
2399
+ if (r === void 0) return nr(n, "AGENT_SPEC_INVALID", "", "Intent output must be a JSON object.");
2400
+ if (Object.prototype.hasOwnProperty.call(r, "panels")) return nr(n, "AGENT_SPEC_INVALID", "", "The legacy \"panels\" shape is not accepted.");
2401
+ let i = tr(r.title, Xt), a = tr(r.subtitle, Zt);
2402
+ if (i === "" || a === "") return nr(n, "AGENT_SPEC_INVALID", "", "Intent needs a non-empty title and subtitle.");
2403
+ for (let e of bn) Object.prototype.hasOwnProperty.call(r, e) && n.push({
2356
2404
  severity: "warning",
2357
2405
  code: "INTENT_PART_NOT_SUPPORTED",
2358
2406
  path: e,
2359
2407
  message: `The "${e}" part is reserved and is not compiled yet; it was ignored.`
2360
2408
  });
2361
2409
  let o = Object.prototype.hasOwnProperty.call(r, "regions"), s = "kpis" in r || "blocks" in r;
2362
- if (o && s) return W(n, "AGENT_SPEC_INVALID", "", "Use either \"regions\" or the flat \"kpis\" + \"blocks\" shape, not both.");
2363
- let c = o ? vn(r.regions, t.catalog, n, t.placeholders === !0) : _n(r, t.catalog, n, t.placeholders === !0);
2410
+ if (o && s) return nr(n, "AGENT_SPEC_INVALID", "", "Use either \"regions\" or the flat \"kpis\" + \"blocks\" shape, not both.");
2411
+ let c = o ? Cn(r.regions, t.catalog, n, t.placeholders === !0) : Sn(r, t.catalog, n, t.placeholders === !0);
2364
2412
  if (c === void 0) return {
2365
2413
  intent: void 0,
2366
2414
  diagnostics: n
2367
2415
  };
2368
- let l = typeof r.style == "string" ? r.style.trim() : void 0, u = Gn(r.interactions, n);
2369
- Kn(r.gaps, n);
2416
+ let l = typeof r.style == "string" ? r.style.trim() : void 0, u = Xn(r.interactions, n);
2417
+ Zn(r.gaps, n);
2370
2418
  let d = {
2371
2419
  title: i,
2372
2420
  subtitle: a,
@@ -2374,7 +2422,7 @@ function gn(e, t) {
2374
2422
  regions: c,
2375
2423
  ...u === void 0 ? {} : { interactions: u }
2376
2424
  };
2377
- return c.some(wn) || n.push({
2425
+ return c.some(kn) || n.push({
2378
2426
  severity: "error",
2379
2427
  code: "AGENT_BLOCKS_ALL_INVALID",
2380
2428
  path: "",
@@ -2384,23 +2432,23 @@ function gn(e, t) {
2384
2432
  diagnostics: n
2385
2433
  };
2386
2434
  }
2387
- function _n(e, t, n, r) {
2435
+ function Sn(e, t, n, r) {
2388
2436
  if (!Array.isArray(e.kpis) || !Array.isArray(e.blocks)) {
2389
- Zn(n, "AGENT_SPEC_INVALID", "Intent needs \"kpis\" and \"blocks\" arrays.");
2437
+ rr(n, "AGENT_SPEC_INVALID", "Intent needs \"kpis\" and \"blocks\" arrays.");
2390
2438
  return;
2391
2439
  }
2392
2440
  let i = [];
2393
- for (let [t, a] of e.kpis.slice(0, on).entries()) {
2394
- let e = V(a, `kpis[${t}]`, { placeholders: r });
2441
+ for (let [t, a] of e.kpis.slice(0, dn).entries()) {
2442
+ let e = z(a, `kpis[${t}]`, { placeholders: r });
2395
2443
  n.push(...e.diagnostics), e.value !== void 0 && i.push(e.value);
2396
2444
  }
2397
2445
  if (i.length < 1) {
2398
- Zn(n, "AGENT_SPEC_INVALID", "Intent needs at least one usable KPI.");
2446
+ rr(n, "AGENT_SPEC_INVALID", "Intent needs at least one usable KPI.");
2399
2447
  return;
2400
2448
  }
2401
2449
  let a = [];
2402
- for (let [r, i] of e.blocks.slice(0, sn).entries()) {
2403
- let e = H(i, t, `blocks[${r}]`, { grid: !0 });
2450
+ for (let [r, i] of e.blocks.slice(0, fn).entries()) {
2451
+ let e = B(i, t, `blocks[${r}]`, { grid: !0 });
2404
2452
  n.push(...e.diagnostics), e.value !== void 0 && a.push(e.value);
2405
2453
  }
2406
2454
  let o = [{
@@ -2414,39 +2462,39 @@ function _n(e, t, n, r) {
2414
2462
  origin: "blocks"
2415
2463
  }), o;
2416
2464
  }
2417
- function vn(e, t, n, r) {
2465
+ function Cn(e, t, n, r) {
2418
2466
  if (!Array.isArray(e) || e.length === 0) {
2419
- Zn(n, "AGENT_SPEC_INVALID", "Intent needs a non-empty \"regions\" array.");
2467
+ rr(n, "AGENT_SPEC_INVALID", "Intent needs a non-empty \"regions\" array.");
2420
2468
  return;
2421
2469
  }
2422
2470
  let i = [];
2423
- for (let [a, o] of e.slice(0, cn).entries()) {
2424
- let e = yn(o, t, `regions[${a}]`, n, r);
2471
+ for (let [a, o] of e.slice(0, pn).entries()) {
2472
+ let e = wn(o, t, `regions[${a}]`, n, r);
2425
2473
  e !== void 0 && i.push(e);
2426
2474
  }
2427
- if (e.length > cn && n.push({
2475
+ if (e.length > pn && n.push({
2428
2476
  severity: "warning",
2429
2477
  code: "INTENT_ITEMS_TRIMMED",
2430
2478
  path: "regions",
2431
- message: `Only the first ${cn} regions are kept.`
2479
+ message: `Only the first ${pn} regions are kept.`
2432
2480
  }), i.length === 0) {
2433
- Zn(n, "AGENT_SPEC_INVALID", "No usable region is left.");
2481
+ rr(n, "AGENT_SPEC_INVALID", "No usable region is left.");
2434
2482
  return;
2435
2483
  }
2436
2484
  return i;
2437
2485
  }
2438
- function yn(e, t, n, r, i) {
2439
- let a = U(e), o = a?.kind;
2486
+ function wn(e, t, n, r, i) {
2487
+ let a = V(e), o = a?.kind;
2440
2488
  if (a === null || o !== "band" && o !== "grid" && o !== "split") {
2441
- r.push(Cn(n, "A region must be an object with kind \"band\", \"grid\" or \"split\"."));
2489
+ r.push(On(n, "A region must be an object with kind \"band\", \"grid\" or \"split\"."));
2442
2490
  return;
2443
2491
  }
2444
2492
  if (o === "band") {
2445
- let e = xn(a.items, n, "items", r);
2493
+ let e = En(a.items, n, "items", r);
2446
2494
  if (e === void 0) return;
2447
2495
  let t = [];
2448
2496
  for (let [a, o] of e.entries()) {
2449
- let e = V(o, `${n}.items[${a}]`, { placeholders: i });
2497
+ let e = z(o, `${n}.items[${a}]`, { placeholders: i });
2450
2498
  r.push(...e.diagnostics), e.value !== void 0 && t.push(e.value);
2451
2499
  }
2452
2500
  return t.length === 0 ? void 0 : {
@@ -2456,14 +2504,14 @@ function yn(e, t, n, r, i) {
2456
2504
  };
2457
2505
  }
2458
2506
  if (o === "grid") {
2459
- let e = bn(a.blocks, t, n, "blocks", !0, r);
2507
+ let e = Tn(a.blocks, t, n, "blocks", !0, r);
2460
2508
  return e === void 0 || e.length === 0 ? void 0 : {
2461
2509
  kind: "grid",
2462
2510
  blocks: e,
2463
2511
  origin: n
2464
2512
  };
2465
2513
  }
2466
- let s = Sn(a.ratio, pn, "wide-narrow", `${n}.ratio`, r), c = Sn(a.railSide, mn, "right", `${n}.railSide`, r), l = bn(a.main, t, n, "main", !1, r), u = bn(a.rail, t, n, "rail", !1, r);
2514
+ let s = Dn(a.ratio, vn, "wide-narrow", `${n}.ratio`, r), c = Dn(a.railSide, yn, "right", `${n}.railSide`, r), l = Tn(a.main, t, n, "main", !1, r), u = Tn(a.rail, t, n, "rail", !1, r);
2467
2515
  if (l !== void 0 && u !== void 0 && l.length !== 0 && u.length !== 0) return {
2468
2516
  kind: "split",
2469
2517
  ratio: s,
@@ -2473,29 +2521,29 @@ function yn(e, t, n, r, i) {
2473
2521
  origin: n
2474
2522
  };
2475
2523
  }
2476
- function bn(e, t, n, r, i, a) {
2477
- let o = xn(e, n, r, a);
2524
+ function Tn(e, t, n, r, i, a) {
2525
+ let o = En(e, n, r, a);
2478
2526
  if (o === void 0) return;
2479
2527
  let s = [];
2480
2528
  for (let [e, c] of o.entries()) {
2481
- let o = H(c, t, `${n}.${r}[${e}]`, { grid: i });
2529
+ let o = B(c, t, `${n}.${r}[${e}]`, { grid: i });
2482
2530
  a.push(...o.diagnostics), o.value !== void 0 && s.push(o.value);
2483
2531
  }
2484
2532
  return s;
2485
2533
  }
2486
- function xn(e, t, n, r) {
2534
+ function En(e, t, n, r) {
2487
2535
  if (!Array.isArray(e) || e.length === 0) {
2488
- r.push(Cn(t, `"${n}" must be a non-empty array.`));
2536
+ r.push(On(t, `"${n}" must be a non-empty array.`));
2489
2537
  return;
2490
2538
  }
2491
- return e.length > ln && r.push({
2539
+ return e.length > mn && r.push({
2492
2540
  severity: "warning",
2493
2541
  code: "INTENT_ITEMS_TRIMMED",
2494
2542
  path: `${t}.${n}`,
2495
- message: `Only the first ${ln} items are kept.`
2496
- }), e.slice(0, ln);
2543
+ message: `Only the first ${mn} items are kept.`
2544
+ }), e.slice(0, mn);
2497
2545
  }
2498
- function Sn(e, t, n, r, i) {
2546
+ function Dn(e, t, n, r, i) {
2499
2547
  return e === void 0 ? n : typeof e == "string" && t.has(e) ? e : (i.push({
2500
2548
  severity: "warning",
2501
2549
  code: "INTENT_REGION_VALUE_DEFAULTED",
@@ -2503,7 +2551,7 @@ function Sn(e, t, n, r, i) {
2503
2551
  message: `Unknown value; "${n}" was used instead.`
2504
2552
  }), n);
2505
2553
  }
2506
- function Cn(e, t) {
2554
+ function On(e, t) {
2507
2555
  return {
2508
2556
  severity: "error",
2509
2557
  code: "INTENT_REGION_INVALID",
@@ -2511,13 +2559,13 @@ function Cn(e, t) {
2511
2559
  message: t
2512
2560
  };
2513
2561
  }
2514
- function wn(e) {
2562
+ function kn(e) {
2515
2563
  return e.kind === "grid" ? e.blocks.length > 0 : e.kind === "split" ? e.main.length > 0 || e.rail.length > 0 : !1;
2516
2564
  }
2517
- function V(e, t, n = {}) {
2518
- let r = Tn(e, t, n);
2565
+ function z(e, t, n = {}) {
2566
+ let r = An(e, t, n);
2519
2567
  if (r.value === void 0) return r;
2520
- let i = U(e) ?? {}, a = [...r.diagnostics], o = Un(i.key, t, a), s = Wn(i.states, t, a);
2568
+ let i = V(e) ?? {}, a = [...r.diagnostics], o = Jn(i.key, t, a), s = Yn(i.states, t, a);
2521
2569
  return {
2522
2570
  value: {
2523
2571
  ...r.value,
@@ -2527,9 +2575,9 @@ function V(e, t, n = {}) {
2527
2575
  diagnostics: a
2528
2576
  };
2529
2577
  }
2530
- function Tn(e, t, n) {
2531
- let r = [], i = U(e), a = typeof i?.label == "string" ? i.label.trim() : "";
2532
- if (i !== null && i.bind !== void 0) return En(i, a, t);
2578
+ function An(e, t, n) {
2579
+ let r = [], i = V(e), a = typeof i?.label == "string" ? i.label.trim() : "";
2580
+ if (i !== null && i.bind !== void 0) return jn(i, a, t);
2533
2581
  let o = i?.value, s = o === null && n.placeholders === !0;
2534
2582
  if (i === null || a === "" || !s && (typeof o != "number" || !Number.isFinite(o))) return r.push({
2535
2583
  severity: "error",
@@ -2540,7 +2588,7 @@ function Tn(e, t, n) {
2540
2588
  value: void 0,
2541
2589
  diagnostics: r
2542
2590
  };
2543
- let c = typeof i.unit == "string" ? i.unit.trim().slice(0, Jt) : "", l = typeof i.precision == "number" && Number.isInteger(i.precision) ? Math.min(3, Math.max(0, i.precision)) : void 0, u = kn(i.delta);
2591
+ let c = typeof i.unit == "string" ? i.unit.trim().slice(0, $t) : "", l = typeof i.precision == "number" && Number.isInteger(i.precision) ? Math.min(3, Math.max(0, i.precision)) : void 0, u = Pn(i.delta);
2544
2592
  return i.delta !== void 0 && u === void 0 && r.push({
2545
2593
  severity: "error",
2546
2594
  code: "AGENT_KPI_DELTA_DROPPED",
@@ -2548,7 +2596,7 @@ function Tn(e, t, n) {
2548
2596
  message: "The delta needs a finite value, a unit and a direction; only the value was kept."
2549
2597
  }), {
2550
2598
  value: {
2551
- label: B(a, qt),
2599
+ label: R(a, Qt),
2552
2600
  value: s ? null : o,
2553
2601
  ...c === "" ? {} : { unit: c },
2554
2602
  ...l === void 0 ? {} : { precision: l },
@@ -2558,7 +2606,7 @@ function Tn(e, t, n) {
2558
2606
  diagnostics: r
2559
2607
  };
2560
2608
  }
2561
- function En(e, t, n) {
2609
+ function jn(e, t, n) {
2562
2610
  let r = [], i = (e, t) => (r.push({
2563
2611
  severity: "error",
2564
2612
  code: e,
@@ -2567,10 +2615,10 @@ function En(e, t, n) {
2567
2615
  }), {
2568
2616
  value: void 0,
2569
2617
  diagnostics: r
2570
- }), a = U(e.bind), o = typeof a?.datasetId == "string" ? a.datasetId.trim() : "", s = typeof a?.field == "string" ? a.field.trim() : "";
2618
+ }), a = V(e.bind), o = typeof a?.datasetId == "string" ? a.datasetId.trim() : "", s = typeof a?.field == "string" ? a.field.trim() : "";
2571
2619
  if (t === "" || a === null || o === "" || s === "") return i("AGENT_KPI_INVALID", "A bound KPI needs a label, bind.datasetId and bind.field.");
2572
2620
  if (e.value !== void 0 && e.value !== null || e.delta !== void 0) return i("AGENT_BIND_CONFLICT", "A KPI bound to a dataset field must not also give a literal value or delta.");
2573
- let c = On(a.params);
2621
+ let c = Nn(a.params);
2574
2622
  if (c === null) return i("AGENT_BIND_INVALID", "bind.params must map parameter names to scalar values.");
2575
2623
  e.precision !== void 0 && r.push({
2576
2624
  severity: "warning",
@@ -2578,10 +2626,10 @@ function En(e, t, n) {
2578
2626
  path: n,
2579
2627
  message: "precision has no effect on a KPI bound to a dataset field."
2580
2628
  });
2581
- let l = typeof e.unit == "string" ? e.unit.trim().slice(0, Jt) : "";
2629
+ let l = typeof e.unit == "string" ? e.unit.trim().slice(0, $t) : "";
2582
2630
  return {
2583
2631
  value: {
2584
- label: B(t, qt),
2632
+ label: R(t, Qt),
2585
2633
  value: null,
2586
2634
  ...l === "" ? {} : { unit: l },
2587
2635
  bind: {
@@ -2594,9 +2642,9 @@ function En(e, t, n) {
2594
2642
  diagnostics: r
2595
2643
  };
2596
2644
  }
2597
- function Dn(e) {
2645
+ function Mn(e) {
2598
2646
  if (e === void 0) return;
2599
- let t = U(e);
2647
+ let t = V(e);
2600
2648
  if (t === null) return null;
2601
2649
  let n = {};
2602
2650
  for (let [e, r] of Object.entries(t)) {
@@ -2608,24 +2656,24 @@ function Dn(e) {
2608
2656
  }
2609
2657
  return Object.keys(n).length === 0 ? void 0 : n;
2610
2658
  }
2611
- function On(e) {
2659
+ function Nn(e) {
2612
2660
  if (e === void 0) return;
2613
- let t = U(e);
2661
+ let t = V(e);
2614
2662
  if (t === null) return null;
2615
2663
  let n = {};
2616
2664
  for (let [e, r] of Object.entries(t)) if (typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) n[e] = r;
2617
2665
  else return null;
2618
2666
  return Object.keys(n).length === 0 ? void 0 : n;
2619
2667
  }
2620
- function kn(e) {
2621
- let t = U(e);
2622
- if (!(t === null || typeof t.value != "number" || !Number.isFinite(t.value) || typeof t.unit != "string" || !dn.has(t.unit) || typeof t.direction != "string" || !fn.has(t.direction))) return {
2668
+ function Pn(e) {
2669
+ let t = V(e);
2670
+ if (!(t === null || typeof t.value != "number" || !Number.isFinite(t.value) || typeof t.unit != "string" || !gn.has(t.unit) || typeof t.direction != "string" || !_n.has(t.direction))) return {
2623
2671
  value: t.value,
2624
2672
  unit: t.unit,
2625
2673
  direction: t.direction
2626
2674
  };
2627
2675
  }
2628
- function H(e, t, n, r) {
2676
+ function B(e, t, n, r) {
2629
2677
  let i = [], a = (e, t) => (i.push({
2630
2678
  severity: "error",
2631
2679
  code: e,
@@ -2641,7 +2689,7 @@ function H(e, t, n, r) {
2641
2689
  path: r,
2642
2690
  message: t
2643
2691
  });
2644
- }, s = U(e);
2692
+ }, s = V(e);
2645
2693
  if (s === null) return a("AGENT_BLOCK_INVALID", "A block must be an object.");
2646
2694
  let c = typeof s.candidate == "string" ? s.candidate.trim() : "", l = c === "" ? void 0 : t.candidates?.find((e) => e.id === c);
2647
2695
  if (c !== "" && l === void 0) return a("AGENT_CANDIDATE_UNKNOWN", `Candidate ${c} is not in this round's list.`);
@@ -2649,17 +2697,17 @@ function H(e, t, n, r) {
2649
2697
  let u = l === void 0 ? typeof s.type == "string" ? s.type.trim() : "" : l.type, d = t.materials.find((e) => e.type === u);
2650
2698
  if (u === "" || d === void 0 || d.children === !0) return a("AGENT_BLOCK_TYPE_UNKNOWN", "The block type is not in the catalog.");
2651
2699
  let f = typeof s.title == "string" ? s.title.trim() : "";
2652
- B(f, Yt).length < f.length && (f = B(f, Yt), o("AGENT_BLOCK_TEXT_TRIMMED", "The block title was trimmed."));
2700
+ R(f, en).length < f.length && (f = R(f, en), o("AGENT_BLOCK_TEXT_TRIMMED", "The block title was trimmed."));
2653
2701
  let p = typeof s.note == "string" ? s.note.trim() : "";
2654
- B(p, Xt).length < p.length && (p = B(p, Xt), o("AGENT_BLOCK_TEXT_TRIMMED", "The block note was trimmed."));
2702
+ R(p, tn).length < p.length && (p = R(p, tn), o("AGENT_BLOCK_TEXT_TRIMMED", "The block note was trimmed."));
2655
2703
  let m = 1;
2656
2704
  if (r.grid) {
2657
2705
  let e = typeof s.span == "number" ? Math.round(s.span) : 1;
2658
2706
  m = Math.min(4, Math.max(1, Number.isFinite(e) ? e : 1)), m !== e && o("AGENT_BLOCK_SPAN_CLAMPED", "The block span was clamped to 1–4.");
2659
2707
  }
2660
- let h = l === void 0 ? void 0 : On(s.params);
2708
+ let h = l === void 0 ? void 0 : Nn(s.params);
2661
2709
  if (h === null) return a("AGENT_BIND_INVALID", "params must map parameter names to scalar values.");
2662
- let g = l === void 0 ? An(s, d, t, n, i) : {
2710
+ let g = l === void 0 ? Fn(s, d, t, n, i) : {
2663
2711
  kind: "dataset",
2664
2712
  datasetId: l.datasetId,
2665
2713
  fields: l.fields,
@@ -2669,7 +2717,7 @@ function H(e, t, n, r) {
2669
2717
  value: void 0,
2670
2718
  diagnostics: i
2671
2719
  };
2672
- let _ = jn(s.props, d, n, i), v = Un(s.key, n, i), y = typeof s.substituteFor == "string" ? s.substituteFor.trim().slice(0, Qt) : "";
2720
+ let _ = In(s.props, d, n, i), v = Jn(s.key, n, i), y = typeof s.substituteFor == "string" ? s.substituteFor.trim().slice(0, rn) : "";
2673
2721
  return {
2674
2722
  value: {
2675
2723
  type: u,
@@ -2686,7 +2734,7 @@ function H(e, t, n, r) {
2686
2734
  diagnostics: i
2687
2735
  };
2688
2736
  }
2689
- function An(e, t, n, r, i) {
2737
+ function Fn(e, t, n, r, i) {
2690
2738
  let a = (e, t) => {
2691
2739
  i.push({
2692
2740
  severity: "error",
@@ -2699,7 +2747,7 @@ function An(e, t, n, r, i) {
2699
2747
  let t = typeof e.datasetId == "string" ? e.datasetId.trim() : "";
2700
2748
  if (t !== "") {
2701
2749
  if (e.table !== void 0) return a("AGENT_BIND_CONFLICT", "A data block must give either datasetId or table, not both.");
2702
- let n = Dn(e.fields), r = On(e.params);
2750
+ let n = Mn(e.fields), r = Nn(e.params);
2703
2751
  return n === null || r === null ? a("AGENT_BIND_INVALID", "fields must map role ids to field ids and params must map names to scalar values.") : {
2704
2752
  kind: "dataset",
2705
2753
  datasetId: t,
@@ -2707,7 +2755,7 @@ function An(e, t, n, r, i) {
2707
2755
  ...r === void 0 ? {} : { params: r }
2708
2756
  };
2709
2757
  }
2710
- let n = Mn(e.table, r, i);
2758
+ let n = Ln(e.table, r, i);
2711
2759
  return n === null ? a("AGENT_BLOCK_DATA_MISSING", "A data block needs a table or a dataset reference.") : {
2712
2760
  kind: "table",
2713
2761
  table: n
@@ -2720,7 +2768,7 @@ function An(e, t, n, r, i) {
2720
2768
  assetId: o
2721
2769
  };
2722
2770
  let s = typeof e.text == "string" ? e.text.trim() : "";
2723
- return s === "" ? a("AGENT_BLOCK_DATA_MISSING", "A text block needs text.") : (B(s, Zt).length < s.length && (s = B(s, Zt), i.push({
2771
+ return s === "" ? a("AGENT_BLOCK_DATA_MISSING", "A text block needs text.") : (R(s, nn).length < s.length && (s = R(s, nn), i.push({
2724
2772
  severity: "warning",
2725
2773
  code: "AGENT_BLOCK_TEXT_TRIMMED",
2726
2774
  path: r,
@@ -2732,7 +2780,7 @@ function An(e, t, n, r, i) {
2732
2780
  }
2733
2781
  return { kind: "none" };
2734
2782
  }
2735
- function jn(e, t, n, r) {
2783
+ function In(e, t, n, r) {
2736
2784
  if (e === void 0) return;
2737
2785
  let i = () => {
2738
2786
  r.push({
@@ -2741,15 +2789,15 @@ function jn(e, t, n, r) {
2741
2789
  path: n,
2742
2790
  message: "A prop that is not declared by the material was ignored."
2743
2791
  });
2744
- }, a = U(e);
2792
+ }, a = V(e);
2745
2793
  if (a === null) {
2746
2794
  i();
2747
2795
  return;
2748
2796
  }
2749
2797
  let o = Object.keys(a);
2750
- o.length > rn && i();
2798
+ o.length > ln && i();
2751
2799
  let s = {};
2752
- for (let e of o.slice(0, rn)) {
2800
+ for (let e of o.slice(0, ln)) {
2753
2801
  let n = t.props[e], r = a[e];
2754
2802
  if (n === void 0) {
2755
2803
  i();
@@ -2771,11 +2819,11 @@ function jn(e, t, n, r) {
2771
2819
  i();
2772
2820
  continue;
2773
2821
  }
2774
- s[e] = r.slice(0, an);
2822
+ s[e] = r.slice(0, un);
2775
2823
  }
2776
2824
  return Object.keys(s).length === 0 ? void 0 : s;
2777
2825
  }
2778
- function Mn(e, t, n) {
2826
+ function Ln(e, t, n) {
2779
2827
  let r = (e, r) => {
2780
2828
  n.push({
2781
2829
  severity: "warning",
@@ -2783,26 +2831,26 @@ function Mn(e, t, n) {
2783
2831
  path: t,
2784
2832
  message: r
2785
2833
  });
2786
- }, i = U(e);
2834
+ }, i = V(e);
2787
2835
  if (i === null || !Array.isArray(i.columns) || !Array.isArray(i.rows) || i.columns.length < 1 || i.rows.length < 1) return null;
2788
- i.columns.length > $t && r("AGENT_BLOCK_COLUMNS_TRIMMED", `A table keeps at most ${$t} columns.`);
2836
+ i.columns.length > an && r("AGENT_BLOCK_COLUMNS_TRIMMED", `A table keeps at most ${an} columns.`);
2789
2837
  let a = [];
2790
- for (let e of i.columns.slice(0, $t)) {
2791
- let t = U(e);
2838
+ for (let e of i.columns.slice(0, an)) {
2839
+ let t = V(e);
2792
2840
  if (t === null) return null;
2793
2841
  let n = typeof t.id == "string" ? t.id.trim() : "", i = typeof t.label == "string" ? t.label.trim() : "", o = t.type;
2794
2842
  if (!/^[a-zA-Z][a-zA-Z0-9_]{0,15}$/.test(n) || i === "" || o !== "string" && o !== "number" && o !== "boolean" || a.some((e) => e.id === n)) return null;
2795
2843
  let s = i;
2796
- s.length > nn && (s = s.slice(0, nn), r("AGENT_BLOCK_TEXT_TRIMMED", "A column label was trimmed.")), a.push({
2844
+ s.length > cn && (s = s.slice(0, cn), r("AGENT_BLOCK_TEXT_TRIMMED", "A column label was trimmed.")), a.push({
2797
2845
  id: n,
2798
2846
  label: s,
2799
2847
  type: o
2800
2848
  });
2801
2849
  }
2802
- i.rows.length > en && r("AGENT_BLOCK_ROWS_TRIMMED", `A table keeps at most ${en} rows.`);
2850
+ i.rows.length > on && r("AGENT_BLOCK_ROWS_TRIMMED", `A table keeps at most ${on} rows.`);
2803
2851
  let o = /* @__PURE__ */ new Set(), s = [];
2804
- for (let e of i.rows.slice(0, en)) {
2805
- let t = U(e);
2852
+ for (let e of i.rows.slice(0, on)) {
2853
+ let t = V(e);
2806
2854
  if (t === null) {
2807
2855
  r("AGENT_BLOCK_INVALID", "A table row was not an object and was skipped.");
2808
2856
  continue;
@@ -2810,7 +2858,7 @@ function Mn(e, t, n) {
2810
2858
  let n = {};
2811
2859
  for (let e of a) {
2812
2860
  let r = t[e.id];
2813
- e.type === "number" && typeof r == "number" && Number.isFinite(r) || e.type === "boolean" && typeof r == "boolean" ? n[e.id] = r : (e.type !== "string" && o.add(e.id), n[e.id] = r == null ? "" : String(r).slice(0, tn));
2861
+ e.type === "number" && typeof r == "number" && Number.isFinite(r) || e.type === "boolean" && typeof r == "boolean" ? n[e.id] = r : (e.type !== "string" && o.add(e.id), n[e.id] = r == null ? "" : String(r).slice(0, sn));
2814
2862
  }
2815
2863
  s.push(n);
2816
2864
  }
@@ -2822,27 +2870,27 @@ function Mn(e, t, n) {
2822
2870
  rows: s
2823
2871
  });
2824
2872
  }
2825
- var Nn = /^[a-z][a-z0-9-]{0,31}$/, Pn = 8, Fn = 4, In = 4, Ln = 8, Rn = /* @__PURE__ */ new Set([
2873
+ var Rn = /^[a-z][a-z0-9-]{0,31}$/, zn = 8, Bn = 4, Vn = 4, Hn = 8, Un = /* @__PURE__ */ new Set([
2826
2874
  "gt",
2827
2875
  "gte",
2828
2876
  "lt",
2829
2877
  "lte",
2830
2878
  "eq",
2831
2879
  "neq"
2832
- ]), zn = /* @__PURE__ */ new Set([
2880
+ ]), Wn = /* @__PURE__ */ new Set([
2833
2881
  "success",
2834
2882
  "warning",
2835
2883
  "danger",
2836
2884
  "info"
2837
- ]), Bn = /* @__PURE__ */ new Set([
2885
+ ]), Gn = /* @__PURE__ */ new Set([
2838
2886
  "show",
2839
2887
  "hide",
2840
2888
  "toggle"
2841
- ]), Vn = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/, Hn = /^[A-Za-z0-9_][A-Za-z0-9_.:-]{0,127}$/;
2842
- function Un(e, t, n) {
2889
+ ]), Kn = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/, qn = /^[A-Za-z0-9_][A-Za-z0-9_.:-]{0,127}$/;
2890
+ function Jn(e, t, n) {
2843
2891
  if (e === void 0) return;
2844
2892
  let r = typeof e == "string" ? e.trim() : "";
2845
- if (Nn.test(r)) return r;
2893
+ if (Rn.test(r)) return r;
2846
2894
  n.push({
2847
2895
  severity: "warning",
2848
2896
  code: "INTENT_KEY_INVALID",
@@ -2850,9 +2898,9 @@ function Un(e, t, n) {
2850
2898
  message: "A key must start with a lowercase letter and use letters, digits or hyphens (≤ 32)."
2851
2899
  });
2852
2900
  }
2853
- function Wn(e, t, n) {
2901
+ function Yn(e, t, n) {
2854
2902
  if (e === void 0) return;
2855
- let r = U(e);
2903
+ let r = V(e);
2856
2904
  if (r?.source === "level-scale") return {
2857
2905
  rules: [],
2858
2906
  source: "level-scale"
@@ -2867,13 +2915,13 @@ function Wn(e, t, n) {
2867
2915
  };
2868
2916
  if (i === void 0) return a("states must be a list of { op, value, tone } rules.");
2869
2917
  let o = [];
2870
- for (let e of i.slice(0, In)) {
2871
- let t = U(e), n = typeof t?.op == "string" ? t.op : "", r = typeof t?.tone == "string" ? t.tone : "", i = t?.value;
2872
- if (!(Rn.has(n) && zn.has(r) && (typeof i == "number" && Number.isFinite(i) || typeof i == "string" && i.trim() !== "" && (n === "eq" || n === "neq")))) {
2918
+ for (let e of i.slice(0, Vn)) {
2919
+ let t = V(e), n = typeof t?.op == "string" ? t.op : "", r = typeof t?.tone == "string" ? t.tone : "", i = t?.value;
2920
+ if (!(Un.has(n) && Wn.has(r) && (typeof i == "number" && Number.isFinite(i) || typeof i == "string" && i.trim() !== "" && (n === "eq" || n === "neq")))) {
2873
2921
  a("Each state rule needs op (gt/gte/lt/lte/eq/neq), a value and a tone.");
2874
2922
  continue;
2875
2923
  }
2876
- let s = typeof t?.label == "string" ? B(t.label.trim(), Ln) : "";
2924
+ let s = typeof t?.label == "string" ? R(t.label.trim(), Hn) : "";
2877
2925
  o.push({
2878
2926
  op: n,
2879
2927
  value: typeof i == "string" ? i.trim() : i,
@@ -2881,17 +2929,17 @@ function Wn(e, t, n) {
2881
2929
  ...s === "" ? {} : { label: s }
2882
2930
  });
2883
2931
  }
2884
- if (i.length > In && n.push({
2932
+ if (i.length > Vn && n.push({
2885
2933
  severity: "warning",
2886
2934
  code: "INTENT_ITEMS_TRIMMED",
2887
2935
  path: t,
2888
- message: `Only the first ${In} state rules are kept.`
2936
+ message: `Only the first ${Vn} state rules are kept.`
2889
2937
  }), o.length !== 0) return {
2890
2938
  rules: o,
2891
2939
  ...r?.suggested === !0 ? { suggested: !0 } : {}
2892
2940
  };
2893
2941
  }
2894
- function Gn(e, t) {
2942
+ function Xn(e, t) {
2895
2943
  if (e === void 0) return;
2896
2944
  if (!Array.isArray(e)) {
2897
2945
  t.push({
@@ -2903,8 +2951,8 @@ function Gn(e, t) {
2903
2951
  return;
2904
2952
  }
2905
2953
  let n = [];
2906
- for (let [r, i] of e.slice(0, Pn).entries()) {
2907
- let e = `interactions[${r}]`, a = Jn(i, e);
2954
+ for (let [r, i] of e.slice(0, zn).entries()) {
2955
+ let e = `interactions[${r}]`, a = $n(i, e);
2908
2956
  typeof a == "string" ? t.push({
2909
2957
  severity: "error",
2910
2958
  code: "INTENT_INTERACTION_INVALID",
@@ -2912,16 +2960,16 @@ function Gn(e, t) {
2912
2960
  message: a
2913
2961
  }) : n.push(a);
2914
2962
  }
2915
- return e.length > Pn && t.push({
2963
+ return e.length > zn && t.push({
2916
2964
  severity: "warning",
2917
2965
  code: "INTENT_ITEMS_TRIMMED",
2918
2966
  path: "interactions",
2919
- message: `Only the first ${Pn} interactions are kept.`
2967
+ message: `Only the first ${zn} interactions are kept.`
2920
2968
  }), n.length === 0 ? void 0 : n;
2921
2969
  }
2922
- function Kn(e, t) {
2970
+ function Zn(e, t) {
2923
2971
  if (Array.isArray(e)) for (let [n, r] of e.slice(0, 3).entries()) {
2924
- let e = typeof r == "string" ? B(r.trim(), 40) : "";
2972
+ let e = typeof r == "string" ? R(r.trim(), 40) : "";
2925
2973
  e !== "" && t.push({
2926
2974
  severity: "warning",
2927
2975
  code: "INTENT_BEHAVIOR_GAP",
@@ -2931,26 +2979,26 @@ function Kn(e, t) {
2931
2979
  });
2932
2980
  }
2933
2981
  }
2934
- function qn(e, t = 0) {
2982
+ function Qn(e, t = 0) {
2935
2983
  let n = [];
2936
2984
  for (let [r, i] of e.entries()) {
2937
- let e = Jn(i, `interactions[${t + r}]`);
2985
+ let e = $n(i, `interactions[${t + r}]`);
2938
2986
  typeof e != "string" && n.push(e);
2939
2987
  }
2940
2988
  return n;
2941
2989
  }
2942
- function Jn(e, t) {
2943
- let n = U(e);
2990
+ function $n(e, t) {
2991
+ let n = V(e);
2944
2992
  if (n === null) return "An interaction must be an object.";
2945
2993
  let r = typeof n.from == "string" ? n.from.trim() : "", i = typeof n.event == "string" ? n.event.trim() : "", a = (Array.isArray(n.to) ? n.to : [n.to]).filter((e) => typeof e == "string").map((e) => e.trim()).filter((e) => e !== "");
2946
2994
  if (r === "" || a.length === 0) return "An interaction needs \"from\" and \"to\" (block keys or titles).";
2947
- if (!Vn.test(i)) return "An interaction needs the event name of the source block.";
2948
- let o = [...new Set(a)].slice(0, Fn);
2995
+ if (!Kn.test(i)) return "An interaction needs the event name of the source block.";
2996
+ let o = [...new Set(a)].slice(0, Bn);
2949
2997
  if (n.kind === "filter") {
2950
2998
  let e = typeof n.param == "string" ? n.param.trim() : "";
2951
- if (!Hn.test(e)) return "A filter needs the target query parameter \"param\".";
2999
+ if (!qn.test(e)) return "A filter needs the target query parameter \"param\".";
2952
3000
  let a = typeof n.field == "string" ? n.field.trim() : "";
2953
- return a !== "" && !Hn.test(a) ? "The filter field is not a field id." : {
3001
+ return a !== "" && !qn.test(a) ? "The filter field is not a field id." : {
2954
3002
  kind: "filter",
2955
3003
  from: r,
2956
3004
  event: i,
@@ -2966,11 +3014,11 @@ function Jn(e, t) {
2966
3014
  from: r,
2967
3015
  event: i,
2968
3016
  to: o,
2969
- mode: typeof n.mode == "string" && Bn.has(n.mode) ? n.mode : "toggle",
3017
+ mode: typeof n.mode == "string" && Gn.has(n.mode) ? n.mode : "toggle",
2970
3018
  origin: t
2971
3019
  };
2972
3020
  if (n.kind === "state") {
2973
- let e = typeof n.state == "string" ? B(n.state.trim(), 16) : "";
3021
+ let e = typeof n.state == "string" ? R(n.state.trim(), 16) : "";
2974
3022
  return e === "" ? "A state interaction needs \"state\": a state name or tone of the target, or \"reset\"." : {
2975
3023
  kind: "state",
2976
3024
  from: r,
@@ -2982,7 +3030,7 @@ function Jn(e, t) {
2982
3030
  }
2983
3031
  return "Interaction kind must be \"filter\", \"show\" or \"state\".";
2984
3032
  }
2985
- function Yn(e) {
3033
+ function er(e) {
2986
3034
  let t = e;
2987
3035
  if (typeof e == "string") {
2988
3036
  let n = e.trim().replace(/^```(?:json)?/i, "").replace(/```$/, "").trim();
@@ -2992,15 +3040,15 @@ function Yn(e) {
2992
3040
  return;
2993
3041
  }
2994
3042
  }
2995
- return U(t) ?? void 0;
3043
+ return V(t) ?? void 0;
2996
3044
  }
2997
- function Xn(e, t) {
2998
- return typeof e == "string" ? B(e.trim(), t) : "";
3045
+ function tr(e, t) {
3046
+ return typeof e == "string" ? R(e.trim(), t) : "";
2999
3047
  }
3000
- function U(e) {
3048
+ function V(e) {
3001
3049
  return typeof e == "object" && e && !Array.isArray(e) ? e : null;
3002
3050
  }
3003
- function W(e, t, n, r) {
3051
+ function nr(e, t, n, r) {
3004
3052
  return e.push({
3005
3053
  severity: "error",
3006
3054
  code: t,
@@ -3011,7 +3059,7 @@ function W(e, t, n, r) {
3011
3059
  diagnostics: e
3012
3060
  };
3013
3061
  }
3014
- function Zn(e, t, n) {
3062
+ function rr(e, t, n) {
3015
3063
  e.push({
3016
3064
  severity: "error",
3017
3065
  code: t,
@@ -3020,66 +3068,443 @@ function Zn(e, t, n) {
3020
3068
  });
3021
3069
  }
3022
3070
  //#endregion
3071
+ //#region ../host-kit/dist/intent/intent-freeform.js
3072
+ var ir = 1920, ar = 1080, or = 40, sr = 8, cr = 16, lr = p(ir);
3073
+ function ur(e, t) {
3074
+ let n = er(e);
3075
+ if (n === void 0 || !Array.isArray(n.items)) return {
3076
+ matched: !1,
3077
+ intent: void 0,
3078
+ diagnostics: []
3079
+ };
3080
+ let r = [], i = br(yr(n.title), 20) || "参考图大屏", a = br(yr(n.subtitle), 40) || "按参考图还原", o = xr(n.canvas) ? n.canvas : {}, s = typeof o.backgroundColor == "string" ? o.backgroundColor.trim() : void 0, c = n.items;
3081
+ c.length > or && r.push({
3082
+ severity: "warning",
3083
+ code: "INTENT_ITEMS_TRIMMED",
3084
+ path: "items",
3085
+ message: `Only the first ${or} items are kept.`
3086
+ });
3087
+ let l = [];
3088
+ for (let [e, n] of c.slice(0, or).entries()) {
3089
+ let i = `items[${e}]`;
3090
+ if (!xr(n)) {
3091
+ r.push({
3092
+ severity: "error",
3093
+ code: "AGENT_BLOCK_INVALID",
3094
+ path: i,
3095
+ message: "An item must be an object."
3096
+ });
3097
+ continue;
3098
+ }
3099
+ let a = pr(n, i, r);
3100
+ if (a === void 0) continue;
3101
+ let o = B({
3102
+ ...n,
3103
+ span: 1
3104
+ }, t.catalog, i, { grid: !1 });
3105
+ if (r.push(...o.diagnostics), o.value === void 0) continue;
3106
+ let s = mr(n.style);
3107
+ l.push({
3108
+ type: o.value.type,
3109
+ ...a,
3110
+ bind: o.value.bind,
3111
+ ...o.value.props === void 0 ? {} : { props: o.value.props },
3112
+ ...o.value.title === "" ? {} : { title: o.value.title },
3113
+ ...o.value.note === void 0 ? {} : { note: o.value.note },
3114
+ ...o.value.substituteFor === void 0 ? {} : { substituteFor: o.value.substituteFor },
3115
+ ...s === void 0 ? {} : { style: s },
3116
+ origin: i
3117
+ });
3118
+ }
3119
+ return l.length === 0 ? (r.push({
3120
+ severity: "error",
3121
+ code: "AGENT_BLOCKS_ALL_INVALID",
3122
+ path: "",
3123
+ message: "At least one usable item is required."
3124
+ }), {
3125
+ matched: !0,
3126
+ intent: void 0,
3127
+ diagnostics: r
3128
+ }) : {
3129
+ matched: !0,
3130
+ intent: {
3131
+ kind: "freeform",
3132
+ title: i,
3133
+ subtitle: a,
3134
+ canvas: { ...s === void 0 ? {} : { backgroundColor: s } },
3135
+ items: l
3136
+ },
3137
+ diagnostics: r
3138
+ };
3139
+ }
3140
+ function dr(e) {
3141
+ let t, n = /* @__PURE__ */ new Map();
3142
+ return {
3143
+ skeleton(e) {
3144
+ t = e;
3145
+ },
3146
+ item(e, r) {
3147
+ if (t === void 0) return !1;
3148
+ let i = /^items\[(\d+)\]$/.exec(e);
3149
+ return i !== null && (n.set(Number(i[1]), r), !0);
3150
+ },
3151
+ frame() {
3152
+ if (t === void 0 || n.size === 0) return;
3153
+ let r = [...n.entries()].sort(([e], [t]) => e - t).map(([, e]) => e), i = ur({
3154
+ title: t.title,
3155
+ subtitle: t.subtitle,
3156
+ ...t.canvas === void 0 ? {} : { canvas: t.canvas },
3157
+ items: r
3158
+ }, { catalog: e.catalog });
3159
+ if (i.intent === void 0) return;
3160
+ let a = fr({
3161
+ intent: i.intent,
3162
+ catalog: e.catalog,
3163
+ ...e.references === void 0 ? {} : { references: e.references }
3164
+ });
3165
+ return a.ok ? a.value.document : void 0;
3166
+ }
3167
+ };
3168
+ }
3169
+ function fr(e) {
3170
+ let { intent: t, catalog: n, references: r } = e, i = dt(void 0).palette, a = {
3171
+ diagnostics: [],
3172
+ warnings: [],
3173
+ dataSources: []
3174
+ }, o = [], s = {}, c = /* @__PURE__ */ new Set(), l = De(n), u = Me(n), d = Ne(n), p = 0, m = null, h = 0, g = 0, _ = 0, v = (e, n, r, a = {}) => {
3175
+ let d = `agent-free-${h}-${_}`;
3176
+ return _ += 1, s[d] = t.items[h]?.origin ?? "", o.push({
3177
+ id: d,
3178
+ type: e.type,
3179
+ name: n,
3180
+ parentId: a.parentId === void 0 ? m : a.parentId,
3181
+ position: {
3182
+ x: Math.round(r.x),
3183
+ y: Math.round(r.y)
3184
+ },
3185
+ size: {
3186
+ width: Math.max(1, Math.round(r.width)),
3187
+ height: Math.max(1, Math.round(r.height))
3188
+ },
3189
+ rotation: 0,
3190
+ zIndex: g + _,
3191
+ status: {
3192
+ locked: !1,
3193
+ hidden: !1
3194
+ },
3195
+ props: {
3196
+ ...e.defaults.props,
3197
+ ...a.props
3198
+ },
3199
+ style: gr({
3200
+ ...e.defaults.style,
3201
+ ...hr(e, l, u, i, a.style)
3202
+ }),
3203
+ dataSource: null,
3204
+ dataValue: a.dataValue ?? null,
3205
+ ...a.dataBinding === void 0 ? {} : { dataBinding: a.dataBinding }
3206
+ }), c.add(e.type), d;
3207
+ }, y = {
3208
+ catalog: n,
3209
+ textMaterial: l,
3210
+ references: r,
3211
+ palette: i,
3212
+ push: v,
3213
+ pushText: (e, t, n, r = {}) => {
3214
+ l !== void 0 && t !== "" && v(l, e, n, {
3215
+ style: we(l, {
3216
+ color: i.text,
3217
+ ...r
3218
+ }),
3219
+ dataValue: {
3220
+ kind: "inline",
3221
+ value: t
3222
+ }
3223
+ });
3224
+ },
3225
+ beginShell: (e, t) => {
3226
+ d !== void 0 && (m = v(d, e, t, { parentId: null }));
3227
+ },
3228
+ endShell: () => {
3229
+ m = null;
3230
+ }
3231
+ }, b = {
3232
+ sink: a,
3233
+ onAsset: () => p += 1
3234
+ };
3235
+ for (let [e, r] of t.items.entries()) {
3236
+ h = e, g = (r.z ?? e) * 10, _ = 0;
3237
+ let t = n.materials.find((e) => e.type === r.type);
3238
+ if (t !== void 0) {
3239
+ if (r.bind.kind === "text") {
3240
+ v(t, r.title?.trim() || t.name, _r(r), {
3241
+ style: Ce(t, r.style),
3242
+ props: xe(t, r.props),
3243
+ dataValue: {
3244
+ kind: "inline",
3245
+ value: r.bind.text
3246
+ }
3247
+ });
3248
+ continue;
3249
+ }
3250
+ if (r.bind.kind === "none" && t.data === "none") {
3251
+ v(t, r.title?.trim() || t.name, _r(r), {
3252
+ style: Ce(t, r.style),
3253
+ props: xe(t, r.props)
3254
+ });
3255
+ continue;
3256
+ }
3257
+ ge({
3258
+ type: r.type,
3259
+ title: r.title ?? "",
3260
+ span: 1,
3261
+ bind: r.bind,
3262
+ ...r.note === void 0 ? {} : { note: r.note },
3263
+ ...r.props === void 0 ? {} : { props: r.props },
3264
+ ...r.substituteFor === void 0 ? {} : { substituteFor: r.substituteFor },
3265
+ ...r.style === void 0 ? {} : { style: r.style },
3266
+ origin: r.origin
3267
+ }, vr(r), y, b);
3268
+ }
3269
+ }
3270
+ let x = t.canvas.backgroundColor, S = x !== void 0 && f(x) !== void 0 ? x : i.canvas;
3271
+ return x !== void 0 && f(x) === void 0 && a.warnings.push({
3272
+ severity: "warning",
3273
+ code: "INTENT_CANVAS_COLOR_INVALID",
3274
+ path: "canvas.backgroundColor",
3275
+ message: `"${x}" is not a CSS color; the style palette background was used instead.`
3276
+ }), o.length === 0 ? {
3277
+ ok: !1,
3278
+ diagnostics: [{
3279
+ severity: "error",
3280
+ code: "AGENT_CATALOG_UNUSABLE",
3281
+ path: "",
3282
+ message: "No item could be compiled into a component."
3283
+ }]
3284
+ } : {
3285
+ ok: !0,
3286
+ value: {
3287
+ imageCount: p,
3288
+ materials: [...c],
3289
+ warnings: a.warnings,
3290
+ sources: s,
3291
+ behaviors: [],
3292
+ document: {
3293
+ canvas: {
3294
+ width: ir,
3295
+ height: ar,
3296
+ backgroundColor: S
3297
+ },
3298
+ components: o,
3299
+ variables: [],
3300
+ ...a.dataSources.length === 0 ? {} : { dataSources: a.dataSources },
3301
+ blueprint: {
3302
+ nodes: [],
3303
+ edges: []
3304
+ }
3305
+ }
3306
+ }
3307
+ };
3308
+ }
3309
+ function pr(e, t, n) {
3310
+ let r = H(e.x), i = H(e.y), a = H(e.w ?? e.width), o = H(e.h ?? e.height);
3311
+ if (r === void 0 || i === void 0 || a === void 0 || o === void 0) {
3312
+ n.push({
3313
+ severity: "error",
3314
+ code: "AGENT_ITEM_GEOMETRY_INVALID",
3315
+ path: t,
3316
+ message: "An item needs numeric x, y, w and h in pixels."
3317
+ });
3318
+ return;
3319
+ }
3320
+ let s = U(Math.round(r), 0, 1912), c = U(Math.round(i), 0, 1072), l = U(Math.round(a), sr, ir - s), u = U(Math.round(o), sr, ar - c);
3321
+ (s !== Math.round(r) || c !== Math.round(i)) && n.push({
3322
+ severity: "warning",
3323
+ code: "INTENT_ITEM_CLAMPED",
3324
+ path: t,
3325
+ message: "The item position was clamped into the canvas."
3326
+ }), (l !== Math.round(a) || u !== Math.round(o)) && n.push({
3327
+ severity: "warning",
3328
+ code: "INTENT_ITEM_CLAMPED",
3329
+ path: t,
3330
+ message: "The item size was clamped to stay inside the canvas."
3331
+ });
3332
+ let d = H(e.z);
3333
+ return {
3334
+ x: s,
3335
+ y: c,
3336
+ width: l,
3337
+ height: u,
3338
+ ...d === void 0 ? {} : { z: U(Math.round(d), 0, 9999) }
3339
+ };
3340
+ }
3341
+ function mr(e) {
3342
+ let t = xr(e) ? e : void 0;
3343
+ if (t === void 0) return;
3344
+ let n = {}, r = H(t.fontSize);
3345
+ r !== void 0 && (n.fontSize = r), (typeof t.fontWeight == "string" || typeof t.fontWeight == "number") && (n.fontWeight = t.fontWeight);
3346
+ for (let e of [
3347
+ "color",
3348
+ "fill",
3349
+ "backgroundColor",
3350
+ "align",
3351
+ "textAlign"
3352
+ ]) {
3353
+ let r = t[e];
3354
+ typeof r == "string" && r.trim() !== "" && (n[e] = r.trim());
3355
+ }
3356
+ let i = H(t.lineSpacing);
3357
+ return i !== void 0 && (n.lineSpacing = i), Object.keys(n).length === 0 ? void 0 : n;
3358
+ }
3359
+ function hr(e, t, n, r, i) {
3360
+ let a = { ...i };
3361
+ return e.type === t?.type && a.color === void 0 && "color" in e.defaults.style && (a.color = r.text), e.type === n?.type && a.fill === void 0 && "fill" in e.defaults.style && (a.fill = r.card), a;
3362
+ }
3363
+ function gr(e) {
3364
+ let t = e.fontSize;
3365
+ return typeof t == "number" && t < lr ? {
3366
+ ...e,
3367
+ fontSize: lr
3368
+ } : e;
3369
+ }
3370
+ function _r(e) {
3371
+ return {
3372
+ x: e.x,
3373
+ y: e.y,
3374
+ width: e.width,
3375
+ height: e.height
3376
+ };
3377
+ }
3378
+ function vr(e) {
3379
+ let t = Math.max(0, e.x - cr), n = Math.max(0, e.y - cr), r = Math.min(ir, e.x + e.width + cr), i = Math.min(ar, e.y + e.height + cr);
3380
+ return {
3381
+ x: t,
3382
+ y: n,
3383
+ width: Math.max(sr, r - t),
3384
+ height: Math.max(sr, i - n)
3385
+ };
3386
+ }
3387
+ function yr(e) {
3388
+ return typeof e == "string" ? e.trim() : "";
3389
+ }
3390
+ function br(e, t) {
3391
+ return e.slice(0, t);
3392
+ }
3393
+ function H(e) {
3394
+ return typeof e == "number" && Number.isFinite(e) ? e : void 0;
3395
+ }
3396
+ function U(e, t, n) {
3397
+ return Math.min(n, Math.max(t, e));
3398
+ }
3399
+ function xr(e) {
3400
+ return typeof e == "object" && !!e && !Array.isArray(e);
3401
+ }
3402
+ //#endregion
3023
3403
  //#region ../host-kit/dist/intent/intent-prepare.js
3024
- var Qn = /^(?:kpis\[\d+\]|blocks\[\d+\]|interactions\[\d+\]|regions\[\d+\]\.(?:items|blocks|main|rail)\[\d+\])$/, $n = /* @__PURE__ */ new Set([
3404
+ var Sr = /^(?:kpis\[\d+\]|blocks\[\d+\]|items\[\d+\]|interactions\[\d+\]|regions\[\d+\]\.(?:items|blocks|main|rail)\[\d+\])$/, Cr = /* @__PURE__ */ new Set([
3025
3405
  "AGENT_BLOCK_BINDING_UNSATISFIED",
3026
3406
  "AGENT_BINDING_FIELD_UNKNOWN",
3027
3407
  "AGENT_BINDING_TYPE_MISMATCH",
3028
3408
  "AGENT_DATASET_PARAM_INVALID",
3029
3409
  "AGENT_KPI_MULTI_ROW"
3030
3410
  ]);
3031
- function er(e) {
3032
- let t = gn(e.output, {
3411
+ function wr(e) {
3412
+ let t = ur(e.output, { catalog: e.catalog });
3413
+ if (t.matched) return Tr(e, t);
3414
+ let n = xn(e.output, {
3033
3415
  catalog: e.catalog,
3034
3416
  placeholders: e.mode === "deterministic"
3035
- }), n = t.diagnostics.filter((e) => e.severity === "warning"), r = t.diagnostics.filter((e) => e.severity === "error").map((e) => ({
3417
+ }), r = n.diagnostics.filter((e) => e.severity === "warning"), i = n.diagnostics.filter((e) => e.severity === "error").map((e) => ({
3036
3418
  code: e.code,
3037
3419
  path: e.path
3038
3420
  }));
3039
- if (t.intent === void 0) return {
3421
+ if (n.intent === void 0) return {
3040
3422
  intent: void 0,
3041
3423
  compiled: void 0,
3042
- issues: rr(r),
3043
- warnings: n,
3424
+ issues: W(i),
3425
+ warnings: r,
3044
3426
  deliverable: !1
3045
3427
  };
3046
- let i = ut({
3047
- intent: t.intent,
3428
+ let a = mt({
3429
+ intent: n.intent,
3048
3430
  catalog: e.catalog,
3049
3431
  mode: e.mode,
3050
3432
  ...e.references === void 0 ? {} : { references: e.references },
3051
3433
  ...e.capabilities === void 0 ? {} : { capabilities: e.capabilities }
3052
3434
  });
3053
- if (!i.ok) {
3054
- for (let e of i.diagnostics) r.push({
3435
+ if (!a.ok) {
3436
+ for (let e of a.diagnostics) i.push({
3055
3437
  code: e.code,
3056
3438
  path: e.path
3057
3439
  });
3058
3440
  return {
3059
- intent: t.intent,
3441
+ intent: n.intent,
3060
3442
  compiled: void 0,
3061
- issues: rr(r),
3062
- warnings: n,
3443
+ issues: W(i),
3444
+ warnings: r,
3063
3445
  deliverable: !1
3064
3446
  };
3065
3447
  }
3066
- for (let e of i.value.warnings) n.push(e), ($n.has(e.code) || O.has(e.code)) && r.push({
3448
+ for (let e of a.value.warnings) r.push(e), (Cr.has(e.code) || k.has(e.code)) && i.push({
3067
3449
  code: e.code,
3068
3450
  path: e.path
3069
3451
  });
3070
- let a = rr(r);
3452
+ let o = W(i);
3071
3453
  return {
3454
+ intent: n.intent,
3455
+ compiled: a.value,
3456
+ issues: o,
3457
+ warnings: r,
3458
+ deliverable: o.every((e) => Sr.test(e.path))
3459
+ };
3460
+ }
3461
+ function Tr(e, t) {
3462
+ let n = t.diagnostics.filter((e) => e.severity === "warning"), r = t.diagnostics.filter((e) => e.severity === "error").map((e) => ({
3463
+ code: e.code,
3464
+ path: e.path
3465
+ }));
3466
+ if (t.intent === void 0) return {
3467
+ intent: void 0,
3468
+ compiled: void 0,
3469
+ issues: W(r),
3470
+ warnings: n,
3471
+ deliverable: !1
3472
+ };
3473
+ let i = t.intent, a = fr({
3072
3474
  intent: t.intent,
3073
- compiled: i.value,
3074
- issues: a,
3475
+ catalog: e.catalog,
3476
+ ...e.references === void 0 ? {} : { references: e.references },
3477
+ ...e.mode === void 0 ? {} : { mode: e.mode }
3478
+ });
3479
+ if (!a.ok) {
3480
+ for (let e of a.diagnostics) r.push({
3481
+ code: e.code,
3482
+ path: e.path
3483
+ });
3484
+ return {
3485
+ intent: void 0,
3486
+ freeform: i,
3487
+ compiled: void 0,
3488
+ issues: W(r),
3489
+ warnings: n,
3490
+ deliverable: !1
3491
+ };
3492
+ }
3493
+ n.push(...a.value.warnings);
3494
+ let o = W(r);
3495
+ return {
3496
+ intent: void 0,
3497
+ freeform: i,
3498
+ compiled: a.value,
3499
+ issues: o,
3075
3500
  warnings: n,
3076
- deliverable: a.every((e) => Qn.test(e.path))
3501
+ deliverable: o.every((e) => Sr.test(e.path))
3077
3502
  };
3078
3503
  }
3079
- function tr(e) {
3504
+ function Er(e) {
3080
3505
  return e.map((e) => `${e.code}@${e.path}`).sort().join("|");
3081
3506
  }
3082
- function nr(e, t, n) {
3507
+ function Dr(e, t, n) {
3083
3508
  let r = [];
3084
3509
  for (let i of e) {
3085
3510
  if (i.severity !== "error" || i.code.startsWith("CHANGE_")) continue;
@@ -3089,9 +3514,9 @@ function nr(e, t, n) {
3089
3514
  path: o === void 0 ? "" : n[o] ?? ""
3090
3515
  });
3091
3516
  }
3092
- return rr(r);
3517
+ return W(r);
3093
3518
  }
3094
- function rr(e) {
3519
+ function W(e) {
3095
3520
  let t = /* @__PURE__ */ new Set(), n = [];
3096
3521
  for (let r of e) {
3097
3522
  let e = `${r.code}@${r.path}`;
@@ -3101,23 +3526,23 @@ function rr(e) {
3101
3526
  }
3102
3527
  //#endregion
3103
3528
  //#region ../host-kit/dist/intent/intent-session.js
3104
- function ir(e) {
3529
+ function Or(e) {
3105
3530
  return {
3106
- intent: yr(e.intent),
3531
+ intent: Ur(e.intent),
3107
3532
  compiled: e.compiled,
3108
3533
  catalog: e.catalog,
3109
3534
  references: e.references,
3110
3535
  mode: e.mode
3111
3536
  };
3112
3537
  }
3113
- function ar(e, t) {
3538
+ function kr(e, t) {
3114
3539
  let n = e.compiled.document.canvas;
3115
3540
  return n.width === t.canvas.width && n.height === t.canvas.height;
3116
3541
  }
3117
- function or(e, t, n) {
3118
- let r = cr(e.intent, t, e.catalog);
3542
+ function Ar(e, t, n) {
3543
+ let r = Mr(e.intent, t, e.catalog);
3119
3544
  if (!r.ok) return r;
3120
- let i = ut({
3545
+ let i = mt({
3121
3546
  intent: r.intent,
3122
3547
  catalog: e.catalog,
3123
3548
  mode: e.mode,
@@ -3130,27 +3555,27 @@ function or(e, t, n) {
3130
3555
  let a = e.compiled.document, o = i.value.document, s = new Map(n.components.map((e) => [e.id, e])), c = new Map(a.components.map((e) => [e.id, e])), l = new Map(o.components.map((e) => [e.id, e])), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
3131
3556
  for (let [e, t] of c) {
3132
3557
  let n = s.get(e);
3133
- n === void 0 ? d.add(e) : Nr(t, n) || u.add(e);
3558
+ n === void 0 ? d.add(e) : ri(t, n) || u.add(e);
3134
3559
  }
3135
3560
  let f = [...c.keys()].filter((e) => !l.has(e)), p = o.components.filter((e) => !c.has(e.id)), m = o.components.filter((e) => {
3136
3561
  let t = c.get(e.id);
3137
- return t !== void 0 && !Nr(t, e);
3562
+ return t !== void 0 && !ri(t, e);
3138
3563
  }), h = /* @__PURE__ */ new Set(), g = [], _ = f.filter((e) => !d.has(e) && !u.has(e));
3139
3564
  for (let e of f) u.has(e) && h.add(e);
3140
3565
  let v = m.filter((e) => !d.has(e.id) && !u.has(e.id) && c.get(e.id)?.type !== e.type), y = new Set(v.map((e) => e.id)), b = /* @__PURE__ */ new Map(), x = new Map((a.dataSources ?? []).map((e) => [String(e.id), e])), S = new Map((o.dataSources ?? []).map((e) => [String(e.id), e]));
3141
3566
  for (let e of m) {
3142
3567
  let t = X(c.get(e.id)?.dataValue), n = X(e.dataValue), r = X(s.get(e.id)?.dataValue);
3143
- t !== void 0 && n !== void 0 && r !== void 0 && t !== n && (b.has(n) || Lr(x.get(t), S.get(n)) && b.set(n, r));
3568
+ t !== void 0 && n !== void 0 && r !== void 0 && t !== n && (b.has(n) || si(x.get(t), S.get(n)) && b.set(n, r));
3144
3569
  }
3145
3570
  let C = m.filter((e) => {
3146
3571
  if (d.has(e.id) || u.has(e.id) || y.has(e.id)) return !1;
3147
3572
  let t = e.dataValue;
3148
3573
  return typeof t?.dataSourceId == "string" && !b.has(t.dataSourceId) && JSON.stringify(c.get(e.id)?.dataValue ?? null) !== JSON.stringify(t);
3149
- }), w = Ir(o, [
3574
+ }), w = oi(o, [
3150
3575
  ...p,
3151
3576
  ...v,
3152
3577
  ...C
3153
- ], n.dataSources ?? [], b), T = jr(a, o, n, s), E = [], D = [], O = (e) => {
3578
+ ], n.dataSources ?? [], b), T = ti(a, o, n, s), E = [], D = [], O = (e) => {
3154
3579
  for (let t of e) D.push(g.length), g.push(t);
3155
3580
  }, k = (e) => {
3156
3581
  E.push(g.length), g.push(e);
@@ -3167,17 +3592,17 @@ function or(e, t, n) {
3167
3592
  continue;
3168
3593
  }
3169
3594
  if (y.has(e.id)) continue;
3170
- let t = Fr(w.applyPrevious(c.get(e.id)), w.apply(e));
3595
+ let t = ai(w.applyPrevious(c.get(e.id)), w.apply(e));
3171
3596
  Object.keys(t).length !== 0 && k({
3172
3597
  type: "update-components",
3173
3598
  componentIds: [e.id],
3174
3599
  patch: t
3175
3600
  });
3176
3601
  }
3177
- let ee = [..._, ...y];
3178
- ee.length > 0 && k({
3602
+ let j = [..._, ...y];
3603
+ j.length > 0 && k({
3179
3604
  type: "remove-components",
3180
- componentIds: ee
3605
+ componentIds: j
3181
3606
  });
3182
3607
  for (let e of v) k({
3183
3608
  type: "add-component",
@@ -3194,13 +3619,13 @@ function or(e, t, n) {
3194
3619
  })
3195
3620
  });
3196
3621
  O(T.wire);
3197
- let j = I(r.intent.title, r.intent.subtitle), M = sr(e.compiled.behaviors, i.value.behaviors, j), N = E.length > 0 && D.length > 0 ? [{
3198
- label: j === "en" ? "Layout and content" : "版面与内容",
3622
+ let M = Ie(r.intent.title, r.intent.subtitle), N = jr(e.compiled.behaviors, i.value.behaviors, M), P = E.length > 0 && D.length > 0 ? [{
3623
+ label: M === "en" ? "Layout and content" : "版面与内容",
3199
3624
  commandIndexes: E
3200
3625
  }, {
3201
- label: j === "en" ? "Interactions" : "联动",
3626
+ label: M === "en" ? "Interactions" : "联动",
3202
3627
  commandIndexes: D,
3203
- ...M.length === 0 ? {} : { notes: M }
3628
+ ...N.length === 0 ? {} : { notes: N }
3204
3629
  }] : void 0;
3205
3630
  return {
3206
3631
  ok: !0,
@@ -3217,10 +3642,10 @@ function or(e, t, n) {
3217
3642
  removed: _.length
3218
3643
  },
3219
3644
  warnings: i.value.warnings,
3220
- ...N === void 0 ? {} : { groups: N }
3645
+ ...P === void 0 ? {} : { groups: P }
3221
3646
  };
3222
3647
  }
3223
- function sr(e, t, n) {
3648
+ function jr(e, t, n) {
3224
3649
  let r = (e) => n === "en" ? `${e.from}: ${e.detail} ${e.to.join(", ")}` : `点「${e.from}」${e.detail}「${e.to.join("」「")}」`, i = (e) => JSON.stringify([
3225
3650
  e.kind,
3226
3651
  e.from,
@@ -3229,24 +3654,24 @@ function sr(e, t, n) {
3229
3654
  ]), a = (e) => e.filter((e) => e.kind !== "state"), o = new Set(a(e).map(i)), s = new Set(a(t).map(i));
3230
3655
  return [...a(t).filter((e) => !o.has(i(e))).map((e) => `${n === "en" ? "Add" : "新增"}:${r(e)}`), ...a(e).filter((e) => !s.has(i(e))).map((e) => `${n === "en" ? "Remove" : "去掉"}:${r(e)}`)];
3231
3656
  }
3232
- function cr(e, t, n) {
3233
- let r = yr(e);
3657
+ function Mr(e, t, n) {
3658
+ let r = Ur(e);
3234
3659
  for (let [e, i] of t.entries()) {
3235
- let t = `ops[${e}]`, a = Cr(i);
3660
+ let t = `ops[${e}]`, a = qr(i);
3236
3661
  if (a === void 0) return q(t, "INTENT_OP_INVALID", "Unknown or malformed operation.");
3237
- let o = lr(r, a, n, t);
3662
+ let o = Nr(r, a, n, t);
3238
3663
  if (!o.ok) return o;
3239
3664
  r = o.intent;
3240
3665
  }
3241
- return r.regions.some(_r) ? {
3666
+ return r.regions.some(Vr) ? {
3242
3667
  ok: !0,
3243
3668
  intent: r
3244
3669
  } : q("ops", "INTENT_OP_INVALID", "An edit may not leave the screen without any block.");
3245
3670
  }
3246
- function lr(e, t, n, r) {
3247
- if (t.op === "add") return dr(e, t, n, r);
3248
- if (t.op === "link") return wr(e, t, r);
3249
- if (t.op === "unlink") return Tr(e, t, r);
3671
+ function Nr(e, t, n, r) {
3672
+ if (t.op === "add") return Fr(e, t, n, r);
3673
+ if (t.op === "link") return Jr(e, t, r);
3674
+ if (t.op === "unlink") return Yr(e, t, r);
3250
3675
  if (t.target === "title" || t.target === "subtitle") {
3251
3676
  if (t.op !== "change") return q(r, "INTENT_OP_INVALID", "The title and subtitle can only be changed.");
3252
3677
  let n = typeof t.set.text == "string" ? t.set.text.trim() : "";
@@ -3254,17 +3679,17 @@ function lr(e, t, n, r) {
3254
3679
  ok: !0,
3255
3680
  intent: {
3256
3681
  ...e,
3257
- [t.target]: B(n, t.target === "title" ? 20 : 40)
3682
+ [t.target]: R(n, t.target === "title" ? 20 : 40)
3258
3683
  }
3259
3684
  };
3260
3685
  }
3261
- let i = mr(e, t.target);
3686
+ let i = Rr(e, t.target);
3262
3687
  if (i === void 0) return q(r, "INTENT_OP_TARGET_UNKNOWN", `No item is addressed by "${t.target}".`);
3263
3688
  if (t.op === "delete") return {
3264
3689
  ok: !0,
3265
- intent: Er(gr(e, i), i)
3690
+ intent: Xr(Br(e, i), i)
3266
3691
  };
3267
- if (t.op === "rebind") return ur(e, i, t, n, r);
3692
+ if (t.op === "rebind") return Pr(e, i, t, n, r);
3268
3693
  if (t.op === "change") {
3269
3694
  if (i.kpi !== void 0 && (Array.isArray(t.set.rules) || "suggested" in t.set)) {
3270
3695
  let { rules: e, suggested: n, states: r, ...i } = t.set, a = Array.isArray(r) ? { rules: r } : typeof r == "object" && r ? r : Array.isArray(e) ? { rules: e } : void 0;
@@ -3279,43 +3704,43 @@ function lr(e, t, n, r) {
3279
3704
  }
3280
3705
  });
3281
3706
  }
3282
- let e = i.kpi === void 0 ? pr : fr, n = Object.keys(t.set).filter((t) => !e.has(t));
3707
+ let e = i.kpi === void 0 ? Lr : Ir, n = Object.keys(t.set).filter((t) => !e.has(t));
3283
3708
  if (n.length > 0) return q(r, "INTENT_OP_INVALID", `Unknown field(s) ${n.join(", ")}; a ${i.kpi === void 0 ? "block" : "KPI"} change may set ${[...e].join(" / ")}.`);
3284
3709
  }
3285
3710
  if (i.kpi !== void 0) {
3286
3711
  if (t.op !== "change") return q(r, "INTENT_OP_INVALID", "A KPI can only be changed or deleted.");
3287
- let n = V({
3288
- ...xr(i.kpi),
3712
+ let n = z({
3713
+ ...Gr(i.kpi),
3289
3714
  ...t.set
3290
3715
  }, i.kpi.origin, { placeholders: i.kpi.value === null });
3291
3716
  return n.value === void 0 ? q(r, "INTENT_OP_FAILED", "The changed KPI is not usable.") : {
3292
3717
  ok: !0,
3293
- intent: hr(e, i, {
3718
+ intent: zr(e, i, {
3294
3719
  ...n.value,
3295
3720
  ident: i.kpi.ident ?? i.kpi.origin
3296
3721
  })
3297
3722
  };
3298
3723
  }
3299
- let a = i.block, o = H(t.op === "swap" ? {
3300
- ...br(Sr(a)),
3724
+ let a = i.block, o = B(t.op === "swap" ? {
3725
+ ...Wr(Kr(a)),
3301
3726
  type: t.type,
3302
3727
  props: t.props
3303
3728
  } : {
3304
- ...Sr(a),
3729
+ ...Kr(a),
3305
3730
  ...t.set
3306
3731
  }, n, a.origin, { grid: i.grid }), s = o.diagnostics.filter((e) => e.severity === "error");
3307
3732
  return o.value === void 0 || s.length > 0 ? q(r, "INTENT_OP_FAILED", `The edited block is not usable (${s[0]?.code ?? "unknown"}).`) : {
3308
3733
  ok: !0,
3309
- intent: hr(e, i, {
3734
+ intent: zr(e, i, {
3310
3735
  ...o.value,
3311
3736
  span: a.span,
3312
3737
  ident: a.ident ?? a.origin
3313
3738
  })
3314
3739
  };
3315
3740
  }
3316
- function ur(e, t, n, r, i) {
3741
+ function Pr(e, t, n, r, i) {
3317
3742
  if (t.kpi !== void 0) {
3318
- let r = V({
3743
+ let r = z({
3319
3744
  label: t.kpi.label,
3320
3745
  ...t.kpi.unit === void 0 ? {} : { unit: t.kpi.unit },
3321
3746
  ...t.kpi.key === void 0 ? {} : { key: t.kpi.key },
@@ -3324,13 +3749,13 @@ function ur(e, t, n, r, i) {
3324
3749
  }, t.kpi.origin);
3325
3750
  return r.value === void 0 ? q(i, "INTENT_OP_FAILED", "The rebound KPI is not usable.") : {
3326
3751
  ok: !0,
3327
- intent: hr(e, t, {
3752
+ intent: zr(e, t, {
3328
3753
  ...r.value,
3329
3754
  ident: G(t.kpi)
3330
3755
  })
3331
3756
  };
3332
3757
  }
3333
- let a = t.block, { table: o, datasetId: s, fields: c, params: l, text: u, assetId: d, ...f } = Sr(a), p = typeof n.bind.candidate == "string" ? n.bind.candidate : void 0, m = H(p === void 0 ? {
3758
+ let a = t.block, { table: o, datasetId: s, fields: c, params: l, text: u, assetId: d, ...f } = Kr(a), p = typeof n.bind.candidate == "string" ? n.bind.candidate : void 0, m = B(p === void 0 ? {
3334
3759
  ...f,
3335
3760
  ...typeof n.bind.type == "string" ? { type: n.bind.type } : {},
3336
3761
  datasetId: n.bind.datasetId,
@@ -3343,17 +3768,17 @@ function ur(e, t, n, r, i) {
3343
3768
  }, r, a.origin, { grid: t.grid }), h = m.diagnostics.filter((e) => e.severity === "error");
3344
3769
  return m.value === void 0 || h.length > 0 ? q(i, "INTENT_OP_FAILED", `The rebound block is not usable (${h[0]?.code ?? "unknown"}).`) : {
3345
3770
  ok: !0,
3346
- intent: hr(e, t, {
3771
+ intent: zr(e, t, {
3347
3772
  ...m.value,
3348
3773
  span: a.span,
3349
3774
  ident: G(a)
3350
3775
  })
3351
3776
  };
3352
3777
  }
3353
- function dr(e, t, n, r) {
3778
+ function Fr(e, t, n, r) {
3354
3779
  let i = e.regions.findIndex((e) => e.origin === t.region), a = e.regions[i];
3355
3780
  if (a === void 0 || a.kind === "band") return q(r, "INTENT_OP_TARGET_UNKNOWN", `"${t.region}" is not a region that holds blocks.`);
3356
- let o = a.kind === "grid" ? "blocks" : t.part === "rail" ? "rail" : "main", s = vr((a.kind === "grid" ? a.blocks : a[o === "rail" ? "rail" : "main"]).map((e) => e.ident ?? e.origin)), c = `${a.origin === "blocks" ? "blocks" : `${a.origin}.${o}`}[${s}]`, l = H(t.block, n, c, { grid: a.kind === "grid" }), u = l.diagnostics.filter((e) => e.severity === "error");
3781
+ let o = a.kind === "grid" ? "blocks" : t.part === "rail" ? "rail" : "main", s = Hr((a.kind === "grid" ? a.blocks : a[o === "rail" ? "rail" : "main"]).map((e) => e.ident ?? e.origin)), c = `${a.origin === "blocks" ? "blocks" : `${a.origin}.${o}`}[${s}]`, l = B(t.block, n, c, { grid: a.kind === "grid" }), u = l.diagnostics.filter((e) => e.severity === "error");
3357
3782
  if (l.value === void 0 || u.length > 0) return q(r, "INTENT_OP_FAILED", `The new block is not usable (${u[0]?.code ?? "unknown"}).`);
3358
3783
  let d = {
3359
3784
  ...l.value,
@@ -3376,7 +3801,7 @@ function dr(e, t, n, r) {
3376
3801
  }
3377
3802
  };
3378
3803
  }
3379
- var fr = /* @__PURE__ */ new Set([
3804
+ var Ir = /* @__PURE__ */ new Set([
3380
3805
  "label",
3381
3806
  "value",
3382
3807
  "unit",
@@ -3384,7 +3809,7 @@ var fr = /* @__PURE__ */ new Set([
3384
3809
  "delta",
3385
3810
  "states",
3386
3811
  "key"
3387
- ]), pr = /* @__PURE__ */ new Set([
3812
+ ]), Lr = /* @__PURE__ */ new Set([
3388
3813
  "title",
3389
3814
  "note",
3390
3815
  "text",
@@ -3393,7 +3818,7 @@ var fr = /* @__PURE__ */ new Set([
3393
3818
  "substituteFor",
3394
3819
  "key"
3395
3820
  ]), G = (e) => e.ident ?? e.origin;
3396
- function mr(e, t) {
3821
+ function Rr(e, t) {
3397
3822
  for (let [n, r] of e.regions.entries()) {
3398
3823
  if (r.kind === "band") {
3399
3824
  let e = r.items.findIndex((e) => G(e) === t), i = r.items[e];
@@ -3419,7 +3844,7 @@ function mr(e, t) {
3419
3844
  }
3420
3845
  }
3421
3846
  }
3422
- function hr(e, t, n) {
3847
+ function zr(e, t, n) {
3423
3848
  return {
3424
3849
  ...e,
3425
3850
  regions: e.regions.map((e, r) => {
@@ -3441,7 +3866,7 @@ function hr(e, t, n) {
3441
3866
  })
3442
3867
  };
3443
3868
  }
3444
- function gr(e, t) {
3869
+ function Br(e, t) {
3445
3870
  let n = [];
3446
3871
  for (let [r, i] of e.regions.entries()) {
3447
3872
  if (r !== t.regionIndex) {
@@ -3486,10 +3911,10 @@ function gr(e, t) {
3486
3911
  regions: n
3487
3912
  };
3488
3913
  }
3489
- function _r(e) {
3914
+ function Vr(e) {
3490
3915
  return e.kind === "grid" ? e.blocks.length > 0 : e.kind === "split" ? e.main.length > 0 || e.rail.length > 0 : !1;
3491
3916
  }
3492
- function vr(e) {
3917
+ function Hr(e) {
3493
3918
  let t = -1;
3494
3919
  for (let n of e) {
3495
3920
  let e = /\[(\d+)\]$/.exec(n);
@@ -3497,7 +3922,7 @@ function vr(e) {
3497
3922
  }
3498
3923
  return t + 1;
3499
3924
  }
3500
- function yr(e) {
3925
+ function Ur(e) {
3501
3926
  return {
3502
3927
  ...e,
3503
3928
  regions: e.regions.map((e) => {
@@ -3519,11 +3944,11 @@ function yr(e) {
3519
3944
  })
3520
3945
  };
3521
3946
  }
3522
- function br(e) {
3947
+ function Wr(e) {
3523
3948
  let { fields: t, ...n } = e;
3524
3949
  return n;
3525
3950
  }
3526
- function xr(e) {
3951
+ function Gr(e) {
3527
3952
  let t = {
3528
3953
  ...e.key === void 0 ? {} : { key: e.key },
3529
3954
  ...e.states === void 0 ? {} : { states: e.states }
@@ -3542,7 +3967,7 @@ function xr(e) {
3542
3967
  ...t
3543
3968
  };
3544
3969
  }
3545
- function Sr(e) {
3970
+ function Kr(e) {
3546
3971
  return {
3547
3972
  type: e.type,
3548
3973
  title: e.title,
@@ -3561,7 +3986,7 @@ function Sr(e) {
3561
3986
  ...e.bind.kind === "asset" ? { assetId: e.bind.assetId } : {}
3562
3987
  };
3563
3988
  }
3564
- function Cr(e) {
3989
+ function qr(e) {
3565
3990
  if (typeof e != "object" || !e || Array.isArray(e)) return;
3566
3991
  let t = e, n = typeof t.target == "string" ? t.target : void 0;
3567
3992
  switch (t.op) {
@@ -3616,8 +4041,8 @@ function q(e, t, n) {
3616
4041
  }]
3617
4042
  };
3618
4043
  }
3619
- function wr(e, t, n) {
3620
- let r = e.interactions ?? [], i = qn([t.interaction], r.length)[0];
4044
+ function Jr(e, t, n) {
4045
+ let r = e.interactions ?? [], i = Qn([t.interaction], r.length)[0];
3621
4046
  return i === void 0 ? q(n, "INTENT_OP_INVALID", "The interaction is not usable.") : {
3622
4047
  ok: !0,
3623
4048
  intent: {
@@ -3626,14 +4051,14 @@ function wr(e, t, n) {
3626
4051
  }
3627
4052
  };
3628
4053
  }
3629
- function Tr(e, t, n) {
4054
+ function Yr(e, t, n) {
3630
4055
  let r = e.interactions ?? [], i = r.filter((e) => e.origin !== t.target);
3631
4056
  return i.length === r.length ? q(n, "INTENT_OP_TARGET_UNKNOWN", `No interaction is addressed by "${t.target}".`) : {
3632
4057
  ok: !0,
3633
- intent: Dr(e, i)
4058
+ intent: Zr(e, i)
3634
4059
  };
3635
4060
  }
3636
- function Er(e, t) {
4061
+ function Xr(e, t) {
3637
4062
  let n = t.kpi ?? t.block;
3638
4063
  if (e.interactions === void 0 || n === void 0) return e;
3639
4064
  let r = t.kpi === void 0 ? t.block?.title ?? "" : t.kpi.label, i = (e) => e === n.key || r !== "" && e === r, a = [];
@@ -3645,18 +4070,18 @@ function Er(e, t) {
3645
4070
  to: e
3646
4071
  });
3647
4072
  }
3648
- return Dr(e, a);
4073
+ return Zr(e, a);
3649
4074
  }
3650
- function Dr(e, t) {
4075
+ function Zr(e, t) {
3651
4076
  let { interactions: n, ...r } = e;
3652
4077
  return t.length === 0 ? r : {
3653
4078
  ...r,
3654
4079
  interactions: t
3655
4080
  };
3656
4081
  }
3657
- var Or = (e) => typeof e == "string" && e.startsWith("agent:"), kr = (e) => typeof e == "string" && e.startsWith("agent-edge-"), Ar = (e) => typeof e == "string" && e.startsWith("agent-var-"), J = (e) => K(e) && e.kind === "variable" && typeof e.variableId == "string";
3658
- function jr(e, t, n, r) {
3659
- let i = K(n.blueprint) ? n.blueprint : {}, a = (Array.isArray(i.nodes) ? i.nodes : []).filter(K), o = (Array.isArray(i.edges) ? i.edges : []).filter(K), s = (n.variables ?? []).filter(K).filter((e) => Ar(e.id)), c = (e, t) => e.some((e) => e.id === t.id && Y(e) === Y(t)), l = a.filter((e) => Or(e.id)), u = o.filter((e) => kr(e.id)), d = t.blueprint.nodes.filter(K), f = t.blueprint.edges.filter(K), p = l.filter((e) => !c(d, e)).map((e) => String(e.id)), m = new Set(p), h = u.filter((e) => !c(f, e) && !m.has(String(e.from?.node)) && !m.has(String(e.to?.node))).map((e) => String(e.id)), g = u.filter((e) => c(f, e) && !m.has(String(e.from?.node)) && !m.has(String(e.to?.node))), _ = l.filter((e) => !m.has(String(e.id))), v = d.filter((e) => !c(_, e)), y = f.filter((e) => !c(g, e)), b = s.filter((e) => !c(t.variables, e)), x = new Set(b.map((e) => String(e.id))), S = s.filter((e) => !x.has(String(e.id))), C = t.variables.filter((e) => !c(S, e)), w = /* @__PURE__ */ new Map(), T = new Map((t.dataSources ?? []).map((e) => [String(e.id), e]));
4082
+ var Qr = (e) => typeof e == "string" && e.startsWith("agent:"), $r = (e) => typeof e == "string" && e.startsWith("agent-edge-"), ei = (e) => typeof e == "string" && e.startsWith("agent-var-"), J = (e) => K(e) && e.kind === "variable" && typeof e.variableId == "string";
4083
+ function ti(e, t, n, r) {
4084
+ let i = K(n.blueprint) ? n.blueprint : {}, a = (Array.isArray(i.nodes) ? i.nodes : []).filter(K), o = (Array.isArray(i.edges) ? i.edges : []).filter(K), s = (n.variables ?? []).filter(K).filter((e) => ei(e.id)), c = (e, t) => e.some((e) => e.id === t.id && Y(e) === Y(t)), l = a.filter((e) => Qr(e.id)), u = o.filter((e) => $r(e.id)), d = t.blueprint.nodes.filter(K), f = t.blueprint.edges.filter(K), p = l.filter((e) => !c(d, e)).map((e) => String(e.id)), m = new Set(p), h = u.filter((e) => !c(f, e) && !m.has(String(e.from?.node)) && !m.has(String(e.to?.node))).map((e) => String(e.id)), g = u.filter((e) => c(f, e) && !m.has(String(e.from?.node)) && !m.has(String(e.to?.node))), _ = l.filter((e) => !m.has(String(e.id))), v = d.filter((e) => !c(_, e)), y = f.filter((e) => !c(g, e)), b = s.filter((e) => !c(t.variables, e)), x = new Set(b.map((e) => String(e.id))), S = s.filter((e) => !x.has(String(e.id))), C = t.variables.filter((e) => !c(S, e)), w = /* @__PURE__ */ new Map(), T = new Map((t.dataSources ?? []).map((e) => [String(e.id), e]));
3660
4085
  for (let e of t.components) {
3661
4086
  let t = e.dataValue?.dataSourceId, n = r.get(e.id)?.dataValue?.dataSourceId, i = typeof t == "string" ? T.get(t) : void 0;
3662
4087
  if (i === void 0 || typeof n != "string") continue;
@@ -3670,14 +4095,14 @@ function jr(e, t, n, r) {
3670
4095
  for (let e of n.dataSources ?? []) {
3671
4096
  let t = String(e.id), n = K(e.params) ? e.params : {}, r = w.get(t) ?? {}, i = {}, a = {};
3672
4097
  for (let [e, t] of Object.entries(n)) {
3673
- if (!J(t) || !Ar(t.variableId)) continue;
4098
+ if (!J(t) || !ei(t.variableId)) continue;
3674
4099
  let n = r[e];
3675
4100
  J(n) && n.variableId === t.variableId && !x.has(t.variableId) || (i[e] = {
3676
4101
  kind: "inline",
3677
4102
  value: s.find((e) => e.id === t.variableId)?.initialValue ?? null
3678
4103
  }, (J(n) || n !== void 0 && Y(n) !== Y(i[e])) && (a[e] = n));
3679
4104
  }
3680
- for (let [e, t] of Object.entries(r)) !J(t) || !Ar(t.variableId) || a[e] === void 0 && i[e] === void 0 && Y(n[e]) !== Y(t) && (a[e] = t);
4105
+ for (let [e, t] of Object.entries(r)) !J(t) || !ei(t.variableId) || a[e] === void 0 && i[e] === void 0 && Y(n[e]) !== Y(t) && (a[e] = t);
3681
4106
  Object.keys(i).length > 0 && E.push({
3682
4107
  type: "update-data-source-params",
3683
4108
  dataSourceId: t,
@@ -3709,7 +4134,7 @@ function jr(e, t, n, r) {
3709
4134
  }] : []
3710
4135
  };
3711
4136
  }
3712
- var Mr = [
4137
+ var ni = [
3713
4138
  "type",
3714
4139
  "name",
3715
4140
  "parentId",
@@ -3723,22 +4148,22 @@ var Mr = [
3723
4148
  "states",
3724
4149
  "status"
3725
4150
  ];
3726
- function Nr(e, t) {
4151
+ function ri(e, t) {
3727
4152
  let n = e, r = t;
3728
- return Mr.every((e) => Y(n[e]) === Y(r[e]));
4153
+ return ni.every((e) => Y(n[e]) === Y(r[e]));
3729
4154
  }
3730
4155
  function Y(e) {
3731
- return JSON.stringify(Pr(e ?? null));
4156
+ return JSON.stringify(ii(e ?? null));
3732
4157
  }
3733
- function Pr(e) {
3734
- return Array.isArray(e) ? e.map(Pr) : typeof e != "object" || !e ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => [e, Pr(t)]));
4158
+ function ii(e) {
4159
+ return Array.isArray(e) ? e.map(ii) : typeof e != "object" || !e ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => [e, ii(t)]));
3735
4160
  }
3736
- function Fr(e, t) {
4161
+ function ai(e, t) {
3737
4162
  let n = e, r = t, i = {};
3738
- for (let e of Mr) e !== "type" && Y(n[e]) !== Y(r[e]) && (i[e] = r[e]);
4163
+ for (let e of ni) e !== "type" && Y(n[e]) !== Y(r[e]) && (i[e] = r[e]);
3739
4164
  return i;
3740
4165
  }
3741
- function Ir(e, t, n, r = /* @__PURE__ */ new Map()) {
4166
+ function oi(e, t, n, r = /* @__PURE__ */ new Map()) {
3742
4167
  let i = /* @__PURE__ */ new Set();
3743
4168
  for (let e of t) {
3744
4169
  let t = e.dataValue;
@@ -3793,9 +4218,9 @@ function Ir(e, t, n, r = /* @__PURE__ */ new Map()) {
3793
4218
  function X(e) {
3794
4219
  return K(e) && e.kind === "data-source-field" && typeof e.dataSourceId == "string" ? e.dataSourceId : void 0;
3795
4220
  }
3796
- function Lr(e, t) {
4221
+ function si(e, t) {
3797
4222
  if (e === void 0 || t === void 0) return !1;
3798
- let n = K(e.params) ? e.params : {}, r = K(t.params) ? t.params : {}, i = (e) => J(e) && Ar(e.variableId), a = new Set([...Object.keys(n), ...Object.keys(r)].filter((e) => i(n[e]) || i(r[e]))), o = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => !a.has(e)));
4223
+ let n = K(e.params) ? e.params : {}, r = K(t.params) ? t.params : {}, i = (e) => J(e) && ei(e.variableId), a = new Set([...Object.keys(n), ...Object.keys(r)].filter((e) => i(n[e]) || i(r[e]))), o = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => !a.has(e)));
3799
4224
  return Y({
3800
4225
  source: e.source,
3801
4226
  name: e.name,
@@ -3806,14 +4231,14 @@ function Lr(e, t) {
3806
4231
  params: o(r)
3807
4232
  });
3808
4233
  }
3809
- function Rr(e, t) {
4234
+ function ci(e, t) {
3810
4235
  let n = new Map(t.components.map((e) => [e.id, e])), r;
3811
4236
  for (let i of e) {
3812
- if (!ar(i, t)) continue;
4237
+ if (!kr(i, t)) continue;
3813
4238
  let e = i.compiled.document.components, a = 0, o = 0;
3814
4239
  for (let t of e) {
3815
4240
  let e = n.get(t.id);
3816
- e !== void 0 && (a += 1, Nr(t, e) && (o += 1));
4241
+ e !== void 0 && (a += 1, ri(t, e) && (o += 1));
3817
4242
  }
3818
4243
  if (a < 3 || a < e.length / 2) continue;
3819
4244
  let s = e.length - a, c = t.components.filter((t) => !e.some((e) => e.id === t.id)).length, l = o - s - c;
@@ -3824,8 +4249,8 @@ function Rr(e, t) {
3824
4249
  }
3825
4250
  return r?.session;
3826
4251
  }
3827
- function zr(e) {
3828
- let { intent: t } = e, n = I(t.title, t.subtitle), r = (e, t) => ({
4252
+ function li(e) {
4253
+ let { intent: t } = e, n = Ie(t.title, t.subtitle), r = (e, t) => ({
3829
4254
  target: G(e),
3830
4255
  kind: "block",
3831
4256
  part: t,
@@ -3856,7 +4281,7 @@ function zr(e) {
3856
4281
  kind: "kpi",
3857
4282
  part: "items",
3858
4283
  title: e.label,
3859
- value: L(e, n),
4284
+ value: Le(e, n),
3860
4285
  ...e.key === void 0 ? {} : { key: e.key },
3861
4286
  ...e.states === void 0 || e.states.rules.length === 0 ? {} : { states: e.states.rules.map((e) => e.label ?? `${e.tone}`) }
3862
4287
  }))
@@ -3873,37 +4298,37 @@ function zr(e) {
3873
4298
  }
3874
4299
  //#endregion
3875
4300
  //#region ../host-kit/dist/intent/intent-stream.js
3876
- var Br = 6, Vr = 8, Hr = 5, Ur = 4, Wr = /* @__PURE__ */ new Set(["wide-narrow", "even"]), Gr = /* @__PURE__ */ new Set(["left", "right"]);
3877
- function Kr(e, t) {
3878
- let n = Xr(e);
4301
+ var ui = 6, di = 8, fi = 5, pi = 8, mi = /* @__PURE__ */ new Set(["wide-narrow", "even"]), hi = /* @__PURE__ */ new Set(["left", "right"]);
4302
+ function gi(e, t) {
4303
+ let n = bi(e);
3879
4304
  if (n === null) return;
3880
4305
  if (Array.isArray(n.regions)) {
3881
- if (n.regions.length < 1 || n.regions.length > Br) return;
4306
+ if (n.regions.length < 1 || n.regions.length > ui) return;
3882
4307
  let e = [];
3883
4308
  for (let r of n.regions) {
3884
- let n = qr(r, t);
4309
+ let n = _i(r, t);
3885
4310
  if (n === void 0) return;
3886
4311
  e.push(n);
3887
4312
  }
3888
4313
  return { regions: e };
3889
4314
  }
3890
4315
  let r = n.kpis;
3891
- if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > Hr) return;
3892
- let i = Jr(n.blocks, t, Ur);
3893
- return i === void 0 ? void 0 : Tt(r, i);
4316
+ if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > fi) return;
4317
+ let i = vi(n.blocks, t, pi);
4318
+ return i === void 0 ? void 0 : At(r, i);
3894
4319
  }
3895
- function qr(e, t) {
3896
- let n = Xr(e);
4320
+ function _i(e, t) {
4321
+ let n = bi(e);
3897
4322
  if (n !== null) {
3898
4323
  if (n.kind === "band") {
3899
4324
  let e = n.count;
3900
- return typeof e != "number" || !Number.isInteger(e) || e < 1 || e > Vr ? void 0 : {
4325
+ return typeof e != "number" || !Number.isInteger(e) || e < 1 || e > di ? void 0 : {
3901
4326
  kind: "band",
3902
4327
  count: e
3903
4328
  };
3904
4329
  }
3905
4330
  if (n.kind === "grid") {
3906
- let e = Jr(n.blocks ?? n.slots, t, Vr);
4331
+ let e = vi(n.blocks ?? n.slots, t, di);
3907
4332
  return e === void 0 ? void 0 : {
3908
4333
  kind: "grid",
3909
4334
  slots: e
@@ -3911,8 +4336,8 @@ function qr(e, t) {
3911
4336
  }
3912
4337
  if (n.kind === "split") {
3913
4338
  let e = n.ratio === void 0 ? "wide-narrow" : n.ratio, r = n.railSide === void 0 ? "right" : n.railSide;
3914
- if (typeof e != "string" || !Wr.has(e) || typeof r != "string" || !Gr.has(r)) return;
3915
- let i = Jr(n.main, t, Vr), a = Jr(n.rail, t, Vr);
4339
+ if (typeof e != "string" || !mi.has(e) || typeof r != "string" || !hi.has(r)) return;
4340
+ let i = vi(n.main, t, di), a = vi(n.rail, t, di);
3916
4341
  return i === void 0 || a === void 0 ? void 0 : {
3917
4342
  kind: "split",
3918
4343
  ratio: e,
@@ -3923,11 +4348,11 @@ function qr(e, t) {
3923
4348
  }
3924
4349
  }
3925
4350
  }
3926
- function Jr(e, t, n) {
4351
+ function vi(e, t, n) {
3927
4352
  if (!Array.isArray(e) || e.length < 1 || e.length > n) return;
3928
4353
  let r = [];
3929
4354
  for (let n of e) {
3930
- let e = Xr(n), i = typeof e?.type == "string" ? e.type.trim() : "", a = t.materials.find((e) => e.type === i);
4355
+ let e = bi(n), i = typeof e?.type == "string" ? e.type.trim() : "", a = t.materials.find((e) => e.type === i);
3931
4356
  if (e === null || a === void 0 || a.children === !0) return;
3932
4357
  let o = e.span === void 0 ? 1 : e.span;
3933
4358
  if (typeof o != "number" || !Number.isFinite(o)) return;
@@ -3938,7 +4363,7 @@ function Jr(e, t, n) {
3938
4363
  }
3939
4364
  return r;
3940
4365
  }
3941
- function Yr(e) {
4366
+ function yi(e) {
3942
4367
  let t, n, r = {}, i = {}, a = {
3943
4368
  kpis: /* @__PURE__ */ new Set(),
3944
4369
  blocks: /* @__PURE__ */ new Set()
@@ -3956,17 +4381,17 @@ function Yr(e) {
3956
4381
  return {
3957
4382
  skeleton(r) {
3958
4383
  if (t !== void 0) return !1;
3959
- let i = Kr(r.layout, e);
4384
+ let i = gi(r.layout, e);
3960
4385
  return i === void 0 || r.title.trim() === "" || r.subtitle.trim() === "" ? !1 : (t = r, n = i, s(i), !0);
3961
4386
  },
3962
4387
  item(t, s) {
3963
4388
  if (n === void 0) return !1;
3964
4389
  if (a.kpis.has(t)) {
3965
- let e = V(s, t);
4390
+ let e = z(s, t);
3966
4391
  return e.value === void 0 || t in r ? !1 : (r[t] = e.value, !0);
3967
4392
  }
3968
4393
  if (a.blocks.has(t)) {
3969
- let n = H(s, e, t, { grid: o.has(t) });
4394
+ let n = B(s, e, t, { grid: o.has(t) });
3970
4395
  return n.value === void 0 || t in i ? !1 : (i[t] = n.value, !0);
3971
4396
  }
3972
4397
  return !1;
@@ -3974,8 +4399,8 @@ function Yr(e) {
3974
4399
  frame() {
3975
4400
  if (t !== void 0 && n !== void 0) return {
3976
4401
  intent: {
3977
- title: B(t.title.trim(), 20),
3978
- subtitle: B(t.subtitle.trim(), 40),
4402
+ title: R(t.title.trim(), 20),
4403
+ subtitle: R(t.subtitle.trim(), 40),
3979
4404
  ...t.style === void 0 || t.style === "" ? {} : { style: t.style },
3980
4405
  regions: []
3981
4406
  },
@@ -3988,24 +4413,24 @@ function Yr(e) {
3988
4413
  }
3989
4414
  };
3990
4415
  }
3991
- function Xr(e) {
4416
+ function bi(e) {
3992
4417
  return typeof e == "object" && e && !Array.isArray(e) ? e : null;
3993
4418
  }
3994
4419
  //#endregion
3995
4420
  //#region ../host-kit/dist/project-adapter.js
3996
- function Zr(e) {
4421
+ function xi(e) {
3997
4422
  let t = e.migrate ?? s;
3998
4423
  async function n(e, n, r, i) {
3999
4424
  if (n.signal.aborted) return Z();
4000
- let o = await v(e, n, n.signal);
4425
+ let o = await y(e, n, n.signal);
4001
4426
  if (n.signal.aborted || !o.ok && o.error.code === "ABORTED") return Z();
4002
4427
  let s;
4003
- if (!o.ok) s = ei(r && (o.error.code === "REVISION_CONFLICT" || o.error.status === 409) ? "PROJECT_CONFLICT" : "PROJECT_UNAVAILABLE", r ? ["revision"] : [], o.error.message);
4428
+ if (!o.ok) s = wi(r && (o.error.code === "REVISION_CONFLICT" || o.error.status === 409) ? "PROJECT_CONFLICT" : "PROJECT_UNAVAILABLE", r ? ["revision"] : [], o.error.message);
4004
4429
  else try {
4005
4430
  let i = e.response ? e.response(o.data, n) : o.data;
4006
4431
  if (n.signal.aborted) return Z();
4007
4432
  if (r) s = a(i);
4008
- else if (typeof i != "object" || !i || !("document" in i)) s = ei("PROJECT_UNAVAILABLE", [], "项目信封格式无效。");
4433
+ else if (typeof i != "object" || !i || !("document" in i)) s = wi("PROJECT_UNAVAILABLE", [], "项目信封格式无效。");
4009
4434
  else {
4010
4435
  let e = t(i.document);
4011
4436
  if (n.signal.aborted) return Z();
@@ -4018,9 +4443,9 @@ function Zr(e) {
4018
4443
  };
4019
4444
  }
4020
4445
  } catch {
4021
- s = ei("PROJECT_UNAVAILABLE", [], "项目信封格式无效。");
4446
+ s = wi("PROJECT_UNAVAILABLE", [], "项目信封格式无效。");
4022
4447
  }
4023
- return n.signal.aborted ? Z() : (y(i, n, s, o.ok ? void 0 : o.error), s);
4448
+ return n.signal.aborted ? Z() : (b(i, n, s, o.ok ? void 0 : o.error), s);
4024
4449
  }
4025
4450
  return {
4026
4451
  capabilities: { publish: !1 },
@@ -4028,22 +4453,22 @@ function Zr(e) {
4028
4453
  save: (t) => n(e.save, t, !0, e.onSaveResult)
4029
4454
  };
4030
4455
  }
4031
- function Qr(e) {
4032
- let t = m(e);
4033
- return Zr({
4456
+ function Si(e) {
4457
+ let t = h(e);
4458
+ return xi({
4034
4459
  ...e.migrate === void 0 ? {} : { migrate: e.migrate },
4035
- load: b(t, e.mapping?.load, (e) => ({ path: `/screens/${encodeURIComponent(e.projectId)}` }), $r),
4036
- save: b(t, e.mapping?.save, (e) => ({
4460
+ load: x(t, e.mapping?.load, (e) => ({ path: `/screens/${encodeURIComponent(e.projectId)}` }), Ci),
4461
+ save: x(t, e.mapping?.save, (e) => ({
4037
4462
  path: `/screens/${encodeURIComponent(e.projectId)}`,
4038
4463
  method: "PUT",
4039
4464
  body: {
4040
4465
  document: e.document,
4041
4466
  revision: Number(e.revision)
4042
4467
  }
4043
- }), $r)
4468
+ }), Ci)
4044
4469
  });
4045
4470
  }
4046
- function $r(e) {
4471
+ function Ci(e) {
4047
4472
  if (typeof e != "object" || !e || !("screen" in e)) return;
4048
4473
  let t = e.screen;
4049
4474
  if (!(typeof t != "object" || !t || !("id" in t) || !("name" in t) || !("revision" in t) || !("document" in t) || typeof t.revision != "number" || !Number.isSafeInteger(t.revision) || t.revision < 0)) return {
@@ -4061,7 +4486,7 @@ function Z() {
4061
4486
  diagnostics: []
4062
4487
  };
4063
4488
  }
4064
- function ei(e, t, n) {
4489
+ function wi(e, t, n) {
4065
4490
  return {
4066
4491
  ok: !1,
4067
4492
  diagnostics: [{
@@ -4094,15 +4519,15 @@ function $(e, t) {
4094
4519
  }
4095
4520
  //#endregion
4096
4521
  //#region ../host-kit/dist/sse-subscribe.js
4097
- var ti = /* @__PURE__ */ new Set([
4522
+ var Ti = /* @__PURE__ */ new Set([
4098
4523
  "snapshot",
4099
4524
  "append",
4100
4525
  "invalidate",
4101
4526
  "status",
4102
4527
  "heartbeat"
4103
- ]), ni = [...ti], ri = 2, ii = 1e3, ai = /^(.+):(\d+)$/;
4104
- function oi(e) {
4105
- let t = Math.max(0, e.suspendAfterMs ?? 3e4), n = e.cursorFromEventId ?? !0, r = e.events ?? ni;
4528
+ ]), Ei = [...Ti], Di = 2, Oi = 1e3, ki = /^(.+):(\d+)$/;
4529
+ function Ai(e) {
4530
+ let t = Math.max(0, e.suspendAfterMs ?? 3e4), n = e.cursorFromEventId ?? !0, r = e.events ?? Ei;
4106
4531
  return (i, a, o) => {
4107
4532
  let s;
4108
4533
  try {
@@ -4153,7 +4578,7 @@ function oi(e) {
4153
4578
  g(e);
4154
4579
  return;
4155
4580
  }
4156
- d.push(e), d.length > ii && d.shift();
4581
+ d.push(e), d.length > Oi && d.shift();
4157
4582
  }, S = () => {
4158
4583
  let t = e.fetchSnapshot;
4159
4584
  if (t === void 0) return;
@@ -4179,17 +4604,17 @@ function oi(e) {
4179
4604
  if (l) return;
4180
4605
  let a = typeof r.lastEventId == "string" ? r.lastEventId : "", o = {
4181
4606
  event: t,
4182
- data: si(r.data),
4607
+ data: ji(r.data),
4183
4608
  lastEventId: a
4184
4609
  }, s;
4185
4610
  try {
4186
- s = (e.mapEvent ?? ci)(o, i);
4611
+ s = (e.mapEvent ?? Mi)(o, i);
4187
4612
  } catch {
4188
4613
  s = void 0;
4189
4614
  }
4190
4615
  if (s === void 0) return;
4191
4616
  let c = Array.isArray(s) ? s : [s];
4192
- for (let e of c) x(n ? li(e, a) : e);
4617
+ for (let e of c) x(n ? Ni(e, a) : e);
4193
4618
  };
4194
4619
  try {
4195
4620
  h = new c(s, e.withCredentials === void 0 ? void 0 : { withCredentials: e.withCredentials });
@@ -4200,7 +4625,7 @@ function oi(e) {
4200
4625
  l || (p !== void 0 && clearTimeout(p), p = void 0, _("open"), S());
4201
4626
  }), h.addEventListener("error", () => {
4202
4627
  if (!l) {
4203
- if (h.readyState === ri) {
4628
+ if (h.readyState === Di) {
4204
4629
  y("Subscription stream was closed by the server.");
4205
4630
  return;
4206
4631
  }
@@ -4213,7 +4638,7 @@ function oi(e) {
4213
4638
  return o.signal.addEventListener("abort", v, { once: !0 }), Q();
4214
4639
  };
4215
4640
  }
4216
- function si(e) {
4641
+ function ji(e) {
4217
4642
  if (typeof e != "string") return e;
4218
4643
  try {
4219
4644
  return JSON.parse(e);
@@ -4221,18 +4646,18 @@ function si(e) {
4221
4646
  return e;
4222
4647
  }
4223
4648
  }
4224
- function ci(e) {
4649
+ function Mi(e) {
4225
4650
  let t = e.data;
4226
4651
  if (typeof t != "object" || !t || Array.isArray(t)) return e.event === "heartbeat" ? { type: "heartbeat" } : e.event === "invalidate" ? { type: "invalidate" } : void 0;
4227
4652
  let n = t, r = typeof n.type == "string" ? n.type : e.event;
4228
- if (ti.has(r)) return {
4653
+ if (Ti.has(r)) return {
4229
4654
  ...n,
4230
4655
  type: r
4231
4656
  };
4232
4657
  }
4233
- function li(e, t) {
4658
+ function Ni(e, t) {
4234
4659
  if (e.type !== "snapshot" && e.type !== "append" || e.cursor !== void 0) return e;
4235
- let n = ai.exec(t);
4660
+ let n = ki.exec(t);
4236
4661
  if (n === null) return e;
4237
4662
  let r = Number(n[2]);
4238
4663
  return Number.isSafeInteger(r) ? {
@@ -4245,14 +4670,14 @@ function li(e, t) {
4245
4670
  }
4246
4671
  //#endregion
4247
4672
  //#region ../host-kit/dist/subscription-hub.js
4248
- var ui = 2e3, di = 1e3;
4249
- function fi(e) {
4250
- let t = Math.max(0, e.lingerMs ?? ui), n = Math.max(1, Math.floor(e.replayRows ?? di)), r = /* @__PURE__ */ new Map(), i = (e) => {
4673
+ var Pi = 2e3, Fi = 1e3;
4674
+ function Ii(e) {
4675
+ let t = Math.max(0, e.lingerMs ?? Pi), n = Math.max(1, Math.floor(e.replayRows ?? Fi)), r = /* @__PURE__ */ new Map(), i = (e) => {
4251
4676
  e.closed || (e.closed = !0, e.lingerTimer !== void 0 && clearTimeout(e.lingerTimer), e.lingerTimer = void 0, e.listeners.clear(), r.get(e.key) === e && r.delete(e.key), e.controller.abort());
4252
4677
  }, a = (e, t) => {
4253
4678
  if (!(e.closed || typeof t != "object" || !t)) {
4254
- pi(e, t, n);
4255
- for (let n of [...e.listeners]) gi(n.sink, t);
4679
+ Li(e, t, n);
4680
+ for (let n of [...e.listeners]) Bi(n.sink, t);
4256
4681
  t.type === "status" && t.status === "failed" && i(e);
4257
4682
  }
4258
4683
  }, o = (e, n) => {
@@ -4276,7 +4701,7 @@ function fi(e) {
4276
4701
  return $("HOST_RESOURCE_INVALID", "Subscription key could not be derived.");
4277
4702
  }
4278
4703
  let l = { sink: n }, u = r.get(c);
4279
- if (u !== void 0 && !u.closed) u.lingerTimer !== void 0 && clearTimeout(u.lingerTimer), u.lingerTimer = void 0, u.listeners.add(l), mi(u, n);
4704
+ if (u !== void 0 && !u.closed) u.lingerTimer !== void 0 && clearTimeout(u.lingerTimer), u.lingerTimer = void 0, u.listeners.add(l), Ri(u, n);
4280
4705
  else {
4281
4706
  let n = {
4282
4707
  key: c,
@@ -4312,7 +4737,7 @@ function fi(e) {
4312
4737
  }
4313
4738
  };
4314
4739
  }
4315
- function pi(e, t, n) {
4740
+ function Li(e, t, n) {
4316
4741
  switch (t.type) {
4317
4742
  case "snapshot":
4318
4743
  e.snapshot = {
@@ -4323,7 +4748,7 @@ function pi(e, t, n) {
4323
4748
  case "append": {
4324
4749
  let r = e.snapshot;
4325
4750
  if (r === void 0 || !Array.isArray(t.rows)) return;
4326
- let i = hi(r.value);
4751
+ let i = zi(r.value);
4327
4752
  if (i === void 0) return;
4328
4753
  let a = [...i, ...t.rows], o = a.length > n ? a.slice(a.length - n) : a;
4329
4754
  e.snapshot = {
@@ -4344,29 +4769,29 @@ function pi(e, t, n) {
4344
4769
  default: return;
4345
4770
  }
4346
4771
  }
4347
- function mi(e, t) {
4348
- e.status !== void 0 && gi(t, {
4772
+ function Ri(e, t) {
4773
+ e.status !== void 0 && Bi(t, {
4349
4774
  type: "status",
4350
4775
  status: e.status
4351
4776
  });
4352
4777
  let n = e.snapshot;
4353
- n !== void 0 && (gi(t, {
4778
+ n !== void 0 && (Bi(t, {
4354
4779
  type: "snapshot",
4355
4780
  value: n.value,
4356
4781
  ...n.cursor === void 0 ? {} : { cursor: n.cursor }
4357
- }), e.invalidated && gi(t, { type: "invalidate" }));
4782
+ }), e.invalidated && Bi(t, { type: "invalidate" }));
4358
4783
  }
4359
- function hi(e) {
4784
+ function zi(e) {
4360
4785
  if (typeof e != "object" || !e || Array.isArray(e)) return;
4361
4786
  let t = e.rows;
4362
4787
  return Array.isArray(t) ? t : void 0;
4363
4788
  }
4364
- function gi(e, t) {
4789
+ function Bi(e, t) {
4365
4790
  try {
4366
4791
  e.push(t);
4367
4792
  } catch {}
4368
4793
  }
4369
4794
  //#endregion
4370
- export { O as BEHAVIOR_REPAIRABLE, ot as DEFAULT_INTENT_STYLE, Dt as INTENT_MAX_REFERENCED_DATASETS, at as INTENT_STYLE_PRESETS, it as INTENT_STYLE_PRESET_IDS, cr as applyIntentOps, te as compileIntentBehaviors, ut as compileScreenIntent, S as createHostDatasetPort, m as createHostKitHttp, Zr as createHostProjectAdapter, Qr as createHttpProjectAdapter, ir as createIntentSession, Yr as createIntentStreamAssembler, C as createRestDatasetPort, oi as createSseSubscribe, fi as createSubscriptionHub, zr as describeSession, I as detectIntentLanguage, or as editIntent, Tt as flatSkeleton, Pe as formatKpiDelta, L as formatKpiValue, Et as intentDatasetQueryKey, ar as isSessionUsable, nr as mapDocumentIssues, H as parseIntentBlock, V as parseIntentKpi, Kr as parseIntentSkeleton, gn as parseScreenIntent, qn as parseScreenIntentInteractions, Rr as pickSession, er as prepareIntent, kt as prepareIntentDataContext, tr as repairKey, st as resolveIntentStyle, ee as seedFilterTargets, qe as solveLayout, It as summarizeIntentDataContext, _ as toAbortSignal, g as toHostKitSearch, Rt as validateIntentData };
4795
+ export { k as BEHAVIOR_REPAIRABLE, ut as DEFAULT_INTENT_STYLE, Mt as INTENT_MAX_REFERENCED_DATASETS, lt as INTENT_STYLE_PRESETS, ct as INTENT_STYLE_PRESET_IDS, Mr as applyIntentOps, fr as compileFreeformIntent, ee as compileIntentBehaviors, mt as compileScreenIntent, dr as createFreeformStreamAssembler, C as createHostDatasetPort, h as createHostKitHttp, xi as createHostProjectAdapter, Si as createHttpProjectAdapter, Or as createIntentSession, yi as createIntentStreamAssembler, w as createRestDatasetPort, Ai as createSseSubscribe, Ii as createSubscriptionHub, li as describeSession, Ie as detectIntentLanguage, Ar as editIntent, At as flatSkeleton, Re as formatKpiDelta, Le as formatKpiValue, jt as intentDatasetQueryKey, kr as isSessionUsable, Dr as mapDocumentIssues, ur as parseFreeformIntent, B as parseIntentBlock, z as parseIntentKpi, gi as parseIntentSkeleton, xn as parseScreenIntent, Qn as parseScreenIntentInteractions, ci as pickSession, wr as prepareIntent, Pt as prepareIntentDataContext, Er as repairKey, dt as resolveIntentStyle, M as seedFilterTargets, Ze as solveLayout, Vt as summarizeIntentDataContext, v as toAbortSignal, _ as toHostKitSearch, Ut as validateIntentData };
4371
4796
 
4372
4797
  //# sourceMappingURL=host-kit.js.map