base-screen 0.0.0-stage → 0.1.1

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 (822) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -2
  3. package/dist/_internal/contracts/dataset/constants.d.ts +7 -0
  4. package/dist/_internal/contracts/dataset/constants.js +7 -0
  5. package/dist/_internal/contracts/dataset/definition.d.ts +9 -0
  6. package/dist/_internal/contracts/dataset/definition.js +191 -0
  7. package/dist/_internal/contracts/dataset/diagnostics.d.ts +9 -0
  8. package/dist/_internal/contracts/dataset/diagnostics.js +33 -0
  9. package/dist/_internal/contracts/dataset/parse.d.ts +5 -0
  10. package/dist/_internal/contracts/dataset/parse.js +38 -0
  11. package/dist/_internal/contracts/dataset/structure.d.ts +6 -0
  12. package/dist/_internal/contracts/dataset/structure.js +80 -0
  13. package/dist/_internal/contracts/dataset/validation.d.ts +19 -0
  14. package/dist/_internal/contracts/dataset/validation.js +87 -0
  15. package/dist/_internal/contracts/diagnostics/collector.d.ts +21 -0
  16. package/dist/_internal/contracts/diagnostics/collector.js +88 -0
  17. package/dist/_internal/contracts/diagnostics/material-error.d.ts +27 -0
  18. package/dist/_internal/contracts/diagnostics/material-error.js +84 -0
  19. package/dist/_internal/contracts/document/blueprint-capabilities.d.ts +26 -0
  20. package/dist/_internal/contracts/document/blueprint-capabilities.js +36 -0
  21. package/dist/_internal/contracts/document/blueprint-relations.d.ts +16 -0
  22. package/dist/_internal/contracts/document/blueprint-relations.js +196 -0
  23. package/dist/_internal/contracts/document/blueprint-strict.d.ts +3 -0
  24. package/dist/_internal/contracts/document/blueprint-strict.js +127 -0
  25. package/dist/_internal/contracts/document/canvas-background.d.ts +30 -0
  26. package/dist/_internal/contracts/document/canvas-background.js +61 -0
  27. package/dist/_internal/contracts/document/data-source-order.d.ts +16 -0
  28. package/dist/_internal/contracts/document/data-source-order.js +165 -0
  29. package/dist/_internal/contracts/document/envelope.d.ts +4 -0
  30. package/dist/_internal/contracts/document/envelope.js +122 -0
  31. package/dist/_internal/contracts/document/identity.d.ts +3 -0
  32. package/dist/_internal/contracts/document/identity.js +6 -0
  33. package/dist/_internal/contracts/document/image-url.d.ts +2 -0
  34. package/dist/_internal/contracts/document/image-url.js +23 -0
  35. package/dist/_internal/contracts/document/json-schema.d.ts +5 -0
  36. package/dist/_internal/contracts/document/json-schema.js +120 -0
  37. package/dist/_internal/contracts/document/limits.d.ts +31 -0
  38. package/dist/_internal/contracts/document/limits.js +31 -0
  39. package/dist/_internal/contracts/document/parse.d.ts +26 -0
  40. package/dist/_internal/contracts/document/parse.js +67 -0
  41. package/dist/_internal/contracts/document/read-data-value.d.ts +46 -0
  42. package/dist/_internal/contracts/document/read-data-value.js +185 -0
  43. package/dist/_internal/contracts/document/references.d.ts +4 -0
  44. package/dist/_internal/contracts/document/references.js +284 -0
  45. package/dist/_internal/contracts/document/schema.d.ts +785 -0
  46. package/dist/_internal/contracts/document/schema.js +457 -0
  47. package/dist/_internal/contracts/document/serialize.d.ts +9 -0
  48. package/dist/_internal/contracts/document/serialize.js +20 -0
  49. package/dist/_internal/contracts/document/strict-object.d.ts +5 -0
  50. package/dist/_internal/contracts/document/strict-object.js +17 -0
  51. package/dist/_internal/contracts/document/validate-blueprint.d.ts +4 -0
  52. package/dist/_internal/contracts/document/validate-blueprint.js +94 -0
  53. package/dist/_internal/contracts/document/validate-canvas.d.ts +4 -0
  54. package/dist/_internal/contracts/document/validate-canvas.js +62 -0
  55. package/dist/_internal/contracts/document/validate-component.d.ts +4 -0
  56. package/dist/_internal/contracts/document/validate-component.js +251 -0
  57. package/dist/_internal/contracts/document/validate-data-source.d.ts +11 -0
  58. package/dist/_internal/contracts/document/validate-data-source.js +196 -0
  59. package/dist/_internal/contracts/document/validate-support.d.ts +11 -0
  60. package/dist/_internal/contracts/document/validate-support.js +27 -0
  61. package/dist/_internal/contracts/document/validate-value-ref.d.ts +25 -0
  62. package/dist/_internal/contracts/document/validate-value-ref.js +113 -0
  63. package/dist/_internal/contracts/document/validate-variable.d.ts +8 -0
  64. package/dist/_internal/contracts/document/validate-variable.js +90 -0
  65. package/dist/_internal/contracts/document/validate.d.ts +4 -0
  66. package/dist/_internal/contracts/document/validate.js +122 -0
  67. package/dist/_internal/contracts/index.d.ts +35 -0
  68. package/dist/_internal/contracts/index.js +24 -0
  69. package/dist/_internal/contracts/json/canonical.d.ts +8 -0
  70. package/dist/_internal/contracts/json/canonical.js +199 -0
  71. package/dist/_internal/contracts/json/clone.d.ts +2 -0
  72. package/dist/_internal/contracts/json/clone.js +14 -0
  73. package/dist/_internal/contracts/json/equality.d.ts +13 -0
  74. package/dist/_internal/contracts/json/equality.js +34 -0
  75. package/dist/_internal/contracts/json/limits.d.ts +6 -0
  76. package/dist/_internal/contracts/json/limits.js +6 -0
  77. package/dist/_internal/contracts/json/parse.d.ts +11 -0
  78. package/dist/_internal/contracts/json/parse.js +34 -0
  79. package/dist/_internal/contracts/json/preflight.d.ts +13 -0
  80. package/dist/_internal/contracts/json/preflight.js +225 -0
  81. package/dist/_internal/contracts/migration/migrate-document.d.ts +39 -0
  82. package/dist/_internal/contracts/migration/migrate-document.js +481 -0
  83. package/dist/_internal/contracts/screen-document.schema.json +1564 -0
  84. package/dist/_internal/contracts/types/authoring.d.ts +49 -0
  85. package/dist/_internal/contracts/types/authoring.js +148 -0
  86. package/dist/_internal/contracts/types/dataset-port.d.ts +65 -0
  87. package/dist/_internal/contracts/types/dataset-port.js +9 -0
  88. package/dist/_internal/contracts/types/dataset.d.ts +16 -0
  89. package/dist/_internal/contracts/types/dataset.js +1 -0
  90. package/dist/_internal/contracts/types/diagnostics.d.ts +18 -0
  91. package/dist/_internal/contracts/types/diagnostics.js +1 -0
  92. package/dist/_internal/contracts/types/document.d.ts +387 -0
  93. package/dist/_internal/contracts/types/document.js +1 -0
  94. package/dist/_internal/contracts/types/envelope.d.ts +11 -0
  95. package/dist/_internal/contracts/types/envelope.js +1 -0
  96. package/dist/_internal/contracts/types/execution.d.ts +34 -0
  97. package/dist/_internal/contracts/types/execution.js +6 -0
  98. package/dist/_internal/contracts/types/host.d.ts +280 -0
  99. package/dist/_internal/contracts/types/host.js +41 -0
  100. package/dist/_internal/contracts/types/json.d.ts +5 -0
  101. package/dist/_internal/contracts/types/json.js +1 -0
  102. package/dist/_internal/contracts/types/variable.d.ts +36 -0
  103. package/dist/_internal/contracts/types/variable.js +1 -0
  104. package/dist/_internal/contracts/variable/parse.d.ts +7 -0
  105. package/dist/_internal/contracts/variable/parse.js +247 -0
  106. package/dist/_internal/core/blueprint/runtime-compile.d.ts +5 -0
  107. package/dist/_internal/core/blueprint/runtime-compile.js +55 -0
  108. package/dist/_internal/core/blueprint/runtime-dispatch.d.ts +5 -0
  109. package/dist/_internal/core/blueprint/runtime-dispatch.js +212 -0
  110. package/dist/_internal/core/blueprint/runtime-json.d.ts +9 -0
  111. package/dist/_internal/core/blueprint/runtime-json.js +124 -0
  112. package/dist/_internal/core/blueprint/runtime-types.d.ts +89 -0
  113. package/dist/_internal/core/blueprint/runtime-types.js +1 -0
  114. package/dist/_internal/core/blueprint/runtime.d.ts +4 -0
  115. package/dist/_internal/core/blueprint/runtime.js +3 -0
  116. package/dist/_internal/core/commands/apply-component-commands.d.ts +7 -0
  117. package/dist/_internal/core/commands/apply-component-commands.js +153 -0
  118. package/dist/_internal/core/commands/apply-data-source-command.d.ts +23 -0
  119. package/dist/_internal/core/commands/apply-data-source-command.js +70 -0
  120. package/dist/_internal/core/commands/apply-variable-command.d.ts +8 -0
  121. package/dist/_internal/core/commands/apply-variable-command.js +35 -0
  122. package/dist/_internal/core/commands/apply.d.ts +5 -0
  123. package/dist/_internal/core/commands/apply.js +146 -0
  124. package/dist/_internal/core/commands/command-input.d.ts +8 -0
  125. package/dist/_internal/core/commands/command-input.js +24 -0
  126. package/dist/_internal/core/commands/command-result.d.ts +8 -0
  127. package/dist/_internal/core/commands/command-result.js +28 -0
  128. package/dist/_internal/core/commands/parse-command.d.ts +4 -0
  129. package/dist/_internal/core/commands/parse-command.js +64 -0
  130. package/dist/_internal/core/commands/types.d.ts +99 -0
  131. package/dist/_internal/core/commands/types.js +1 -0
  132. package/dist/_internal/core/data/data-source-dependents.d.ts +13 -0
  133. package/dist/_internal/core/data/data-source-dependents.js +25 -0
  134. package/dist/_internal/core/data/host-dataset.d.ts +9 -0
  135. package/dist/_internal/core/data/host-dataset.js +9 -0
  136. package/dist/_internal/core/data/value-ref.d.ts +82 -0
  137. package/dist/_internal/core/data/value-ref.js +206 -0
  138. package/dist/_internal/core/diff/screen-diff.d.ts +22 -0
  139. package/dist/_internal/core/diff/screen-diff.js +81 -0
  140. package/dist/_internal/core/geometry/alignment.d.ts +9 -0
  141. package/dist/_internal/core/geometry/alignment.js +113 -0
  142. package/dist/_internal/core/geometry/bounds.d.ts +13 -0
  143. package/dist/_internal/core/geometry/bounds.js +85 -0
  144. package/dist/_internal/core/geometry/component-bounds.d.ts +5 -0
  145. package/dist/_internal/core/geometry/component-bounds.js +33 -0
  146. package/dist/_internal/core/geometry/coordinates.d.ts +5 -0
  147. package/dist/_internal/core/geometry/coordinates.js +24 -0
  148. package/dist/_internal/core/geometry/geometry.d.ts +6 -0
  149. package/dist/_internal/core/geometry/geometry.js +6 -0
  150. package/dist/_internal/core/geometry/hit-testing.d.ts +13 -0
  151. package/dist/_internal/core/geometry/hit-testing.js +146 -0
  152. package/dist/_internal/core/geometry/snapping.d.ts +10 -0
  153. package/dist/_internal/core/geometry/snapping.js +69 -0
  154. package/dist/_internal/core/geometry/types.d.ts +22 -0
  155. package/dist/_internal/core/geometry/types.js +1 -0
  156. package/dist/_internal/core/geometry/validation.d.ts +6 -0
  157. package/dist/_internal/core/geometry/validation.js +31 -0
  158. package/dist/_internal/core/hierarchy/hierarchy.d.ts +18 -0
  159. package/dist/_internal/core/hierarchy/hierarchy.js +146 -0
  160. package/dist/_internal/core/hierarchy/query.d.ts +4 -0
  161. package/dist/_internal/core/hierarchy/query.js +8 -0
  162. package/dist/_internal/core/history/history.d.ts +40 -0
  163. package/dist/_internal/core/history/history.js +121 -0
  164. package/dist/_internal/core/index.d.ts +28 -0
  165. package/dist/_internal/core/index.js +18 -0
  166. package/dist/_internal/core/internal/diagnostics.d.ts +9 -0
  167. package/dist/_internal/core/internal/diagnostics.js +18 -0
  168. package/dist/_internal/core/internal/document.d.ts +10 -0
  169. package/dist/_internal/core/internal/document.js +21 -0
  170. package/dist/_internal/core/internal/preconditions.d.ts +5 -0
  171. package/dist/_internal/core/internal/preconditions.js +15 -0
  172. package/dist/_internal/core/json/path-update.d.ts +9 -0
  173. package/dist/_internal/core/json/path-update.js +180 -0
  174. package/dist/_internal/core/state/interaction.d.ts +19 -0
  175. package/dist/_internal/core/state/interaction.js +53 -0
  176. package/dist/_internal/core/state/viewport.d.ts +20 -0
  177. package/dist/_internal/core/state/viewport.js +60 -0
  178. package/dist/_internal/core/validation/contrast.d.ts +38 -0
  179. package/dist/_internal/core/validation/contrast.js +140 -0
  180. package/dist/_internal/core/validation/invariant-error.d.ts +7 -0
  181. package/dist/_internal/core/validation/invariant-error.js +9 -0
  182. package/dist/_internal/core/validation/validate-semantics.d.ts +3 -0
  183. package/dist/_internal/core/validation/validate-semantics.js +73 -0
  184. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge-helpers.d.ts +15 -0
  185. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +44 -0
  186. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panel-mutations.d.ts +5 -0
  187. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panel-tabs.d.ts +6 -0
  188. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panels-controller.d.ts +42 -0
  189. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-callbacks.d.ts +24 -0
  190. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-controller.d.ts +37 -0
  191. package/dist/_internal/engine/browser/controllers/dataset/designer-data-flow-scroll-sync.d.ts +20 -0
  192. package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +82 -0
  193. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-catalog-controller.d.ts +43 -0
  194. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +115 -0
  195. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller.d.ts +31 -0
  196. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +58 -0
  197. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-effective-value.d.ts +44 -0
  198. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-events.d.ts +8 -0
  199. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-instance-view.d.ts +16 -0
  200. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-preview-controller.d.ts +7 -0
  201. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +46 -0
  202. package/dist/_internal/engine/browser/controllers/dataset/designer-static-cell.d.ts +3 -0
  203. package/dist/_internal/engine/browser/controllers/dataset/designer-static-data-events.d.ts +5 -0
  204. package/dist/_internal/engine/browser/controllers/dataset/designer-static-table-controller.d.ts +11 -0
  205. package/dist/_internal/engine/browser/controllers/designer-auto-width-controller.d.ts +20 -0
  206. package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +31 -0
  207. package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +76 -0
  208. package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +51 -0
  209. package/dist/_internal/engine/browser/controllers/designer-error-console-controller.d.ts +17 -0
  210. package/dist/_internal/engine/browser/controllers/designer-guard-controller.d.ts +27 -0
  211. package/dist/_internal/engine/browser/controllers/designer-import-controller.d.ts +21 -0
  212. package/dist/_internal/engine/browser/controllers/designer-inspector-scroll-guard.d.ts +47 -0
  213. package/dist/_internal/engine/browser/controllers/designer-integration-controller.d.ts +25 -0
  214. package/dist/_internal/engine/browser/controllers/designer-intent-choice-controller.d.ts +41 -0
  215. package/dist/_internal/engine/browser/controllers/designer-intent-controller.d.ts +111 -0
  216. package/dist/_internal/engine/browser/controllers/designer-left-panel-group-events.d.ts +7 -0
  217. package/dist/_internal/engine/browser/controllers/designer-notification-controller.d.ts +11 -0
  218. package/dist/_internal/engine/browser/controllers/designer-presentation-lock-controller.d.ts +32 -0
  219. package/dist/_internal/engine/browser/controllers/designer-preview-controller.d.ts +27 -0
  220. package/dist/_internal/engine/browser/controllers/designer-scene-controller.d.ts +47 -0
  221. package/dist/_internal/engine/browser/controllers/designer-scroll-continuity-controller.d.ts +17 -0
  222. package/dist/_internal/engine/browser/controllers/designer-target-display-controller.d.ts +30 -0
  223. package/dist/_internal/engine/browser/controllers/designer-text-edit-controller.d.ts +38 -0
  224. package/dist/_internal/engine/browser/controllers/designer-tooltip-controller.d.ts +6 -0
  225. package/dist/_internal/engine/browser/controllers/designer-topbar-controller.d.ts +18 -0
  226. package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +60 -0
  227. package/dist/_internal/engine/browser/controllers/entry/designer-coordinate-entry-controller.d.ts +13 -0
  228. package/dist/_internal/engine/browser/controllers/entry/designer-entry-host-callbacks.d.ts +13 -0
  229. package/dist/_internal/engine/browser/controllers/entry/designer-pair-entry-controller.d.ts +72 -0
  230. package/dist/_internal/engine/browser/controllers/entry/designer-size-entry-controller.d.ts +11 -0
  231. package/dist/_internal/engine/browser/controllers/gesture/designer-create-gesture.d.ts +24 -0
  232. package/dist/_internal/engine/browser/controllers/gesture/designer-drag-gesture.d.ts +18 -0
  233. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +51 -0
  234. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-controller.d.ts +36 -0
  235. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-environment.d.ts +30 -0
  236. package/dist/_internal/engine/browser/controllers/gesture/designer-group-editing-controller.d.ts +19 -0
  237. package/dist/_internal/engine/browser/controllers/gesture/designer-marquee-gesture.d.ts +18 -0
  238. package/dist/_internal/engine/browser/controllers/gesture/designer-transform-gesture.d.ts +17 -0
  239. package/dist/_internal/engine/browser/controllers/layers/designer-layer-drag-controller.d.ts +72 -0
  240. package/dist/_internal/engine/browser/controllers/layers/designer-layer-rename-controller.d.ts +29 -0
  241. package/dist/_internal/engine/browser/controllers/layers/designer-layers-controller.d.ts +80 -0
  242. package/dist/_internal/engine/browser/controllers/panel/designer-material-group-navigation-controller.d.ts +17 -0
  243. package/dist/_internal/engine/browser/controllers/panel/designer-material-group-popover-controller.d.ts +16 -0
  244. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +50 -0
  245. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +42 -0
  246. package/dist/_internal/engine/browser/controllers/panel/designer-panel-inspector-controller.d.ts +24 -0
  247. package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +27 -0
  248. package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +19 -0
  249. package/dist/_internal/engine/browser/controllers/panel/designer-panel-selection-controller.d.ts +31 -0
  250. package/dist/_internal/engine/browser/controllers/panel/designer-style-rules-controller.d.ts +12 -0
  251. package/dist/_internal/engine/browser/controllers/project/designer-project-feedback-controller.d.ts +21 -0
  252. package/dist/_internal/engine/browser/controllers/project/designer-project-workspace-controller.d.ts +41 -0
  253. package/dist/_internal/engine/browser/controllers/variables/designer-canvas-variable-controller.d.ts +23 -0
  254. package/dist/_internal/engine/browser/controllers/variables/designer-variable-catalog-controller.d.ts +28 -0
  255. package/dist/_internal/engine/browser/controllers/variables/designer-variable-editor-controller.d.ts +60 -0
  256. package/dist/_internal/engine/browser/controllers/variables/designer-variable-editor-mutations.d.ts +43 -0
  257. package/dist/_internal/engine/browser/controllers/variables/designer-variables-controller.d.ts +31 -0
  258. package/dist/_internal/engine/browser/controllers/workbench/designer-guide-controller.d.ts +48 -0
  259. package/dist/_internal/engine/browser/controllers/workbench/designer-panel-layout-controller.d.ts +35 -0
  260. package/dist/_internal/engine/browser/controllers/workbench/designer-snap-controller.d.ts +46 -0
  261. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +79 -0
  262. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +34 -0
  263. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-default-canvas.d.ts +6 -0
  264. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-dom-helpers.d.ts +2 -0
  265. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-dom.d.ts +7 -0
  266. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-host-left-panel-dom.d.ts +3 -0
  267. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +5 -0
  268. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-dom.d.ts +6 -0
  269. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-library-dom.d.ts +8 -0
  270. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-workbench-dom.d.ts +9 -0
  271. package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +38 -0
  272. package/dist/_internal/engine/browser/dom/color/designer-color-palette-body-dom.d.ts +9 -0
  273. package/dist/_internal/engine/browser/dom/color/designer-color-palette-cache.d.ts +24 -0
  274. package/dist/_internal/engine/browser/dom/color/designer-color-palette-dom.d.ts +6 -0
  275. package/dist/_internal/engine/browser/dom/color/designer-color-palette-model.d.ts +35 -0
  276. package/dist/_internal/engine/browser/dom/color/designer-color-palette-state-dom.d.ts +15 -0
  277. package/dist/_internal/engine/browser/dom/color/designer-color-palette-state-reader.d.ts +3 -0
  278. package/dist/_internal/engine/browser/dom/color/designer-color-palette-stop-utils.d.ts +10 -0
  279. package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +26 -0
  280. package/dist/_internal/engine/browser/dom/color/designer-color-palette-value-dom.d.ts +47 -0
  281. package/dist/_internal/engine/browser/dom/color/designer-color-popover-dom.d.ts +5 -0
  282. package/dist/_internal/engine/browser/dom/color/designer-fill-color-model.d.ts +19 -0
  283. package/dist/_internal/engine/browser/dom/color/designer-fill-color-picker-dom.d.ts +9 -0
  284. package/dist/_internal/engine/browser/dom/color/designer-fill-color-picker-events.d.ts +3 -0
  285. package/dist/_internal/engine/browser/dom/color/designer-fill-color-picker-runtime.d.ts +24 -0
  286. package/dist/_internal/engine/browser/dom/dataset/designer-data-entry-dom.d.ts +57 -0
  287. package/dist/_internal/engine/browser/dom/dataset/designer-data-group-dom.d.ts +48 -0
  288. package/dist/_internal/engine/browser/dom/dataset/designer-data-panel-notice.d.ts +29 -0
  289. package/dist/_internal/engine/browser/dom/dataset/designer-data-section-diff.d.ts +49 -0
  290. package/dist/_internal/engine/browser/dom/dataset/designer-data-state.d.ts +39 -0
  291. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-authoring-dom.d.ts +12 -0
  292. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-binding.d.ts +5 -0
  293. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-catalog-dom.d.ts +34 -0
  294. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-config-controls.d.ts +12 -0
  295. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-config-dom.d.ts +7 -0
  296. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-dom.d.ts +8 -0
  297. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-flow-dom.d.ts +30 -0
  298. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-preview-dom.d.ts +3 -0
  299. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-primitives.d.ts +51 -0
  300. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-sections.d.ts +23 -0
  301. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +184 -0
  302. package/dist/_internal/engine/browser/dom/dataset/designer-source-sheet-dom.d.ts +15 -0
  303. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-array-fields-dom.d.ts +5 -0
  304. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +13 -0
  305. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-custom-control-dom.d.ts +9 -0
  306. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-dom.d.ts +7 -0
  307. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-fields-dom.d.ts +5 -0
  308. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +27 -0
  309. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-operations.d.ts +6 -0
  310. package/dist/_internal/engine/browser/dom/designer-date-field-dom.d.ts +15 -0
  311. package/dist/_internal/engine/browser/dom/designer-editable-target.d.ts +9 -0
  312. package/dist/_internal/engine/browser/dom/designer-event-system.d.ts +35 -0
  313. package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +111 -0
  314. package/dist/_internal/engine/browser/dom/designer-form-controls-dom.d.ts +12 -0
  315. package/dist/_internal/engine/browser/dom/designer-html-escape.d.ts +3 -0
  316. package/dist/_internal/engine/browser/dom/designer-icons.d.ts +88 -0
  317. package/dist/_internal/engine/browser/dom/designer-image-metadata-dom.d.ts +4 -0
  318. package/dist/_internal/engine/browser/dom/designer-inspector-chrome-dom.d.ts +11 -0
  319. package/dist/_internal/engine/browser/dom/designer-inspector-search-dom.d.ts +20 -0
  320. package/dist/_internal/engine/browser/dom/designer-interaction-dom.d.ts +11 -0
  321. package/dist/_internal/engine/browser/dom/designer-left-panel-groups-dom.d.ts +8 -0
  322. package/dist/_internal/engine/browser/dom/designer-quick-style-dom.d.ts +11 -0
  323. package/dist/_internal/engine/browser/dom/designer-select-dom.d.ts +21 -0
  324. package/dist/_internal/engine/browser/dom/designer-selection-dom.d.ts +4 -0
  325. package/dist/_internal/engine/browser/dom/designer-surface-router.d.ts +42 -0
  326. package/dist/_internal/engine/browser/dom/designer-text-edit-dom.d.ts +17 -0
  327. package/dist/_internal/engine/browser/dom/designer-text-selection.d.ts +2 -0
  328. package/dist/_internal/engine/browser/dom/designer-ui-primitives.d.ts +166 -0
  329. package/dist/_internal/engine/browser/dom/designer-variable-inspector-dom.d.ts +25 -0
  330. package/dist/_internal/engine/browser/dom/designer-variable-references-dom.d.ts +5 -0
  331. package/dist/_internal/engine/browser/dom/designer-variables-dom.d.ts +43 -0
  332. package/dist/_internal/engine/browser/dom/designer-variables-editor-dom.d.ts +28 -0
  333. package/dist/_internal/engine/browser/dom/designer-variables-toolbar-dom.d.ts +8 -0
  334. package/dist/_internal/engine/browser/dom/display/designer-display-dom.d.ts +12 -0
  335. package/dist/_internal/engine/browser/dom/guard/designer-contrast-measure.d.ts +24 -0
  336. package/dist/_internal/engine/browser/dom/guard/designer-guard-dom.d.ts +15 -0
  337. package/dist/_internal/engine/browser/dom/intent/designer-intent-reference-picker-dom.d.ts +26 -0
  338. package/dist/_internal/engine/browser/dom/layers/designer-layer-drag-image-dom.d.ts +18 -0
  339. package/dist/_internal/engine/browser/dom/layers/designer-layers-dom.d.ts +4 -0
  340. package/dist/_internal/engine/browser/dom/layers/designer-layers-model.d.ts +53 -0
  341. package/dist/_internal/engine/browser/dom/layers/designer-layers-toolbar-dom.d.ts +14 -0
  342. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +17 -0
  343. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-group-dom.d.ts +4 -0
  344. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-group-view.d.ts +23 -0
  345. package/dist/_internal/engine/browser/dom/menu/designer-menu-dom.d.ts +11 -0
  346. package/dist/_internal/engine/browser/dom/menu/designer-menu-icons.d.ts +7 -0
  347. package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +33 -0
  348. package/dist/_internal/engine/browser/dom/menu/designer-menu.d.ts +34 -0
  349. package/dist/_internal/engine/browser/dom/menu/designer-plugin-command-menu.d.ts +9 -0
  350. package/dist/_internal/engine/browser/dom/panel/designer-canvas-properties-dom.d.ts +9 -0
  351. package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +26 -0
  352. package/dist/_internal/engine/browser/dom/panel/designer-chrome-primitives.d.ts +61 -0
  353. package/dist/_internal/engine/browser/dom/panel/designer-component-properties-dom.d.ts +6 -0
  354. package/dist/_internal/engine/browser/dom/panel/designer-data-source-model.d.ts +5 -0
  355. package/dist/_internal/engine/browser/dom/panel/designer-multi-selection-dom.d.ts +8 -0
  356. package/dist/_internal/engine/browser/dom/panel/designer-panel-dom.d.ts +7 -0
  357. package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +22 -0
  358. package/dist/_internal/engine/browser/dom/panel/designer-panel-transaction-utils.d.ts +6 -0
  359. package/dist/_internal/engine/browser/dom/panel/designer-property-transactions.d.ts +17 -0
  360. package/dist/_internal/engine/browser/dom/plugin/designer-plugin-panel-dom.d.ts +17 -0
  361. package/dist/_internal/engine/browser/dom/static-data/designer-static-data-controls.d.ts +12 -0
  362. package/dist/_internal/engine/browser/dom/static-data/designer-static-data-dom.d.ts +6 -0
  363. package/dist/_internal/engine/browser/dom/static-data/designer-static-data-pagination.d.ts +12 -0
  364. package/dist/_internal/engine/browser/dom/static-data/designer-static-data-table-dom.d.ts +5 -0
  365. package/dist/_internal/engine/browser/dom/static-data/designer-static-data-view.d.ts +15 -0
  366. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-dom.d.ts +21 -0
  367. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-mount.d.ts +33 -0
  368. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-summary-dom.d.ts +11 -0
  369. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +102 -0
  370. package/dist/_internal/engine/browser/dom/workspace/designer-canvas-hint-dom.d.ts +6 -0
  371. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-markup.d.ts +2 -0
  372. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-template.d.ts +38 -0
  373. package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +13 -0
  374. package/dist/_internal/engine/browser/styles/base/designer-base-style.d.ts +2 -0
  375. package/dist/_internal/engine/browser/styles/controls/designer-controls-style.d.ts +2 -0
  376. package/dist/_internal/engine/browser/styles/designer-style.d.ts +16 -0
  377. package/dist/_internal/engine/browser/styles/workbench/designer-workbench-style.d.ts +2 -0
  378. package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +67 -0
  379. package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +14 -0
  380. package/dist/_internal/engine/browser/viewport/designer-canvas-coordinates.d.ts +20 -0
  381. package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +14 -0
  382. package/dist/_internal/engine/browser/viewport/designer-canvas-ruler.d.ts +15 -0
  383. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-candidates.d.ts +24 -0
  384. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-geometry.d.ts +9 -0
  385. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-index.d.ts +9 -0
  386. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-preview.d.ts +12 -0
  387. package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +23 -0
  388. package/dist/_internal/engine/browser/viewport/designer-guide-overlay.d.ts +35 -0
  389. package/dist/_internal/engine/browser/viewport/designer-ruler-renderer.d.ts +8 -0
  390. package/dist/_internal/engine/browser/viewport/designer-viewport.d.ts +14 -0
  391. package/dist/_internal/engine/common/events/designer-event-policy.d.ts +42 -0
  392. package/dist/_internal/engine/common/events/designer-key-chords.d.ts +12 -0
  393. package/dist/_internal/engine/common/observability/designer-metrics.d.ts +24 -0
  394. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-capabilities.d.ts +24 -0
  395. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-connection.d.ts +14 -0
  396. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model-types.d.ts +7 -0
  397. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +12 -0
  398. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutation-helpers.d.ts +20 -0
  399. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutations.d.ts +15 -0
  400. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-node-ids.d.ts +12 -0
  401. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-guards.d.ts +11 -0
  402. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +172 -0
  403. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol.d.ts +5 -0
  404. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-value-sources.d.ts +13 -0
  405. package/dist/_internal/engine/common/operations/canvas/canvas-background-image.d.ts +8 -0
  406. package/dist/_internal/engine/common/operations/canvas/canvas-presentation.d.ts +10 -0
  407. package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +16 -0
  408. package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +38 -0
  409. package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +74 -0
  410. package/dist/_internal/engine/common/operations/change/designer-review.d.ts +8 -0
  411. package/dist/_internal/engine/common/operations/designer-authoring-bridge.d.ts +25 -0
  412. package/dist/_internal/engine/common/operations/designer-clipboard.d.ts +11 -0
  413. package/dist/_internal/engine/common/operations/designer-name-validation.d.ts +2 -0
  414. package/dist/_internal/engine/common/operations/designer-operation-registry.d.ts +305 -0
  415. package/dist/_internal/engine/common/operations/designer-text-edit-operations.d.ts +15 -0
  416. package/dist/_internal/engine/common/operations/designer-variable-editing.d.ts +8 -0
  417. package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +58 -0
  418. package/dist/_internal/engine/common/operations/designer-variable-view.d.ts +35 -0
  419. package/dist/_internal/engine/common/operations/display/designer-target-display.d.ts +70 -0
  420. package/dist/_internal/engine/common/operations/element/designer-auto-width.d.ts +12 -0
  421. package/dist/_internal/engine/common/operations/element/designer-coordinate-entry.d.ts +38 -0
  422. package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +86 -0
  423. package/dist/_internal/engine/common/operations/element/designer-element-operations.d.ts +5 -0
  424. package/dist/_internal/engine/common/operations/element/designer-geometry.d.ts +16 -0
  425. package/dist/_internal/engine/common/operations/element/designer-image-density.d.ts +9 -0
  426. package/dist/_internal/engine/common/operations/element/designer-layout-operations.d.ts +31 -0
  427. package/dist/_internal/engine/common/operations/element/designer-transform.d.ts +20 -0
  428. package/dist/_internal/engine/common/operations/host-resource/host-resource-authoring.d.ts +21 -0
  429. package/dist/_internal/engine/common/operations/host-resource/host-resource-selection.d.ts +68 -0
  430. package/dist/_internal/engine/common/operations/intent/designer-intent.d.ts +36 -0
  431. package/dist/_internal/engine/common/operations/intent/designer-parameter-intent.d.ts +15 -0
  432. package/dist/_internal/engine/common/operations/material-component/material-component-fragment.d.ts +61 -0
  433. package/dist/_internal/engine/common/operations/material-component/material-component.d.ts +49 -0
  434. package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +18 -0
  435. package/dist/_internal/engine/common/operations/material-library/material-library-items.d.ts +31 -0
  436. package/dist/_internal/engine/common/operations/material-library/material-library-state.d.ts +15 -0
  437. package/dist/_internal/engine/common/operations/plugin/designer-plugin-command-port.d.ts +8 -0
  438. package/dist/_internal/engine/common/operations/plugin/designer-plugin-commands.d.ts +14 -0
  439. package/dist/_internal/engine/common/operations/plugin/designer-plugin-design-read-port.d.ts +13 -0
  440. package/dist/_internal/engine/common/operations/plugin/designer-plugin-panels.d.ts +23 -0
  441. package/dist/_internal/engine/common/operations/scene/designer-scene.d.ts +55 -0
  442. package/dist/_internal/engine/common/operations/selection/designer-group.d.ts +12 -0
  443. package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +24 -0
  444. package/dist/_internal/engine/common/operations/selection/designer-remove-operations.d.ts +4 -0
  445. package/dist/_internal/engine/common/operations/selection/designer-selection-actions.d.ts +21 -0
  446. package/dist/_internal/engine/common/operations/selection/designer-selection.d.ts +10 -0
  447. package/dist/_internal/engine/common/operations/style/designer-host-conditional-style.d.ts +21 -0
  448. package/dist/_internal/engine/common/operations/style/designer-inspector.d.ts +43 -0
  449. package/dist/_internal/engine/common/operations/style/designer-quick-style.d.ts +21 -0
  450. package/dist/_internal/engine/common/operations/style/designer-style-field.d.ts +10 -0
  451. package/dist/_internal/engine/common/operations/style/designer-style-rules.d.ts +25 -0
  452. package/dist/_internal/engine/common/operations/workbench/designer-left-panel-groups.d.ts +21 -0
  453. package/dist/_internal/engine/common/operations/workbench/designer-navigation.d.ts +5 -0
  454. package/dist/_internal/engine/common/operations/workbench/designer-workbench-mode.d.ts +4 -0
  455. package/dist/_internal/engine/common/project/designer-project-gateway.d.ts +31 -0
  456. package/dist/_internal/engine/common/project/project-adapter-invocation.d.ts +6 -0
  457. package/dist/_internal/engine/common/project/project-controller-load.d.ts +4 -0
  458. package/dist/_internal/engine/common/project/project-controller-mutations.d.ts +5 -0
  459. package/dist/_internal/engine/common/project/project-controller-state.d.ts +31 -0
  460. package/dist/_internal/engine/common/project/project-controller-support.d.ts +44 -0
  461. package/dist/_internal/engine/common/project/project-controller.d.ts +25 -0
  462. package/dist/_internal/engine/common/session/designer-session.d.ts +50 -0
  463. package/dist/_internal/engine/common/tools/designer-json-snapshot.d.ts +6 -0
  464. package/dist/_internal/engine/common/tools/designer-tools.d.ts +36 -0
  465. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +341 -0
  466. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +1659 -0
  467. package/dist/_internal/engine/common/validation/designer-guard.d.ts +49 -0
  468. package/dist/_internal/engine/common/vendor/moveable/snappable/snap.d.ts +19 -0
  469. package/dist/_internal/engine/common/vendor/moveable/types.d.ts +23 -0
  470. package/dist/_internal/engine/designer-element/api/designer-element-authoring.d.ts +10 -0
  471. package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +12 -0
  472. package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +31 -0
  473. package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +50 -0
  474. package/dist/_internal/engine/designer-element/api/designer-element-configuration.d.ts +11 -0
  475. package/dist/_internal/engine/designer-element/api/designer-element-display.d.ts +11 -0
  476. package/dist/_internal/engine/designer-element/api/designer-element-document.d.ts +16 -0
  477. package/dist/_internal/engine/designer-element/api/designer-element-editing.d.ts +16 -0
  478. package/dist/_internal/engine/designer-element/api/designer-element-guard.d.ts +13 -0
  479. package/dist/_internal/engine/designer-element/api/designer-element-host-properties.d.ts +24 -0
  480. package/dist/_internal/engine/designer-element/api/designer-element-host-resource-selection.d.ts +14 -0
  481. package/dist/_internal/engine/designer-element/api/designer-element-host-resource.d.ts +8 -0
  482. package/dist/_internal/engine/designer-element/api/designer-element-insert-component-fragment.d.ts +21 -0
  483. package/dist/_internal/engine/designer-element/api/designer-element-insert-component.d.ts +19 -0
  484. package/dist/_internal/engine/designer-element/api/designer-element-intent.d.ts +23 -0
  485. package/dist/_internal/engine/designer-element/api/designer-element-options.d.ts +34 -0
  486. package/dist/_internal/engine/designer-element/api/designer-element-presentation.d.ts +9 -0
  487. package/dist/_internal/engine/designer-element/api/designer-element-project.d.ts +26 -0
  488. package/dist/_internal/engine/designer-element/api/designer-element-review.d.ts +10 -0
  489. package/dist/_internal/engine/designer-element/api/designer-element-scene.d.ts +14 -0
  490. package/dist/_internal/engine/designer-element/api/designer-element-workbench.d.ts +6 -0
  491. package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +247 -0
  492. package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +21 -0
  493. package/dist/_internal/engine/designer-element/runtime/designer-element-controller-state.d.ts +3 -0
  494. package/dist/_internal/engine/designer-element/runtime/designer-element-events.d.ts +16 -0
  495. package/dist/_internal/engine/designer-element/runtime/designer-element-geometry.d.ts +6 -0
  496. package/dist/_internal/engine/designer-element/runtime/designer-element-guards.d.ts +18 -0
  497. package/dist/_internal/engine/designer-element/runtime/designer-element-host.d.ts +103 -0
  498. package/dist/_internal/engine/designer-element/runtime/designer-element-lifecycle.d.ts +8 -0
  499. package/dist/_internal/engine/designer-element/runtime/designer-element-operation-state.d.ts +3 -0
  500. package/dist/_internal/engine/designer-element/runtime/designer-element-plugin-commands.d.ts +18 -0
  501. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +23 -0
  502. package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +221 -0
  503. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +153 -0
  504. package/dist/_internal/engine/designer-element/runtime/designer-element-status.d.ts +19 -0
  505. package/dist/_internal/engine/designer-element/runtime/designer-element-surface-bindings.d.ts +3 -0
  506. package/dist/_internal/engine/host-tokens.css +136 -0
  507. package/dist/_internal/engine/index.d.ts +6 -0
  508. package/dist/_internal/engine/index.js +33263 -0
  509. package/dist/_internal/host-kit/dataset-port.d.ts +31 -0
  510. package/dist/_internal/host-kit/dataset-port.js +108 -0
  511. package/dist/_internal/host-kit/http.d.ts +53 -0
  512. package/dist/_internal/host-kit/http.js +75 -0
  513. package/dist/_internal/host-kit/index.d.ts +5 -0
  514. package/dist/_internal/host-kit/index.js +4 -0
  515. package/dist/_internal/host-kit/operation.d.ts +30 -0
  516. package/dist/_internal/host-kit/operation.js +63 -0
  517. package/dist/_internal/host-kit/project-adapter.d.ts +27 -0
  518. package/dist/_internal/host-kit/project-adapter.js +100 -0
  519. package/dist/_internal/material/auto-register.d.ts +2 -0
  520. package/dist/_internal/material/auto-register.js +23 -0
  521. package/dist/_internal/material/base-material-BArgjOeL.js +73 -0
  522. package/dist/_internal/material/base-material.d.ts +52 -0
  523. package/dist/_internal/material/chart.d.ts +15 -0
  524. package/dist/_internal/material/chart.js +293 -0
  525. package/dist/_internal/material/container.d.ts +10 -0
  526. package/dist/_internal/material/container.js +102 -0
  527. package/dist/_internal/material/image.d.ts +11 -0
  528. package/dist/_internal/material/image.js +123 -0
  529. package/dist/_internal/material/index.d.ts +9 -0
  530. package/dist/_internal/material/index.js +9 -0
  531. package/dist/_internal/material/rule.d.ts +17 -0
  532. package/dist/_internal/material/rule.js +115 -0
  533. package/dist/_internal/material/shapes.d.ts +19 -0
  534. package/dist/_internal/material/shapes.js +174 -0
  535. package/dist/_internal/material/table.d.ts +15 -0
  536. package/dist/_internal/material/table.js +307 -0
  537. package/dist/_internal/material/text.d.ts +18 -0
  538. package/dist/_internal/material/text.js +257 -0
  539. package/dist/_internal/plugin-core/catalog-diff.d.ts +19 -0
  540. package/dist/_internal/plugin-core/catalog-diff.js +48 -0
  541. package/dist/_internal/plugin-core/catalog.d.ts +6 -0
  542. package/dist/_internal/plugin-core/catalog.js +158 -0
  543. package/dist/_internal/plugin-core/contracts.d.ts +434 -0
  544. package/dist/_internal/plugin-core/contracts.js +11 -0
  545. package/dist/_internal/plugin-core/contribution-kind.d.ts +82 -0
  546. package/dist/_internal/plugin-core/contribution-kind.js +329 -0
  547. package/dist/_internal/plugin-core/data-capabilities.d.ts +21 -0
  548. package/dist/_internal/plugin-core/data-capabilities.js +36 -0
  549. package/dist/_internal/plugin-core/data-contracts.d.ts +31 -0
  550. package/dist/_internal/plugin-core/data-contracts.js +135 -0
  551. package/dist/_internal/plugin-core/diagnostics.d.ts +10 -0
  552. package/dist/_internal/plugin-core/diagnostics.js +38 -0
  553. package/dist/_internal/plugin-core/editor/editor-descriptor-conditions.d.ts +3 -0
  554. package/dist/_internal/plugin-core/editor/editor-descriptor-conditions.js +46 -0
  555. package/dist/_internal/plugin-core/editor/editor-descriptor-events.d.ts +3 -0
  556. package/dist/_internal/plugin-core/editor/editor-descriptor-events.js +111 -0
  557. package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +11 -0
  558. package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +94 -0
  559. package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +86 -0
  560. package/dist/_internal/plugin-core/editor/editor-descriptor-model.js +84 -0
  561. package/dist/_internal/plugin-core/editor/editor-descriptor-schema.d.ts +10 -0
  562. package/dist/_internal/plugin-core/editor/editor-descriptor-schema.js +125 -0
  563. package/dist/_internal/plugin-core/editor/editor-descriptor-sections.d.ts +6 -0
  564. package/dist/_internal/plugin-core/editor/editor-descriptor-sections.js +150 -0
  565. package/dist/_internal/plugin-core/editor/editor-descriptor-validation-utils.d.ts +10 -0
  566. package/dist/_internal/plugin-core/editor/editor-descriptor-validation-utils.js +56 -0
  567. package/dist/_internal/plugin-core/editor/editor-descriptor.d.ts +9 -0
  568. package/dist/_internal/plugin-core/editor/editor-descriptor.js +42 -0
  569. package/dist/_internal/plugin-core/index.d.ts +15 -0
  570. package/dist/_internal/plugin-core/index.js +11 -0
  571. package/dist/_internal/plugin-core/material/material-identity.d.ts +5 -0
  572. package/dist/_internal/plugin-core/material/material-identity.js +36 -0
  573. package/dist/_internal/plugin-core/material/material-manifest-fields.d.ts +6 -0
  574. package/dist/_internal/plugin-core/material/material-manifest-fields.js +143 -0
  575. package/dist/_internal/plugin-core/material/material-manifest.d.ts +4 -0
  576. package/dist/_internal/plugin-core/material/material-manifest.js +62 -0
  577. package/dist/_internal/plugin-core/material/material-panel.d.ts +6 -0
  578. package/dist/_internal/plugin-core/material/material-panel.js +54 -0
  579. package/dist/_internal/plugin-core/material/material-schema.d.ts +8 -0
  580. package/dist/_internal/plugin-core/material/material-schema.js +130 -0
  581. package/dist/_internal/plugin-core/material/material-static-data.d.ts +4 -0
  582. package/dist/_internal/plugin-core/material/material-static-data.js +90 -0
  583. package/dist/_internal/plugin-core/material/material-validation-constants.d.ts +9 -0
  584. package/dist/_internal/plugin-core/material/material-validation-constants.js +41 -0
  585. package/dist/_internal/plugin-core/material/material-validation-utils.d.ts +20 -0
  586. package/dist/_internal/plugin-core/material/material-validation-utils.js +138 -0
  587. package/dist/_internal/plugin-core/material/material.d.ts +5 -0
  588. package/dist/_internal/plugin-core/material/material.js +5 -0
  589. package/dist/_internal/plugin-core/plugin.d.ts +6 -0
  590. package/dist/_internal/plugin-core/plugin.js +218 -0
  591. package/dist/_internal/plugin-manager/contribution-command-port.d.ts +4 -0
  592. package/dist/_internal/plugin-manager/contribution-command-port.js +8 -0
  593. package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +43 -0
  594. package/dist/_internal/plugin-manager/contribution-kind-plan.js +62 -0
  595. package/dist/_internal/plugin-manager/contributions.d.ts +3 -0
  596. package/dist/_internal/plugin-manager/contributions.js +43 -0
  597. package/dist/_internal/plugin-manager/diagnostics.d.ts +11 -0
  598. package/dist/_internal/plugin-manager/diagnostics.js +37 -0
  599. package/dist/_internal/plugin-manager/index.d.ts +4 -0
  600. package/dist/_internal/plugin-manager/index.js +3 -0
  601. package/dist/_internal/plugin-manager/input.d.ts +5 -0
  602. package/dist/_internal/plugin-manager/input.js +172 -0
  603. package/dist/_internal/plugin-manager/manager.d.ts +3 -0
  604. package/dist/_internal/plugin-manager/manager.js +574 -0
  605. package/dist/_internal/plugin-manager/preflight-types.d.ts +30 -0
  606. package/dist/_internal/plugin-manager/preflight-types.js +1 -0
  607. package/dist/_internal/plugin-manager/preflight.d.ts +39 -0
  608. package/dist/_internal/plugin-manager/preflight.js +241 -0
  609. package/dist/_internal/plugin-manager/registry.d.ts +7 -0
  610. package/dist/_internal/plugin-manager/registry.js +195 -0
  611. package/dist/_internal/plugin-manager/remote-sandbox.d.ts +19 -0
  612. package/dist/_internal/plugin-manager/remote-sandbox.js +204 -0
  613. package/dist/_internal/plugin-manager/resolver.d.ts +22 -0
  614. package/dist/_internal/plugin-manager/resolver.js +161 -0
  615. package/dist/_internal/plugin-manager/session.d.ts +3 -0
  616. package/dist/_internal/plugin-manager/session.js +67 -0
  617. package/dist/_internal/plugin-manager/types.d.ts +66 -0
  618. package/dist/_internal/plugin-manager/types.js +1 -0
  619. package/dist/_internal/plugin-sdk/diagnostics.d.ts +5 -0
  620. package/dist/_internal/plugin-sdk/diagnostics.js +14 -0
  621. package/dist/_internal/plugin-sdk/index.d.ts +9 -0
  622. package/dist/_internal/plugin-sdk/index.js +9 -0
  623. package/dist/_internal/plugin-sdk/material-definition.d.ts +22 -0
  624. package/dist/_internal/plugin-sdk/material-definition.js +86 -0
  625. package/dist/_internal/plugin-sdk/material-loading-container.d.ts +22 -0
  626. package/dist/_internal/plugin-sdk/material-loading-container.js +63 -0
  627. package/dist/_internal/plugin-sdk/material-loading.d.ts +19 -0
  628. package/dist/_internal/plugin-sdk/material-loading.js +68 -0
  629. package/dist/_internal/plugin-sdk/material-package.d.ts +20 -0
  630. package/dist/_internal/plugin-sdk/material-package.js +131 -0
  631. package/dist/_internal/plugin-sdk/material-state-view.d.ts +32 -0
  632. package/dist/_internal/plugin-sdk/material-state-view.js +57 -0
  633. package/dist/_internal/plugin-sdk/plugin-definition.d.ts +4 -0
  634. package/dist/_internal/plugin-sdk/plugin-definition.js +56 -0
  635. package/dist/_internal/plugin-sdk/plugin-package.d.ts +19 -0
  636. package/dist/_internal/plugin-sdk/plugin-package.js +80 -0
  637. package/dist/_internal/plugin-sdk/plugin-registration.d.ts +39 -0
  638. package/dist/_internal/plugin-sdk/plugin-registration.js +270 -0
  639. package/dist/_internal/react/components.d.ts +32 -0
  640. package/dist/_internal/react/index.d.ts +14 -0
  641. package/dist/_internal/react/index.js +215 -0
  642. package/dist/_internal/renderer/blueprint-visibility.d.ts +17 -0
  643. package/dist/_internal/renderer/canonical-json.d.ts +15 -0
  644. package/dist/_internal/renderer/canvas-background.d.ts +3 -0
  645. package/dist/_internal/renderer/index.d.ts +3 -0
  646. package/dist/_internal/renderer/index.js +2173 -0
  647. package/dist/_internal/renderer/renderer/renderer-candidates.d.ts +43 -0
  648. package/dist/_internal/renderer/renderer/renderer-data-source.d.ts +21 -0
  649. package/dist/_internal/renderer/renderer/renderer-diagnostics.d.ts +9 -0
  650. package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +11 -0
  651. package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +16 -0
  652. package/dist/_internal/renderer/renderer/renderer-mounted-material.d.ts +23 -0
  653. package/dist/_internal/renderer/renderer/renderer-state.d.ts +36 -0
  654. package/dist/_internal/renderer/renderer/renderer-types.d.ts +56 -0
  655. package/dist/_internal/renderer/renderer/renderer.d.ts +108 -0
  656. package/dist/_internal/renderer/resource/data-source-runtime.d.ts +122 -0
  657. package/dist/_internal/renderer/resource/request-coordinator.d.ts +44 -0
  658. package/dist/_internal/renderer/resource/resource-state.d.ts +21 -0
  659. package/dist/_internal/renderer/resource/source-query-port.d.ts +42 -0
  660. package/dist/_internal/renderer/style-rules.d.ts +9 -0
  661. package/dist/_internal/renderer/viewer/viewer-blueprint-runtime.d.ts +5 -0
  662. package/dist/_internal/renderer/viewer/viewer-configuration-guards.d.ts +8 -0
  663. package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +31 -0
  664. package/dist/_internal/renderer/viewer/viewer-data-source-scheduler.d.ts +25 -0
  665. package/dist/_internal/renderer/viewer/viewer-lifecycle.d.ts +3 -0
  666. package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +48 -0
  667. package/dist/_internal/renderer/viewer/viewer-variable-handles.d.ts +44 -0
  668. package/dist/_internal/renderer/viewer/viewer.d.ts +62 -0
  669. package/dist/_internal/sdk/auto-register.d.ts +2 -0
  670. package/dist/_internal/sdk/auto-register.js +11 -0
  671. package/dist/_internal/sdk/contracts.d.ts +2 -0
  672. package/dist/_internal/sdk/contracts.js +1 -0
  673. package/dist/_internal/sdk/core.d.ts +2 -0
  674. package/dist/_internal/sdk/core.js +1 -0
  675. package/dist/_internal/sdk/definition-CCm2r5Uf.js +37 -0
  676. package/dist/_internal/sdk/definition.d.ts +3 -0
  677. package/dist/_internal/sdk/designer-auto-register.d.ts +2 -0
  678. package/dist/_internal/sdk/designer-auto-register.js +7 -0
  679. package/dist/_internal/sdk/designer.d.ts +5 -0
  680. package/dist/_internal/sdk/designer.js +11 -0
  681. package/dist/_internal/sdk/engine.d.ts +2 -0
  682. package/dist/_internal/sdk/engine.js +1 -0
  683. package/dist/_internal/sdk/host-tokens.css +136 -0
  684. package/dist/_internal/sdk/index.d.ts +13 -0
  685. package/dist/_internal/sdk/index.js +6 -0
  686. package/dist/_internal/sdk/material.d.ts +10 -0
  687. package/dist/_internal/sdk/material.js +13 -0
  688. package/dist/_internal/sdk/mount-controller.d.ts +34 -0
  689. package/dist/_internal/sdk/mount-handle.d.ts +21 -0
  690. package/dist/_internal/sdk/plugin-core.d.ts +2 -0
  691. package/dist/_internal/sdk/plugin-core.js +1 -0
  692. package/dist/_internal/sdk/plugins.d.ts +17 -0
  693. package/dist/_internal/sdk/plugins.js +33 -0
  694. package/dist/_internal/sdk/renderer.d.ts +2 -0
  695. package/dist/_internal/sdk/renderer.js +1 -0
  696. package/dist/_internal/sdk/runtime-adapter.d.ts +29 -0
  697. package/dist/_internal/sdk/runtime-diagnostics.d.ts +20 -0
  698. package/dist/_internal/sdk/runtime-lifecycle.d.ts +18 -0
  699. package/dist/_internal/sdk/runtime-mounts.d.ts +29 -0
  700. package/dist/_internal/sdk/runtime-registration.d.ts +24 -0
  701. package/dist/_internal/sdk/runtime.d.ts +62 -0
  702. package/dist/_internal/sdk/src-Bm7u11mN.js +394 -0
  703. package/dist/_internal/sdk/viewer-CrJupI8I.js +455 -0
  704. package/dist/_internal/sdk/viewer-auto-register.d.ts +2 -0
  705. package/dist/_internal/sdk/viewer-auto-register.js +7 -0
  706. package/dist/_internal/sdk/viewer-runtime.d.ts +8 -0
  707. package/dist/_internal/sdk/viewer.d.ts +7 -0
  708. package/dist/_internal/sdk/viewer.js +2 -0
  709. package/dist/_internal/vue/components.d.ts +36 -0
  710. package/dist/_internal/vue/global-styles.d.ts +10 -0
  711. package/dist/_internal/vue/index.d.ts +14 -0
  712. package/dist/_internal/vue/index.js +290 -0
  713. package/dist/auto-register.d.ts +1 -0
  714. package/dist/auto-register.js +14 -0
  715. package/dist/auto-register.js.map +1 -0
  716. package/dist/catalog-BHp6jn2A.js +127 -0
  717. package/dist/catalog-BHp6jn2A.js.map +1 -0
  718. package/dist/contracts.d.ts +1 -0
  719. package/dist/contracts.js +103 -0
  720. package/dist/contracts.js.map +1 -0
  721. package/dist/contrast-B4TH-dvm.js +1050 -0
  722. package/dist/contrast-B4TH-dvm.js.map +1 -0
  723. package/dist/core.d.ts +1 -0
  724. package/dist/core.js +52 -0
  725. package/dist/core.js.map +1 -0
  726. package/dist/data-capabilities-V1eEBn7W.js +50 -0
  727. package/dist/data-capabilities-V1eEBn7W.js.map +1 -0
  728. package/dist/data-contracts-BFld0hw_.js +136 -0
  729. package/dist/data-contracts-BFld0hw_.js.map +1 -0
  730. package/dist/dataset-port-CUsMmX2x.js +65 -0
  731. package/dist/dataset-port-CUsMmX2x.js.map +1 -0
  732. package/dist/definition-CCm2r5Uf-Csc7NVq3.js +37 -0
  733. package/dist/definition-CCm2r5Uf-Csc7NVq3.js.map +1 -0
  734. package/dist/definition-DlTP-401.js +145 -0
  735. package/dist/definition-DlTP-401.js.map +1 -0
  736. package/dist/designer-auto-register.d.ts +1 -0
  737. package/dist/designer-auto-register.js +8 -0
  738. package/dist/designer-auto-register.js.map +1 -0
  739. package/dist/designer-xtN0h7PL.js +11 -0
  740. package/dist/designer-xtN0h7PL.js.map +1 -0
  741. package/dist/designer.d.ts +1 -0
  742. package/dist/designer.js +3 -0
  743. package/dist/dist-CAdGDmU3.js +2135 -0
  744. package/dist/dist-CAdGDmU3.js.map +1 -0
  745. package/dist/dist-CR13A2Yb.js +32734 -0
  746. package/dist/dist-CR13A2Yb.js.map +1 -0
  747. package/dist/engine.d.ts +1 -0
  748. package/dist/engine.js +2 -0
  749. package/dist/equality-DjZ9cv4u.js +12 -0
  750. package/dist/equality-DjZ9cv4u.js.map +1 -0
  751. package/dist/host-kit.d.ts +1 -0
  752. package/dist/host-kit.js +302 -0
  753. package/dist/host-kit.js.map +1 -0
  754. package/dist/host-tokens.css +136 -0
  755. package/dist/image-url-D6mUcjY1.js +337 -0
  756. package/dist/image-url-D6mUcjY1.js.map +1 -0
  757. package/dist/index.d.ts +1 -0
  758. package/dist/index.js +9 -0
  759. package/dist/manager-Bhqi_KmD.js +1157 -0
  760. package/dist/manager-Bhqi_KmD.js.map +1 -0
  761. package/dist/material-2XmHe-aH.js +1417 -0
  762. package/dist/material-2XmHe-aH.js.map +1 -0
  763. package/dist/material-definition-BJ4ujhuj.js +103 -0
  764. package/dist/material-definition-BJ4ujhuj.js.map +1 -0
  765. package/dist/material-loading-container-Cwgnfd9E.js +39 -0
  766. package/dist/material-loading-container-Cwgnfd9E.js.map +1 -0
  767. package/dist/material-manifest-LdgIkzgH.js +690 -0
  768. package/dist/material-manifest-LdgIkzgH.js.map +1 -0
  769. package/dist/material-schema-CtxTkCP2.js +267 -0
  770. package/dist/material-schema-CtxTkCP2.js.map +1 -0
  771. package/dist/material-state-view-Bw7xIkEg.js +54 -0
  772. package/dist/material-state-view-Bw7xIkEg.js.map +1 -0
  773. package/dist/material.d.ts +1 -0
  774. package/dist/material.js +4 -0
  775. package/dist/migrate-document-BJUN7NPv.js +436 -0
  776. package/dist/migrate-document-BJUN7NPv.js.map +1 -0
  777. package/dist/parse-B5b0hjql.js +149 -0
  778. package/dist/parse-B5b0hjql.js.map +1 -0
  779. package/dist/parse-BQw3u9_4.js +1126 -0
  780. package/dist/parse-BQw3u9_4.js.map +1 -0
  781. package/dist/parse-CYwxTDJU.js +364 -0
  782. package/dist/parse-CYwxTDJU.js.map +1 -0
  783. package/dist/plugin-B9Xxtw7G.js +428 -0
  784. package/dist/plugin-B9Xxtw7G.js.map +1 -0
  785. package/dist/plugin-core.d.ts +1 -0
  786. package/dist/plugin-core.js +7 -0
  787. package/dist/plugin-manager.d.ts +1 -0
  788. package/dist/plugin-manager.js +2 -0
  789. package/dist/plugin-package-BfZLl3ru.js +174 -0
  790. package/dist/plugin-package-BfZLl3ru.js.map +1 -0
  791. package/dist/plugin-registration-CYtTqIxF.js +215 -0
  792. package/dist/plugin-registration-CYtTqIxF.js.map +1 -0
  793. package/dist/plugin-sdk.d.ts +1 -0
  794. package/dist/plugin-sdk.js +6 -0
  795. package/dist/plugins-DRaykV9c.js +31 -0
  796. package/dist/plugins-DRaykV9c.js.map +1 -0
  797. package/dist/plugins.d.ts +1 -0
  798. package/dist/plugins.js +8 -0
  799. package/dist/react.d.ts +1 -0
  800. package/dist/react.js +213 -0
  801. package/dist/react.js.map +1 -0
  802. package/dist/read-data-value-WmMKWshv.js +129 -0
  803. package/dist/read-data-value-WmMKWshv.js.map +1 -0
  804. package/dist/renderer.d.ts +1 -0
  805. package/dist/renderer.js +2 -0
  806. package/dist/schema-C38FI_z2.js +541 -0
  807. package/dist/schema-C38FI_z2.js.map +1 -0
  808. package/dist/src-Bm7u11mN-BPS5TRsq.js +386 -0
  809. package/dist/src-Bm7u11mN-BPS5TRsq.js.map +1 -0
  810. package/dist/value-ref-Z0o70Vy6.js +716 -0
  811. package/dist/value-ref-Z0o70Vy6.js.map +1 -0
  812. package/dist/viewer-CrJupI8I-D2BtwLsA.js +444 -0
  813. package/dist/viewer-CrJupI8I-D2BtwLsA.js.map +1 -0
  814. package/dist/viewer-auto-register.d.ts +1 -0
  815. package/dist/viewer-auto-register.js +8 -0
  816. package/dist/viewer-auto-register.js.map +1 -0
  817. package/dist/viewer.d.ts +1 -0
  818. package/dist/viewer.js +3 -0
  819. package/dist/vue.d.ts +1 -0
  820. package/dist/vue.js +288 -0
  821. package/dist/vue.js.map +1 -0
  822. package/package.json +139 -3
@@ -0,0 +1,2135 @@
1
+ import { i as e, m as t } from "./image-url-D6mUcjY1.js";
2
+ import { t as n } from "./parse-B5b0hjql.js";
3
+ import { n as r, t as i } from "./definition-DlTP-401.js";
4
+ import { a, t as o } from "./dataset-port-CUsMmX2x.js";
5
+ import { T as s } from "./schema-C38FI_z2.js";
6
+ import { n as c, o as l } from "./parse-BQw3u9_4.js";
7
+ import { a as u, i as d, n as f, r as p } from "./read-data-value-WmMKWshv.js";
8
+ import { t as m } from "./equality-DjZ9cv4u.js";
9
+ import { S as h, a as g, r as _, t as v, v as y, w as b } from "./value-ref-Z0o70Vy6.js";
10
+ import { n as ee, t as te } from "./data-capabilities-V1eEBn7W.js";
11
+ import { a as ne, n as x, r as S } from "./material-schema-CtxTkCP2.js";
12
+ //#region ../renderer/dist/index.js
13
+ function re(e, t) {
14
+ let n = t.background;
15
+ e.style.backgroundColor = n?.type === "solid" ? n.color : t.backgroundColor;
16
+ let r = [], i = [];
17
+ t.backgroundImage !== void 0 && (r.push(`url("${ae(t.backgroundImage)}")`), i.push(t.backgroundImageFit === "contain" ? "contain" : "cover"));
18
+ let a = n === void 0 ? void 0 : ie(n);
19
+ if (a !== void 0 && (r.push(a), i.push("100% 100%")), r.length === 0) {
20
+ e.style.backgroundImage = "", e.style.backgroundSize = "", e.style.backgroundPosition = "", e.style.backgroundRepeat = "";
21
+ return;
22
+ }
23
+ e.style.backgroundImage = r.join(", "), e.style.backgroundSize = i.join(", "), e.style.backgroundPosition = r.map(() => "center").join(", "), e.style.backgroundRepeat = r.map(() => "no-repeat").join(", ");
24
+ }
25
+ function ie(e) {
26
+ if (e.type === "solid") return;
27
+ let t = e.stops.map((e) => `${e.color} ${e.position}%`).join(", ");
28
+ return e.type === "linear-gradient" ? `linear-gradient(${e.angle}deg, ${t})` : `radial-gradient(circle at ${e.position.x}% ${e.position.y}%, ${t})`;
29
+ }
30
+ function ae(e) {
31
+ return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
32
+ }
33
+ function C(e) {
34
+ if (e === null) return "null";
35
+ if (typeof e == "boolean") return e ? "true" : "false";
36
+ if (typeof e == "number" || typeof e == "string") return JSON.stringify(e);
37
+ if (Array.isArray(e)) return `[${e.map((e) => C(e)).join(",")}]`;
38
+ let t = e;
39
+ return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${C(t[e])}`).join(",")}}`;
40
+ }
41
+ function oe() {
42
+ return {
43
+ projectionKey: void 0,
44
+ dataState: { status: "idle" }
45
+ };
46
+ }
47
+ function se(e) {
48
+ return C(e);
49
+ }
50
+ function w(e, t) {
51
+ return e.map((e) => ({
52
+ ...e,
53
+ path: [...t, ...e.path]
54
+ }));
55
+ }
56
+ function T(e, t, n) {
57
+ return {
58
+ severity: "error",
59
+ code: e,
60
+ path: t,
61
+ message: n
62
+ };
63
+ }
64
+ function E(e, t, n) {
65
+ return {
66
+ ok: !1,
67
+ diagnostics: [T(e, t, n)]
68
+ };
69
+ }
70
+ function D(e, t) {
71
+ return {
72
+ severity: "error",
73
+ code: "PLUGIN_CORE_RENDER_FAILED",
74
+ path: ["components", e.component.id],
75
+ message: t
76
+ };
77
+ }
78
+ function O(e) {
79
+ return t(e);
80
+ }
81
+ function ce(e, t, r, i, a) {
82
+ if (r === null) return {
83
+ status: "ready",
84
+ value: t
85
+ };
86
+ let o = n(t);
87
+ return o.ok ? A(e, o.value, r, i, a, {
88
+ bindingCode: "Host dataset binding is invalid.",
89
+ adapterCode: "Host dataset adapter failed."
90
+ }) : {
91
+ status: "error",
92
+ code: "HOST_DATASET_INVALID",
93
+ message: "Host dataset is invalid."
94
+ };
95
+ }
96
+ function k(e, t, r) {
97
+ if (e.manifest.staticData?.kind !== "tabular") return {
98
+ status: "ready",
99
+ value: t
100
+ };
101
+ let i = n(t);
102
+ return i.ok ? r === null ? {
103
+ status: "error",
104
+ code: "HOST_DATASET_BINDING_INVALID",
105
+ message: "Static dataset binding is invalid."
106
+ } : A(e, i.value, r, void 0, void 0, {
107
+ bindingCode: "Static dataset binding is invalid.",
108
+ adapterCode: "Static dataset adapter failed."
109
+ }) : {
110
+ status: "error",
111
+ code: "HOST_DATASET_INVALID",
112
+ message: "Static dataset is invalid."
113
+ };
114
+ }
115
+ function A(t, n, r, i, a, o) {
116
+ let s = t.manifest.dataBinding, c = t.tabularDataAdapter;
117
+ if (s === void 0 || c === void 0) return {
118
+ status: "error",
119
+ code: "HOST_DATASET_BINDING_INVALID",
120
+ message: o.bindingCode
121
+ };
122
+ let l = g(r, n.fields, s.roles);
123
+ if (!l.ok) return {
124
+ status: "error",
125
+ code: "HOST_DATASET_BINDING_INVALID",
126
+ message: o.bindingCode
127
+ };
128
+ try {
129
+ let t = c.adapt({
130
+ dataset: n,
131
+ fields: l.value.fields
132
+ });
133
+ if (!t.ok) return {
134
+ status: "error",
135
+ code: "HOST_DATASET_ADAPTER_FAILED",
136
+ message: o.adapterCode
137
+ };
138
+ let r = e(t.value, { maxBytes: 1048576 });
139
+ return r.ok ? {
140
+ status: "ready",
141
+ value: r.value
142
+ } : {
143
+ status: "error",
144
+ code: "HOST_DATASET_ADAPTER_FAILED",
145
+ message: o.adapterCode
146
+ };
147
+ } catch {
148
+ return i !== void 0 && a?.(T("PLUGIN_CORE_RENDER_FAILED", [
149
+ "components",
150
+ i,
151
+ "dataBinding"
152
+ ], "Material dataset adapter raised an exception.")), {
153
+ status: "error",
154
+ code: "HOST_DATASET_ADAPTER_FAILED",
155
+ message: o.adapterCode
156
+ };
157
+ }
158
+ }
159
+ function j(e, t, n, r, i, a, o, s = "fail") {
160
+ let c = [], l = [], u = /* @__PURE__ */ new Map();
161
+ for (let s = 0; s < e.components.length; s++) {
162
+ let d = e.components[s], f = t.get(d.type);
163
+ if (f === void 0) {
164
+ l.push(T("PLUGIN_CORE_IDENTITY_INVALID", [
165
+ "components",
166
+ s,
167
+ "type"
168
+ ], "Component material is not enabled in this catalog."));
169
+ continue;
170
+ }
171
+ let p = o.entries.get(d), m, h;
172
+ if (p !== void 0 && p.entry === f) m = p.props, h = p.style, u.set(d, p);
173
+ else {
174
+ let e = x(d.props, f.manifest.propsSchema);
175
+ if (!e.ok) {
176
+ l.push(...w(e.diagnostics, [
177
+ "components",
178
+ s,
179
+ "props"
180
+ ]));
181
+ continue;
182
+ }
183
+ let t = S(d.style, f.manifest.styleSchema);
184
+ if (!t.ok) {
185
+ l.push(...w(t.diagnostics, [
186
+ "components",
187
+ s,
188
+ "style"
189
+ ]));
190
+ continue;
191
+ }
192
+ let n = d.styleRules ?? [], r = !0;
193
+ for (let e = 0; e < n.length; e++) {
194
+ let i = S({
195
+ ...t.value,
196
+ ...n[e].style
197
+ }, f.manifest.styleSchema);
198
+ if (!i.ok) {
199
+ l.push(...w(i.diagnostics, [
200
+ "components",
201
+ s,
202
+ "styleRules",
203
+ e,
204
+ "style"
205
+ ])), r = !1;
206
+ break;
207
+ }
208
+ }
209
+ if (!r) continue;
210
+ m = e.value, h = t.value, u.set(d, {
211
+ entry: f,
212
+ props: m,
213
+ style: h
214
+ });
215
+ }
216
+ let g = M(a, d, f, i, ["components", s]);
217
+ if ("diagnostic" in g) {
218
+ l.push(g.diagnostic);
219
+ continue;
220
+ }
221
+ c.push({
222
+ component: d,
223
+ entry: f,
224
+ model: {
225
+ componentId: d.id,
226
+ mode: n,
227
+ interactive: r,
228
+ props: m,
229
+ style: h,
230
+ size: {
231
+ width: d.size.width,
232
+ height: d.size.height
233
+ },
234
+ dataState: g.dataState
235
+ },
236
+ dataSource: g.dataSource,
237
+ dataEpoch: g.epoch
238
+ });
239
+ }
240
+ if (o.entries = u, l.length === 0) return {
241
+ ok: !0,
242
+ value: c,
243
+ diagnostics: []
244
+ };
245
+ let d = O(l);
246
+ return s === "skip" ? {
247
+ ok: !0,
248
+ value: c,
249
+ diagnostics: d
250
+ } : {
251
+ ok: !1,
252
+ diagnostics: d
253
+ };
254
+ }
255
+ function M(e, t, n, r, i, a) {
256
+ let o = p(t), s = f(t);
257
+ if (o === null) return s !== null || n.manifest.defaultData === void 0 ? {
258
+ dataState: { status: "idle" },
259
+ dataSource: void 0,
260
+ epoch: void 0
261
+ } : {
262
+ dataState: k(n, n.manifest.defaultData, n.manifest.staticData?.kind === "tabular" ? n.manifest.staticData.defaultBinding : null),
263
+ dataSource: void 0,
264
+ epoch: void 0
265
+ };
266
+ let c = o.kind === "data-source-field" ? e.read(o.dataSourceId) : void 0, l = c?.source;
267
+ if (!te(n.manifest.dataCapabilities, o, l)) return { diagnostic: T("PLUGIN_CORE_MANIFEST_FIELD_INVALID", [...i, "dataValue"], "Material does not accept the configured data source.") };
268
+ if (o.kind !== "data-source-field") return {
269
+ dataState: N(e.evaluate(o), n, s),
270
+ dataSource: void 0,
271
+ epoch: e.variablesKey
272
+ };
273
+ if (l === void 0 || c === void 0) return {
274
+ dataState: {
275
+ status: "error",
276
+ code: "HOST_RESOURCE_UNAVAILABLE",
277
+ message: "Host data source is unavailable."
278
+ },
279
+ dataSource: void 0,
280
+ epoch: void 0
281
+ };
282
+ let u = le(l.kind === "host-resource" ? l.resourceType : void 0, r, i);
283
+ if (u !== void 0) return { diagnostic: u };
284
+ let d = {
285
+ dataSourceId: o.dataSourceId,
286
+ projectionKey: se(s)
287
+ };
288
+ if (s !== null && (n.manifest.dataBinding === void 0 || n.tabularDataAdapter === void 0)) return {
289
+ dataState: {
290
+ status: "error",
291
+ code: "HOST_DATASET_BINDING_INVALID",
292
+ message: "Host dataset binding is invalid."
293
+ },
294
+ dataSource: d,
295
+ epoch: c.dataState
296
+ };
297
+ if (c.dataState.status === "error") return {
298
+ dataState: c.dataState,
299
+ dataSource: d,
300
+ epoch: c.dataState
301
+ };
302
+ let m = e.evaluate(o);
303
+ return c.dataState.status === "ready" && m.kind === "value" ? m.value === void 0 ? {
304
+ dataState: { status: "idle" },
305
+ dataSource: d,
306
+ epoch: c.dataState
307
+ } : {
308
+ dataState: ce(n, m.value, s, t.id, a),
309
+ dataSource: d,
310
+ epoch: c.dataState
311
+ } : {
312
+ dataState: N(m, n, s),
313
+ dataSource: d,
314
+ epoch: c.dataState
315
+ };
316
+ }
317
+ function N(e, t, n) {
318
+ switch (e.kind) {
319
+ case "pending": return { status: "loading" };
320
+ case "failed": return e.reason === "variable-missing" ? {
321
+ status: "error",
322
+ code: "HOST_DATASET_INVALID",
323
+ message: "Variable data is unavailable."
324
+ } : e.reason === "value-invalid" ? {
325
+ status: "error",
326
+ code: "HOST_RESOURCE_INVALID",
327
+ message: "Host resource returned an invalid value."
328
+ } : {
329
+ status: "error",
330
+ code: "HOST_RESOURCE_FAILED",
331
+ message: "Host resource request failed."
332
+ };
333
+ default: return e.value === void 0 ? { status: "idle" } : k(t, e.value, n);
334
+ }
335
+ }
336
+ function le(e, t, n) {
337
+ if (e !== void 0 && t !== void 0 && t.getResourceType(e) === void 0) return T("PLUGIN_CORE_CONTRIBUTION_UNKNOWN", [
338
+ ...n,
339
+ "dataSource",
340
+ "resourceType"
341
+ ], "Host resource type is not enabled by an active plugin contribution.");
342
+ }
343
+ function ue(e, t) {
344
+ if (e === void 0 || e.length === 0 || t.status !== "ready") return;
345
+ let n;
346
+ for (let r of e) de(r, t.value) && (n = {
347
+ ...n ?? {},
348
+ ...r.style
349
+ });
350
+ return n;
351
+ }
352
+ function de(e, t) {
353
+ let n = fe(t, e.when.path);
354
+ if (e.when.operator === "exists") return n.ok;
355
+ if (!n.ok) return !1;
356
+ let r = n.value, i = e.when.value;
357
+ switch (e.when.operator) {
358
+ case "eq": return m(r, i);
359
+ case "neq": return !m(r, i);
360
+ case "gt":
361
+ case "gte":
362
+ case "lt":
363
+ case "lte": return !P(r) || !P(i) ? !1 : e.when.operator === "gt" ? r > i : e.when.operator === "gte" ? r >= i : e.when.operator === "lt" ? r < i : r <= i;
364
+ case "contains": return typeof r == "string" ? typeof i == "string" && r.includes(i) : Array.isArray(r) && r.some((e) => m(e, i));
365
+ default: return !1;
366
+ }
367
+ }
368
+ function fe(e, t) {
369
+ let n = e;
370
+ for (let e of t) {
371
+ if (typeof n != "object" || !n) return { ok: !1 };
372
+ if (Array.isArray(n)) {
373
+ if (!/^\d+$/.test(e)) return { ok: !1 };
374
+ let t = Number(e);
375
+ if (!Number.isSafeInteger(t) || t >= n.length) return { ok: !1 };
376
+ n = n[t];
377
+ continue;
378
+ }
379
+ if (!Object.prototype.hasOwnProperty.call(n, e)) return { ok: !1 };
380
+ n = n[e];
381
+ }
382
+ return {
383
+ ok: !0,
384
+ value: n
385
+ };
386
+ }
387
+ function P(e) {
388
+ return typeof e == "number" && Number.isFinite(e);
389
+ }
390
+ function F(e, t, n) {
391
+ let r = ue(t.component.styleRules, n), i = r === void 0 ? t.model.style : {
392
+ ...t.model.style,
393
+ ...r
394
+ }, a = e.options.conditionalStylePort;
395
+ if (a !== void 0) {
396
+ let r = pe(e, a, t.component.id, n);
397
+ if (r !== void 0) {
398
+ let n = S({
399
+ ...i,
400
+ ...r
401
+ }, t.entry.manifest.styleSchema);
402
+ if (n.ok) i = n.value;
403
+ else for (let r of w(n.diagnostics, [
404
+ "components",
405
+ t.component.id,
406
+ "conditionalStyle"
407
+ ])) e.options.onDiagnostic?.(r);
408
+ }
409
+ }
410
+ return {
411
+ ...t.model,
412
+ dataState: n,
413
+ style: i
414
+ };
415
+ }
416
+ function pe(e, t, n, r) {
417
+ try {
418
+ return t.resolve({
419
+ componentId: n,
420
+ dataState: r
421
+ });
422
+ } catch {
423
+ e.options.onDiagnostic?.(T("PLUGIN_CORE_RENDER_FAILED", [
424
+ "components",
425
+ n,
426
+ "conditionalStyle"
427
+ ], "Conditional style port resolve raised an exception."));
428
+ return;
429
+ }
430
+ }
431
+ function I(e, t, n, r, i) {
432
+ L(e, t, n, i), e.model = n, R(e, r);
433
+ }
434
+ function L(e, t, n, r) {
435
+ let i = t.position, a = e.style;
436
+ a.position !== "absolute" && (a.position = "absolute");
437
+ let o = `${i.x}px`;
438
+ a.left !== o && (a.left = o);
439
+ let s = `${i.y}px`;
440
+ a.top !== s && (a.top = s);
441
+ let c = `${t.size.width}px`;
442
+ a.width !== "max-content" && a.width !== c && (a.width = c);
443
+ let l = `${t.size.height}px`;
444
+ a.height !== l && (a.height = l);
445
+ let u = String(r);
446
+ a.zIndex !== u && (a.zIndex = u), e.dataset.baseScreenComponentId !== t.id && (e.dataset.baseScreenComponentId = t.id), a.transformOrigin !== "center" && (a.transformOrigin = "center");
447
+ let d = `rotate(${t.rotation}deg)`, f = n.style.flipX === !0 ? -1 : 1, p = n.style.flipY === !0 ? -1 : 1, m = f === 1 && p === 1 ? d : `${d} scale(${f}, ${p})`;
448
+ a.transform !== m && (a.transform = m);
449
+ let h = typeof n.style.opacity == "number" && Number.isFinite(n.style.opacity) ? String(Math.min(1, Math.max(0, n.style.opacity))) : "";
450
+ a.opacity !== h && (a.opacity = h);
451
+ }
452
+ function R(e, t) {
453
+ let n = t ? "none" : "block";
454
+ e.style.display !== n && (e.style.display = n);
455
+ }
456
+ function z(e, t, n, r) {
457
+ n.stackOrder = r, n.projection.projectionKey = t.dataSource?.projectionKey, n.projection.dataState = t.model.dataState;
458
+ let i = V(e, t, r);
459
+ if (n.applied !== void 0 && n.appliedModel !== void 0 && me(n.applied, i)) {
460
+ L(n.element, t.component, n.appliedModel, r), R(n.element, e.visibility.isHidden(t.component.id));
461
+ return;
462
+ }
463
+ B(e, t, n, r);
464
+ }
465
+ function B(e, t, n, r) {
466
+ let i = F(e, t, t.model.dataState);
467
+ I(n.element, t.component, i, e.visibility.isHidden(t.component.id), r), n.applied = V(e, t, r), n.appliedModel = i;
468
+ }
469
+ function V(e, t, n) {
470
+ return {
471
+ component: t.component,
472
+ entry: t.entry,
473
+ interactive: t.model.interactive,
474
+ stackOrder: n,
475
+ hidden: e.visibility.isHidden(t.component.id),
476
+ dataEpoch: t.dataEpoch
477
+ };
478
+ }
479
+ function me(e, t) {
480
+ return e.component === t.component && e.entry === t.entry && e.interactive === t.interactive && e.stackOrder === t.stackOrder && e.hidden === t.hidden && e.dataEpoch === t.dataEpoch;
481
+ }
482
+ function he(e, t, n) {
483
+ let r = F(e, t, t.model.dataState);
484
+ n.element.model = r, n.appliedModel = r;
485
+ }
486
+ function ge(e, t, n) {
487
+ if (n.bubbles !== !0 || n.composed !== !0 || n.type !== "base-screen-material-event") return;
488
+ let r = e.candidates.get(t.component.id) ?? t;
489
+ if (r.model.interactive !== !0) return;
490
+ let i = ne(n.detail);
491
+ if (!(!i.ok || !r.entry.manifest.events.includes(i.value.name))) {
492
+ n.stopPropagation();
493
+ try {
494
+ e.options.onMaterialEvent?.({
495
+ componentId: r.component.id,
496
+ type: r.component.type,
497
+ name: i.value.name,
498
+ payload: i.value.payload
499
+ });
500
+ } catch {
501
+ e.options.onDiagnostic?.({
502
+ severity: "error",
503
+ code: "PLUGIN_CORE_RENDER_FAILED",
504
+ path: ["components", r.component.id],
505
+ message: "Host material event callback raised an exception."
506
+ });
507
+ }
508
+ }
509
+ }
510
+ var _e = class {
511
+ root;
512
+ #e = /* @__PURE__ */ new Map();
513
+ #t = /* @__PURE__ */ new Map();
514
+ #n = /* @__PURE__ */ new Map();
515
+ constructor(e) {
516
+ this.root = e;
517
+ }
518
+ prepare(e) {
519
+ this.#e = new Map(e.components.map((e) => [e.id, e]));
520
+ }
521
+ isHidden(e) {
522
+ let t = this.#e.get(e), n = /* @__PURE__ */ new Set();
523
+ for (; t !== void 0 && !n.has(t.id);) {
524
+ n.add(t.id);
525
+ let e = this.#t.get(t.id);
526
+ if (e === !1 || e === void 0 && t.status.hidden) return !0;
527
+ t = t.parentId === null ? void 0 : this.#e.get(t.parentId);
528
+ }
529
+ return !1;
530
+ }
531
+ apply(e, t, n) {
532
+ if (t === void 0 || e.length === 0) return {
533
+ ok: !0,
534
+ value: null,
535
+ diagnostics: []
536
+ };
537
+ this.prepare(t);
538
+ for (let t of e) {
539
+ let e = this.#e.get(t.componentId);
540
+ if (e === void 0) return {
541
+ ok: !1,
542
+ diagnostics: [{
543
+ severity: "error",
544
+ code: "DOCUMENT_FIELD_INVALID",
545
+ path: ["blueprint", "componentId"],
546
+ message: "Blueprint visibility target is missing."
547
+ }]
548
+ };
549
+ let r = /* @__PURE__ */ new Map();
550
+ for (let e of n.keys()) r.set(e, this.isHidden(e));
551
+ let i = this.#t.get(t.componentId) ?? !e.status.hidden, a = t.operation === "show" || t.operation !== "hide" && !i;
552
+ this.#t.set(t.componentId, a);
553
+ for (let [e, i] of n) {
554
+ let n = this.isHidden(e);
555
+ (r.get(e) ?? !1) !== n && this.animate(e, i.element, !n, t.transition);
556
+ }
557
+ }
558
+ return {
559
+ ok: !0,
560
+ value: null,
561
+ diagnostics: []
562
+ };
563
+ }
564
+ reset() {
565
+ for (let e of this.#n.values()) e.cancel();
566
+ this.#n.clear(), this.#t.clear();
567
+ }
568
+ animate(e, t, n, r) {
569
+ let i = this.#n.get(e), a = this.root.ownerDocument?.defaultView, o = a?.getComputedStyle(t), s = o?.opacity ?? (n ? "0" : "1"), c = o?.translate ?? "none";
570
+ i?.cancel(), this.#n.delete(e);
571
+ let l = a?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
572
+ if (r === void 0 || r.effect === "appear" || r.durationMs === 0 || l || typeof t.animate != "function") {
573
+ t.style.display = n ? "block" : "none";
574
+ return;
575
+ }
576
+ n && (t.style.display = "block");
577
+ let u = t.style.opacity.length > 0 ? t.style.opacity : "1", d = r.effect === "slide-up", f = n ? [{
578
+ opacity: s,
579
+ ...d ? { translate: c } : {}
580
+ }, {
581
+ opacity: u,
582
+ ...d ? { translate: "0 0" } : {}
583
+ }] : [{
584
+ opacity: s,
585
+ ...d ? { translate: c } : {}
586
+ }, {
587
+ opacity: "0",
588
+ ...d ? { translate: "0 12px" } : {}
589
+ }], p = t.animate(f, {
590
+ duration: r.durationMs,
591
+ easing: ve(r.easing),
592
+ fill: "none"
593
+ });
594
+ this.#n.set(e, p), p.finished.then(() => {
595
+ this.#n.get(e) === p && (this.#n.delete(e), t.style.display = n ? "block" : "none");
596
+ }).catch(() => void 0);
597
+ }
598
+ };
599
+ function ve(e) {
600
+ return e === "ease-in-out-quad" ? "cubic-bezier(0.455, 0.03, 0.515, 0.955)" : e === "ease-in-out-expo" ? "cubic-bezier(1, 0, 0, 1)" : "linear";
601
+ }
602
+ var ye = "#source-dataset", be = "#source-resource", xe = "#source";
603
+ function Se(e) {
604
+ return e.kind === "dataset" ? ye : e.kind === "host-resource" ? be : xe;
605
+ }
606
+ var Ce = class {
607
+ resources;
608
+ datasets;
609
+ hostCatalog;
610
+ #e = /* @__PURE__ */ new Map();
611
+ #t = 0;
612
+ constructor(e, t, n) {
613
+ this.resources = e, this.datasets = t, this.hostCatalog = n;
614
+ }
615
+ clear() {
616
+ this.#t++, this.#e.clear();
617
+ }
618
+ accepts(e) {
619
+ switch (e.kind) {
620
+ case "dataset": return this.datasets !== void 0;
621
+ case "host-resource": return this.resources !== void 0;
622
+ default: return this.hostCatalog !== void 0;
623
+ }
624
+ }
625
+ query(e, t) {
626
+ switch (e.source.kind) {
627
+ case "dataset": return this.queryDataset(e, e.source.datasetId, t);
628
+ case "host-resource": return this.resources?.resolve({
629
+ dataSourceId: e.dataSourceId,
630
+ resourceType: e.source.resourceType,
631
+ resourceId: e.source.resourceId,
632
+ params: e.params
633
+ }, t) ?? Promise.resolve(H());
634
+ default: return this.hostCatalog?.resolve({
635
+ sourceId: e.source.sourceId,
636
+ params: e.params,
637
+ purpose: "runtime",
638
+ signal: t.signal
639
+ }) ?? Promise.resolve(H());
640
+ }
641
+ }
642
+ async queryDataset(e, t, a) {
643
+ if (this.datasets === void 0) return H();
644
+ let o = this.#t, s = () => !a.signal.aborted && o === this.#t;
645
+ if (!s()) return W();
646
+ let c = this.#e.get(t);
647
+ if (c === void 0) {
648
+ let e = await this.datasets.describe({
649
+ datasetId: t,
650
+ signal: a.signal
651
+ });
652
+ if (!s()) return W();
653
+ if (!e.ok) return e;
654
+ let n = r(e.value);
655
+ if (!n.ok) return n;
656
+ if (n.value.datasetId !== t) return U();
657
+ c = n.value, this.#e.size >= 32 && this.#e.delete(this.#e.keys().next().value), this.#e.set(t, c);
658
+ }
659
+ let l = i(c.parameters, e.params);
660
+ if (!l.ok) return l;
661
+ if (!s()) return W();
662
+ let u = await this.datasets.query({
663
+ datasetId: t,
664
+ dataSourceId: e.dataSourceId,
665
+ params: l.value
666
+ }, a);
667
+ if (!s()) return W();
668
+ if (!u.ok) return u;
669
+ let d = n(u.value);
670
+ return d.ok ? C(d.value.fields) === C(c.fields) ? {
671
+ ok: !0,
672
+ value: d.value,
673
+ diagnostics: []
674
+ } : U() : d;
675
+ }
676
+ };
677
+ function H() {
678
+ return {
679
+ ok: !1,
680
+ diagnostics: [{
681
+ severity: "error",
682
+ code: "HOST_RESOURCE_UNAVAILABLE",
683
+ path: [],
684
+ message: "Host resource port is unavailable."
685
+ }]
686
+ };
687
+ }
688
+ function U() {
689
+ return {
690
+ ok: !1,
691
+ diagnostics: [{
692
+ severity: "error",
693
+ code: "HOST_DATASET_INVALID",
694
+ path: [],
695
+ message: "Dataset definition does not match its result."
696
+ }]
697
+ };
698
+ }
699
+ function W() {
700
+ return {
701
+ ok: !1,
702
+ diagnostics: []
703
+ };
704
+ }
705
+ var we = class {
706
+ options;
707
+ #e = /* @__PURE__ */ new Map();
708
+ #t;
709
+ #n = {};
710
+ #r = C({});
711
+ constructor(e) {
712
+ this.options = e;
713
+ }
714
+ get variablesKey() {
715
+ return this.#r;
716
+ }
717
+ ensure(e, t, n, r = {}) {
718
+ this.#t = e, t !== this.#n && (this.#n = t, this.#r = C(t));
719
+ let i = {
720
+ variableValues: t,
721
+ dataSourceValues: /* @__PURE__ */ new Map(),
722
+ dataSourceErrors: /* @__PURE__ */ new Map()
723
+ }, a = Te(e);
724
+ for (let e of a) {
725
+ let t = this.#i(e.id);
726
+ t.source = e.source, this.#a(t, e, i, n, r.startOnly);
727
+ }
728
+ let o = new Set(a.map((e) => e.id));
729
+ for (let [e, t] of this.#e) o.has(e) || (this.#l(t), this.#e.delete(e));
730
+ }
731
+ reportProjection(e, t, n) {
732
+ let r = this.#e.get(e);
733
+ if (r === void 0) return;
734
+ let i = G(n);
735
+ this.#u(r, "adapted", {
736
+ startedAt: r.startedAt,
737
+ ...i
738
+ }, t);
739
+ }
740
+ read(e) {
741
+ return this.#e.get(e);
742
+ }
743
+ entryIds() {
744
+ return [...this.#e.keys()];
745
+ }
746
+ evaluate(e) {
747
+ let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
748
+ if (e.kind === "data-source-field") {
749
+ let r = this.#e.get(e.dataSourceId);
750
+ r?.dataState.status === "ready" && r.rawValue !== void 0 ? t.set(e.dataSourceId, r.rawValue) : r?.dataState.status === "error" && n.set(e.dataSourceId, r.rawError ?? K("Host data source failed."));
751
+ }
752
+ let r = {
753
+ variableValues: this.#n,
754
+ dataSourceValues: t,
755
+ dataSourceErrors: n
756
+ };
757
+ return _(e, r);
758
+ }
759
+ refresh(e, t) {
760
+ let n = e === void 0 ? [...this.#e.keys()] : this.#e.has(e) ? [e] : [], r = [];
761
+ for (let e of n) {
762
+ let n = this.#e.get(e);
763
+ n.requestKey !== void 0 && (n.requestSlotId === void 0 || this.options.coordinator?.isPending(n.requestSlotId) !== !0) && (this.#l(n), this.#s(n, t ?? {
764
+ trigger: "manual",
765
+ traceId: ""
766
+ }), r.push(e));
767
+ }
768
+ return r;
769
+ }
770
+ suspend() {
771
+ for (let e of this.#e.values()) this.#l(e), e.dataState = { status: "loading" }, e.rawValue = void 0, e.rawError = void 0, this.options.onChanged(e.dataSourceId);
772
+ }
773
+ clear() {
774
+ for (let e of this.#e.values()) this.#l(e);
775
+ this.#e.clear(), this.#t = void 0, this.#n = {}, this.#r = C({});
776
+ }
777
+ #i(e) {
778
+ let t = this.#e.get(e);
779
+ if (t !== void 0) return t;
780
+ let n = {
781
+ dataSourceId: e,
782
+ requestKey: void 0,
783
+ dataState: { status: "loading" },
784
+ rawValue: void 0,
785
+ generation: 0,
786
+ requestSlotId: void 0,
787
+ rawError: void 0,
788
+ source: void 0,
789
+ params: {},
790
+ requestId: void 0,
791
+ executionContext: void 0,
792
+ startedAt: void 0
793
+ };
794
+ return this.#e.set(e, n), n;
795
+ }
796
+ #a(e, t, n, r, i) {
797
+ let a = this.#o(t.params, n);
798
+ if (a.kind === "pending") {
799
+ e.dataState = { status: "loading" };
800
+ return;
801
+ }
802
+ if (a.kind === "failed") {
803
+ this.#c(e, a.diagnostic), n.dataSourceErrors.set(e.dataSourceId, a.diagnostic);
804
+ return;
805
+ }
806
+ let o = Ee(e.dataSourceId, t.source, a.params);
807
+ if (e.requestKey !== o && (this.#l(e), e.requestKey = o, e.params = a.params, e.dataState = { status: "loading" }, e.rawValue = void 0, e.rawError = void 0), e.requestSlotId === void 0) {
808
+ if (e.dataState.status === "ready") {
809
+ e.rawValue !== void 0 && n.dataSourceValues.set(e.dataSourceId, e.rawValue);
810
+ return;
811
+ }
812
+ if (e.dataState.status === "error") {
813
+ n.dataSourceErrors.set(e.dataSourceId, e.rawError ?? K("Host data source failed."));
814
+ return;
815
+ }
816
+ i !== void 0 && !i.has(e.dataSourceId) || this.#s(e, r);
817
+ }
818
+ }
819
+ #o(e, t) {
820
+ let n = {}, r = !1;
821
+ for (let [i, a] of Object.entries(e)) {
822
+ let e = _(a, t);
823
+ if (e.kind === "pending") {
824
+ r = !0;
825
+ continue;
826
+ }
827
+ if (e.kind === "failed") return {
828
+ kind: "failed",
829
+ diagnostic: K(e.reason === "variable-missing" ? "Data source parameter references a variable without a value." : "Data source parameter is invalid.")
830
+ };
831
+ if (e.value === void 0) return {
832
+ kind: "failed",
833
+ diagnostic: K("Data source parameter resolved to no value.")
834
+ };
835
+ n[i] = e.value;
836
+ }
837
+ return r ? { kind: "pending" } : {
838
+ kind: "ok",
839
+ params: n
840
+ };
841
+ }
842
+ #s(t, n) {
843
+ let r = t.source;
844
+ if (r === void 0 || t.requestKey === void 0 || this.options.isSuspended()) return;
845
+ if (!this.options.sourcePort.accepts(r)) {
846
+ this.#c(t, {
847
+ severity: "error",
848
+ code: "HOST_RESOURCE_UNAVAILABLE",
849
+ path: [],
850
+ message: "Host resource port is unavailable."
851
+ }, { emitStarted: !0 }), this.options.onChanged(t.dataSourceId);
852
+ return;
853
+ }
854
+ let i = this.options.validateParams?.(r, t.params);
855
+ if (i !== void 0) {
856
+ this.#c(t, i, { emitStarted: !1 }), this.options.onChanged(t.dataSourceId);
857
+ return;
858
+ }
859
+ let o = this.options.coordinator;
860
+ if (o === void 0) {
861
+ this.options.onChanged(t.dataSourceId);
862
+ return;
863
+ }
864
+ let c = ++t.generation, l = this.options.createExecutionContext(n, t.dataSourceId), u = Date.now(), d = `${t.dataSourceId}:${t.requestKey}:${c}`;
865
+ t.executionContext = l, t.startedAt = u, t.requestId = d;
866
+ let { resolution: f, slotId: p } = o.request(t.requestKey, Se(r), t.dataSourceId, {
867
+ dataSourceId: t.dataSourceId,
868
+ source: r,
869
+ params: t.params
870
+ }, l);
871
+ t.requestSlotId = p, this.#u(t, "started", { startedAt: u }), f.then((n) => {
872
+ if (this.#e.get(t.dataSourceId) !== t || t.generation !== c || t.requestSlotId !== p) return;
873
+ if (t.requestSlotId = void 0, n.kind === "timeout") {
874
+ this.#c(t, {
875
+ severity: "error",
876
+ code: "HOST_RESOURCE_TIMEOUT",
877
+ path: [],
878
+ message: "Host data source request timed out."
879
+ }, { emitStarted: !1 }), this.#u(t, "timed-out", {
880
+ startedAt: u,
881
+ code: "HOST_RESOURCE_TIMEOUT"
882
+ }), this.options.onChanged(t.dataSourceId);
883
+ return;
884
+ }
885
+ if (n.kind === "failure") {
886
+ let e = n.diagnostics.diagnostics[0], r = e === void 0 ? K() : e;
887
+ this.#c(t, r, { emitStarted: !1 }), this.#u(t, "failed", {
888
+ startedAt: u,
889
+ code: a(r).code
890
+ }), this.options.onChanged(t.dataSourceId);
891
+ return;
892
+ }
893
+ let r = e(n.value, { maxBytes: s });
894
+ if (!r.ok) {
895
+ let e = {
896
+ severity: "error",
897
+ code: "HOST_RESOURCE_INVALID",
898
+ path: [],
899
+ message: "Host data source returned invalid JSON."
900
+ };
901
+ this.#c(t, e, { emitStarted: !1 }), this.#u(t, "failed", {
902
+ startedAt: u,
903
+ code: e.code
904
+ }), this.options.onChanged(t.dataSourceId);
905
+ return;
906
+ }
907
+ t.dataState = {
908
+ status: "ready",
909
+ value: r.value
910
+ }, t.rawValue = r.value, t.rawError = void 0;
911
+ let i = G(r.value);
912
+ this.#u(t, "succeeded", {
913
+ startedAt: u,
914
+ ...i
915
+ }), this.options.onChanged(t.dataSourceId);
916
+ });
917
+ }
918
+ #c(e, t, n = { emitStarted: !1 }) {
919
+ e.generation++, e.requestSlotId = void 0, e.rawValue = void 0, e.rawError = t;
920
+ let r = a(t);
921
+ e.dataState = {
922
+ status: "error",
923
+ code: r.code,
924
+ message: r.message
925
+ }, n.emitStarted && this.#u(e, "started", { startedAt: void 0 }), this.#u(e, "failed", {
926
+ startedAt: void 0,
927
+ code: r.code
928
+ });
929
+ }
930
+ #l(e) {
931
+ let t = e.requestSlotId;
932
+ e.generation++, e.requestSlotId = void 0, t !== void 0 && (this.options.coordinator?.release(t, e.dataSourceId), this.#u(e, "aborted", { startedAt: void 0 })), e.requestId = void 0;
933
+ }
934
+ #u(e, t, n, r) {
935
+ let i = e.source;
936
+ if (i === void 0) return;
937
+ let a = De(i), o = e.executionContext ?? this.options.createExecutionContext({
938
+ trigger: "manual",
939
+ traceId: ""
940
+ }, e.dataSourceId);
941
+ this.options.emit({
942
+ type: t,
943
+ dataSourceId: e.dataSourceId,
944
+ componentId: r ?? this.#d(e.dataSourceId),
945
+ resourceType: a.resourceType,
946
+ resourceId: a.resourceId,
947
+ requestId: e.requestId,
948
+ context: o,
949
+ startedAt: n.startedAt,
950
+ ...n.fieldCount === void 0 ? {} : { fieldCount: n.fieldCount },
951
+ ...n.rowCount === void 0 ? {} : { rowCount: n.rowCount },
952
+ ...n.code === void 0 ? {} : { code: n.code }
953
+ });
954
+ }
955
+ #d(e) {
956
+ let t = this.#t?.components ?? [];
957
+ for (let n of t) {
958
+ let t = p(n);
959
+ if (t?.kind === "data-source-field" && t.dataSourceId === e) return n.id;
960
+ }
961
+ return e;
962
+ }
963
+ };
964
+ function Te(e) {
965
+ let t = d(e), n = new Map(t.map((e) => [e.id, e])), r = [];
966
+ for (let t of l(e)) {
967
+ let e = n.get(t);
968
+ e !== void 0 && (r.push(e), n.delete(t));
969
+ }
970
+ for (let e of t) n.has(e.id) && r.push(e);
971
+ return r;
972
+ }
973
+ function Ee(e, t, n) {
974
+ return `ds:${e}:${C(t)}:${C(n)}`;
975
+ }
976
+ function De(e) {
977
+ switch (e.kind) {
978
+ case "dataset": return {
979
+ resourceType: "dataset",
980
+ resourceId: e.datasetId
981
+ };
982
+ case "host-resource": return {
983
+ resourceType: e.resourceType,
984
+ resourceId: e.resourceId
985
+ };
986
+ default: return {
987
+ resourceType: e.kind,
988
+ resourceId: e.sourceId
989
+ };
990
+ }
991
+ }
992
+ function G(e) {
993
+ if (e === void 0 || typeof e != "object" || !e || Array.isArray(e)) return {};
994
+ let t = e.fields, n = e.rows;
995
+ return {
996
+ ...Array.isArray(t) ? { fieldCount: t.length } : {},
997
+ ...Array.isArray(n) ? { rowCount: n.length } : {}
998
+ };
999
+ }
1000
+ function K(e = "Host resource request failed.") {
1001
+ return {
1002
+ severity: "error",
1003
+ code: "HOST_RESOURCE_FAILED",
1004
+ path: [],
1005
+ message: e
1006
+ };
1007
+ }
1008
+ var Oe = class {
1009
+ resourcePort;
1010
+ isShareable;
1011
+ timeoutMs;
1012
+ onShared;
1013
+ #e = /* @__PURE__ */ new Map();
1014
+ #t = 0;
1015
+ constructor(e, t, n, r) {
1016
+ this.resourcePort = e, this.isShareable = t, this.timeoutMs = n, this.onShared = r;
1017
+ }
1018
+ request(e, t, n, r, i) {
1019
+ if (this.isShareable(t)) {
1020
+ for (let t of this.#e.values()) if (t.key === e) return t.consumers.add(n), this.onShared?.(e, n, i), {
1021
+ resolution: t.promise,
1022
+ shared: !0,
1023
+ slotId: t.slotId
1024
+ };
1025
+ }
1026
+ let a = `request-slot-${++this.#t}`;
1027
+ return {
1028
+ resolution: this.#n(a, e, t, n, r, i),
1029
+ shared: !1,
1030
+ slotId: a
1031
+ };
1032
+ }
1033
+ release(e, t) {
1034
+ let n = this.#e.get(e);
1035
+ n !== void 0 && (n.consumers.delete(t), n.consumers.size === 0 && this.#r(n));
1036
+ }
1037
+ abortAll() {
1038
+ for (let e of this.#e.values()) this.#r(e);
1039
+ this.#e.clear();
1040
+ }
1041
+ get pending() {
1042
+ return this.#e.size;
1043
+ }
1044
+ isPending(e) {
1045
+ return this.#e.has(e);
1046
+ }
1047
+ #n(e, t, n, r, i, a) {
1048
+ let o = new AbortController(), s = () => {}, c = new Promise((e) => {
1049
+ s = e;
1050
+ }), l = {
1051
+ slotId: e,
1052
+ key: t,
1053
+ resourceType: n,
1054
+ consumers: /* @__PURE__ */ new Set([r]),
1055
+ controller: o,
1056
+ promise: c,
1057
+ timer: void 0
1058
+ };
1059
+ l.timer = setTimeout(() => {
1060
+ this.#e.get(e) === l && (o.abort(), this.#e.delete(e), s({ kind: "timeout" }));
1061
+ }, this.timeoutMs), this.#e.set(e, l);
1062
+ let u;
1063
+ try {
1064
+ u = this.resourcePort.resolve(i, {
1065
+ signal: o.signal,
1066
+ ...a === void 0 ? {} : { context: a }
1067
+ });
1068
+ } catch {
1069
+ return this.#e.get(e) === l && this.#e.delete(e), l.timer !== void 0 && clearTimeout(l.timer), s({
1070
+ kind: "failure",
1071
+ diagnostics: {
1072
+ ok: !1,
1073
+ diagnostics: []
1074
+ }
1075
+ }), c;
1076
+ }
1077
+ return u.then((t) => {
1078
+ this.#e.get(e) === l && (l.timer !== void 0 && clearTimeout(l.timer), this.#e.delete(e), s(t.ok ? {
1079
+ kind: "ok",
1080
+ value: t.value
1081
+ } : {
1082
+ kind: "failure",
1083
+ diagnostics: t
1084
+ }));
1085
+ }, () => {
1086
+ this.#e.get(e) === l && (l.timer !== void 0 && clearTimeout(l.timer), this.#e.delete(e), s({
1087
+ kind: "failure",
1088
+ diagnostics: {
1089
+ ok: !1,
1090
+ diagnostics: []
1091
+ }
1092
+ }));
1093
+ }), c;
1094
+ }
1095
+ #r(e) {
1096
+ e.timer !== void 0 && clearTimeout(e.timer), e.controller.abort(), this.#e.get(e.slotId) === e && this.#e.delete(e.slotId);
1097
+ }
1098
+ };
1099
+ function ke(e) {
1100
+ if (!Pe(e.resourceTimeoutMs ?? 15e3)) throw RangeError("resourceTimeoutMs must be an integer between 100 and 60000.");
1101
+ let t = new Ce(e.resourcePort, e.datasetPort, e.hostCatalogPort), n, r = e.resourcePort !== void 0 || e.datasetPort !== void 0 || e.hostCatalogPort !== void 0 ? new Oe({ resolve: (e, n) => t.query(e, n) }, (t) => Ae(t, e), e.resourceTimeoutMs ?? 15e3) : void 0, i = new we({
1102
+ sourcePort: t,
1103
+ coordinator: r,
1104
+ isSuspended: () => n.dataSuspended,
1105
+ createExecutionContext: (e, t) => Ne(n, t, e),
1106
+ emit: (e) => Me(n, e),
1107
+ onChanged: (e) => n.onDataSourceChanged(e),
1108
+ validateParams: (e, t) => je(n, e, t)
1109
+ });
1110
+ return n = {
1111
+ options: e,
1112
+ catalog: e.catalog,
1113
+ mounted: /* @__PURE__ */ new Map(),
1114
+ candidates: /* @__PURE__ */ new Map(),
1115
+ document: void 0,
1116
+ lastValidatedInput: void 0,
1117
+ validationCache: { entries: /* @__PURE__ */ new Map() },
1118
+ variables: {},
1119
+ dataSuspended: !1,
1120
+ disposed: !1,
1121
+ interactive: e.interactive,
1122
+ coordinator: r,
1123
+ sourceQueries: t,
1124
+ dataSources: i,
1125
+ visibility: new _e(e.root),
1126
+ onDataSourceChanged: () => {}
1127
+ }, n;
1128
+ }
1129
+ function Ae(e, t) {
1130
+ return e === "#source-dataset" ? t.datasetPort?.queryScope === "dataset" : e === "#source-resource";
1131
+ }
1132
+ function je(e, t, n) {
1133
+ if (t.kind !== "host-resource") return;
1134
+ let r = e.options.contributionIndex;
1135
+ if (r === void 0) return;
1136
+ let i = r.getResourceType(t.resourceType);
1137
+ if (i === void 0) return {
1138
+ severity: "error",
1139
+ code: "HOST_RESOURCE_FAILED",
1140
+ path: [],
1141
+ message: "Host resource type is not enabled by an active plugin contribution."
1142
+ };
1143
+ if (!x(n, i.configSchema).ok) return {
1144
+ severity: "error",
1145
+ code: "HOST_RESOURCE_FAILED",
1146
+ path: [],
1147
+ message: "Host resource request failed."
1148
+ };
1149
+ }
1150
+ function Me(e, t) {
1151
+ let n = e.options.observer;
1152
+ if (n !== void 0) try {
1153
+ n({
1154
+ type: t.type,
1155
+ requestId: t.requestId ?? `${t.dataSourceId}:${t.resourceType}:cancel`,
1156
+ componentId: t.componentId,
1157
+ resourceType: t.resourceType,
1158
+ resourceId: t.resourceId,
1159
+ context: t.context,
1160
+ durationMs: t.startedAt === void 0 ? 0 : Date.now() - t.startedAt,
1161
+ ...t.fieldCount === void 0 ? {} : { fieldCount: t.fieldCount },
1162
+ ...t.rowCount === void 0 ? {} : { rowCount: t.rowCount },
1163
+ ...t.code === void 0 ? {} : { code: t.code }
1164
+ });
1165
+ } catch {}
1166
+ }
1167
+ function Ne(e, t, n) {
1168
+ return {
1169
+ instanceId: e.options.instanceId ?? "renderer",
1170
+ mode: e.options.executionMode ?? "viewer",
1171
+ trigger: n.trigger,
1172
+ traceId: n.traceId,
1173
+ ...e.options.projectId === void 0 ? {} : { projectId: e.options.projectId },
1174
+ ...e.options.documentRevision === void 0 ? {} : { documentRevision: e.options.documentRevision }
1175
+ };
1176
+ }
1177
+ function Pe(e) {
1178
+ return Number.isInteger(e) && e >= 100 && e <= 6e4;
1179
+ }
1180
+ function q(e) {
1181
+ return new Fe(e);
1182
+ }
1183
+ var Fe = class {
1184
+ #e;
1185
+ #t = /* @__PURE__ */ new Map();
1186
+ constructor(e) {
1187
+ this.#e = ke(e), this.#e.onDataSourceChanged = (e) => this.#n(e);
1188
+ }
1189
+ render(e, t) {
1190
+ if (this.#e.disposed) return E("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
1191
+ let n = e === this.#e.lastValidatedInput && this.#e.document !== void 0 ? {
1192
+ ok: !0,
1193
+ value: this.#e.document,
1194
+ diagnostics: []
1195
+ } : c(e, this.#e.lastValidatedInput);
1196
+ if (!n.ok) return n;
1197
+ let r = {
1198
+ trigger: t?.trigger ?? "manual",
1199
+ traceId: t?.traceId ?? ""
1200
+ };
1201
+ this.#e.dataSources.ensure(n.value, this.#e.variables, r), this.#t = J(n.value);
1202
+ let i = j(n.value, this.#e.catalog, this.#e.options.mode, this.#e.interactive, this.#e.options.contributionIndex, this.#e.dataSources, this.#e.validationCache, this.#e.options.componentFailurePolicy ?? "fail");
1203
+ if (!i.ok) return i;
1204
+ let a = new Map(y(n.value).map((e, t) => [e, t]));
1205
+ this.#e.visibility.prepare(n.value);
1206
+ let o = [...i.value].sort((e, t) => a.get(e.component.id) - a.get(t.component.id)), s = /* @__PURE__ */ new Map(), l = [];
1207
+ for (let e of o) {
1208
+ let t = a.get(e.component.id), n = this.#e.mounted.get(e.component.id);
1209
+ if (n !== void 0 && n.type === e.component.type) {
1210
+ try {
1211
+ z(this.#e, e, n, t);
1212
+ } catch {
1213
+ l.push(D(e, "Material model update raised an exception."));
1214
+ }
1215
+ s.set(e.component.id, n);
1216
+ continue;
1217
+ }
1218
+ n !== void 0 && (n.element.removeEventListener("base-screen-material-event", n.onEvent), n.element.remove());
1219
+ let r;
1220
+ try {
1221
+ r = new e.entry.constructor();
1222
+ } catch {
1223
+ l.push(D(e, "Material constructor raised an exception."));
1224
+ continue;
1225
+ }
1226
+ let i = (t) => ge(this.#e, e, t);
1227
+ r.addEventListener("base-screen-material-event", i);
1228
+ let o;
1229
+ try {
1230
+ o = F(this.#e, e, e.model.dataState), I(r, e.component, o, this.#e.visibility.isHidden(e.component.id), t);
1231
+ } catch {
1232
+ l.push(D(e, "Material render raised an exception."));
1233
+ continue;
1234
+ }
1235
+ this.#e.options.root.appendChild(r);
1236
+ let c = {
1237
+ type: e.component.type,
1238
+ element: r,
1239
+ onEvent: i,
1240
+ projection: oe(),
1241
+ stackOrder: t,
1242
+ applied: V(this.#e, e, t),
1243
+ appliedModel: o
1244
+ };
1245
+ c.projection.dataState = e.model.dataState, c.projection.projectionKey = e.dataSource?.projectionKey, s.set(e.component.id, c);
1246
+ }
1247
+ for (let [e, t] of this.#e.mounted) s.has(e) || (t.element.removeEventListener("base-screen-material-event", t.onEvent), t.element.remove());
1248
+ if (this.#e.options.root.style.position = "relative", this.#e.options.root.style.width = `${n.value.canvas.width}px`, this.#e.options.root.style.height = `${n.value.canvas.height}px`, this.#e.options.mode !== "design" && this.#e.options.root.style.overflow !== "hidden" && (this.#e.options.root.style.overflow = "hidden"), re(this.#e.options.root, n.value.canvas), this.#e.mounted = s, this.#e.candidates = new Map(o.map((e) => [e.component.id, e])), this.#e.document = n.value, this.#e.lastValidatedInput = e, l.length > 0) for (let e of l) this.#e.options.onDiagnostic?.(e);
1249
+ return {
1250
+ ok: !0,
1251
+ value: null,
1252
+ diagnostics: [...i.diagnostics, ...l]
1253
+ };
1254
+ }
1255
+ setVariables(t) {
1256
+ let n = e(t, { maxBytes: 2097152 });
1257
+ return !n.ok || n.value === null || Array.isArray(n.value) || typeof n.value != "object" ? E("HOST_DATASET_VARIABLE_INVALID", [], "Runtime variables are invalid.") : (this.#e.variables = n.value, this.#e.dataSuspended = !1, {
1258
+ ok: !0,
1259
+ value: null,
1260
+ diagnostics: []
1261
+ });
1262
+ }
1263
+ setInteractive(e) {
1264
+ return this.#e.disposed ? E("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.") : this.#e.interactive === e || (this.#e.interactive = e, this.#e.document === void 0) ? {
1265
+ ok: !0,
1266
+ value: null,
1267
+ diagnostics: []
1268
+ } : this.render(this.#e.document);
1269
+ }
1270
+ validateCatalog(e, t) {
1271
+ if (this.#e.disposed) return E("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
1272
+ let n = c(e, this.#e.lastValidatedInput);
1273
+ if (!n.ok) return n;
1274
+ try {
1275
+ let e = j(n.value, t, this.#e.options.mode, this.#e.interactive, this.#e.options.contributionIndex, this.#e.dataSources, { entries: /* @__PURE__ */ new Map() }, "fail");
1276
+ return e.ok ? {
1277
+ ok: !0,
1278
+ value: null,
1279
+ diagnostics: []
1280
+ } : {
1281
+ ok: !1,
1282
+ diagnostics: e.diagnostics
1283
+ };
1284
+ } catch {
1285
+ return E("PLUGIN_CORE_RENDER_FAILED", [], "Catalog validation failed.");
1286
+ }
1287
+ }
1288
+ setCatalog(e) {
1289
+ if (this.#e.disposed) return E("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
1290
+ if (e === this.#e.catalog) return {
1291
+ ok: !0,
1292
+ value: null,
1293
+ diagnostics: []
1294
+ };
1295
+ let t = ee(this.#e.catalog, e), n = new Set(t.implementationChanged), r = new Set(t.removed);
1296
+ for (let [e, t] of this.#e.mounted) !n.has(t.type) && !r.has(t.type) || (t.element.removeEventListener("base-screen-material-event", t.onEvent), t.element.remove(), this.#e.mounted.delete(e), this.#e.candidates.delete(e));
1297
+ let i = new Set(t.unchanged);
1298
+ for (let t of this.#e.mounted.values()) {
1299
+ if (t.applied === void 0 || !i.has(t.type)) continue;
1300
+ let n = e.get(t.type);
1301
+ n !== void 0 && (t.applied = {
1302
+ ...t.applied,
1303
+ entry: n
1304
+ });
1305
+ }
1306
+ return this.#e.validationCache.entries.clear(), this.#e.catalog = e, {
1307
+ ok: !0,
1308
+ value: null,
1309
+ diagnostics: []
1310
+ };
1311
+ }
1312
+ applyBlueprintVisibilityEffects(e) {
1313
+ return this.#e.disposed ? E("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.") : this.#e.visibility.apply(e, this.#e.document, this.#e.mounted);
1314
+ }
1315
+ resetBlueprintVisibility() {
1316
+ this.#e.visibility.reset();
1317
+ }
1318
+ suspendData() {
1319
+ this.#e.dataSuspended = !0, this.#e.coordinator?.abortAll(), this.#e.dataSources.suspend();
1320
+ for (let [e, t] of this.#e.mounted) {
1321
+ t.projection.projectionKey = void 0, t.projection.dataState = { status: "loading" };
1322
+ let n = this.#e.candidates.get(e);
1323
+ if (n !== void 0 && n.dataSource !== void 0) {
1324
+ let e = {
1325
+ ...n.model,
1326
+ dataState: { status: "loading" }
1327
+ };
1328
+ t.element.model = e, t.appliedModel = e;
1329
+ }
1330
+ }
1331
+ }
1332
+ refreshData(e, t, n) {
1333
+ let r = {
1334
+ trigger: t === "polling" ? "polling" : "manual",
1335
+ traceId: n ?? ""
1336
+ };
1337
+ if (e === void 0) {
1338
+ this.#e.dataSources.refresh(void 0, r);
1339
+ return;
1340
+ }
1341
+ let i = this.#e.candidates.get(e);
1342
+ if (i === void 0) return;
1343
+ let a = p(i.component);
1344
+ a?.kind === "data-source-field" && this.#e.dataSources.refresh(a.dataSourceId, r);
1345
+ }
1346
+ refreshConditionalStyles(e) {
1347
+ if (this.#e.disposed || this.#e.options.conditionalStylePort === void 0) return;
1348
+ let t = e === void 0 ? [...this.#e.mounted.keys()] : [...new Set(e)];
1349
+ for (let e of t) {
1350
+ let t = this.#e.candidates.get(e), n = this.#e.mounted.get(e);
1351
+ if (t !== void 0 && n !== void 0) try {
1352
+ he(this.#e, t, n);
1353
+ } catch {
1354
+ this.#e.options.onDiagnostic?.(T("PLUGIN_CORE_RENDER_FAILED", [
1355
+ "components",
1356
+ e,
1357
+ "conditionalStyle"
1358
+ ], "Conditional style refresh failed for material."));
1359
+ }
1360
+ }
1361
+ }
1362
+ prepareDataSources(e, t, n, r) {
1363
+ if (this.#e.disposed) return;
1364
+ let i = c(e, this.#e.lastValidatedInput);
1365
+ i.ok && (this.#e.dataSources.ensure(i.value, t, {
1366
+ trigger: n?.trigger ?? "manual",
1367
+ traceId: n?.traceId ?? ""
1368
+ }, r === void 0 ? {} : { startOnly: r }), this.#t = J(i.value));
1369
+ }
1370
+ refreshDataSource(e, t) {
1371
+ this.#e.dataSources.refresh(e, {
1372
+ trigger: t?.trigger ?? "manual",
1373
+ traceId: t?.traceId ?? ""
1374
+ });
1375
+ }
1376
+ readDataSourceValue(e) {
1377
+ let t = this.#e.dataSources.read(e);
1378
+ if (t !== void 0 && t.dataState.status === "ready") return t.rawValue;
1379
+ }
1380
+ isDataSourceSettled(e) {
1381
+ let t = this.#e.dataSources.read(e);
1382
+ return t !== void 0 && t.dataState.status !== "loading";
1383
+ }
1384
+ evaluateValueRef(e) {
1385
+ return this.#e.dataSources.evaluate(e);
1386
+ }
1387
+ clear() {
1388
+ this.resetBlueprintVisibility(), this.#e.coordinator?.abortAll(), this.#e.sourceQueries.clear(), this.#e.dataSources.clear(), this.#t = /* @__PURE__ */ new Map();
1389
+ for (let e of this.#e.mounted.values()) e.element.removeEventListener("base-screen-material-event", e.onEvent), e.element.remove();
1390
+ this.#e.mounted.clear(), this.#e.candidates.clear(), this.#e.document = void 0, this.#e.lastValidatedInput = void 0, this.#e.validationCache.entries.clear();
1391
+ }
1392
+ dispose() {
1393
+ this.#e.disposed || (this.clear(), this.#e.disposed = !0);
1394
+ }
1395
+ #n(e) {
1396
+ let t = this.#e.document;
1397
+ !this.#e.disposed && t !== void 0 && this.#r(e, t);
1398
+ let n = this.#e.dataSources.read(e);
1399
+ n !== void 0 && n.dataState.status !== "loading" && this.#e.options.onDataSourceSettled?.(e);
1400
+ }
1401
+ #r(e, t) {
1402
+ let n = new Map(t.components.map((e) => [e.id, e]));
1403
+ for (let t of this.#t.get(e) ?? []) {
1404
+ let r = n.get(t), i = this.#e.candidates.get(t), a = this.#e.mounted.get(t);
1405
+ if (r === void 0 || i === void 0 || a === void 0) continue;
1406
+ let o = M(this.#e.dataSources, r, i.entry, this.#e.options.contributionIndex, ["components", t], (e) => this.#e.options.onDiagnostic?.(e));
1407
+ if ("diagnostic" in o) continue;
1408
+ let s = {
1409
+ ...i,
1410
+ model: {
1411
+ ...i.model,
1412
+ dataState: o.dataState
1413
+ },
1414
+ dataSource: o.dataSource,
1415
+ dataEpoch: o.epoch
1416
+ };
1417
+ this.#e.candidates.set(t, s), o.dataState.status === "ready" && this.#e.dataSources.reportProjection(e, t, o.dataState.value), a.projection.dataState = o.dataState, a.projection.projectionKey = o.dataSource?.projectionKey, B(this.#e, s, a, a.stackOrder);
1418
+ }
1419
+ }
1420
+ };
1421
+ function J(e) {
1422
+ let t = /* @__PURE__ */ new Map();
1423
+ for (let n of e.components) {
1424
+ let e = p(n);
1425
+ if (e?.kind !== "data-source-field") continue;
1426
+ let r = t.get(e.dataSourceId);
1427
+ r === void 0 ? t.set(e.dataSourceId, [n.id]) : r.push(n.id);
1428
+ }
1429
+ return t;
1430
+ }
1431
+ function Ie(e, t, n, r) {
1432
+ let i = [];
1433
+ if (C(n) !== C(r.variables)) {
1434
+ let n = e.setVariables(r.variables);
1435
+ if (n.ok) {
1436
+ let n = e.render(t, { trigger: "variable" });
1437
+ i.push(...n.diagnostics);
1438
+ } else i.push(...n.diagnostics);
1439
+ }
1440
+ if (r.visibilityEffects.length > 0) {
1441
+ let t = e.applyBlueprintVisibilityEffects(r.visibilityEffects);
1442
+ t.ok || i.push(...t.diagnostics);
1443
+ }
1444
+ return i;
1445
+ }
1446
+ function Y(e) {
1447
+ return typeof e == "object" && !!e && typeof e.get == "function" && typeof e.has == "function" && typeof e.list == "function";
1448
+ }
1449
+ function Le(e) {
1450
+ return typeof e == "object" && !!e && typeof e.resolve == "function";
1451
+ }
1452
+ function Re(e) {
1453
+ if (typeof e != "object" || !e) return !1;
1454
+ let t = e;
1455
+ return [
1456
+ "list",
1457
+ "describe",
1458
+ "resolve"
1459
+ ].every((e) => typeof t[e] == "function");
1460
+ }
1461
+ function ze(e) {
1462
+ return typeof e == "object" && !!e && typeof e.getResourceType == "function" && typeof e.hasBlueprintCapability == "function";
1463
+ }
1464
+ function Be(e) {
1465
+ return typeof e == "object" && !!e && typeof e.emit == "function";
1466
+ }
1467
+ function Ve(e) {
1468
+ return typeof e == "object" && !!e && typeof e.resolve == "function";
1469
+ }
1470
+ function He(e) {
1471
+ return typeof e == "object" && !!e && typeof e.execute == "function";
1472
+ }
1473
+ function X(e) {
1474
+ return {
1475
+ ok: !1,
1476
+ diagnostics: [{
1477
+ severity: "error",
1478
+ code: "PLUGIN_CORE_LIFECYCLE_INVALID",
1479
+ path: [],
1480
+ message: e
1481
+ }]
1482
+ };
1483
+ }
1484
+ function Ue(e) {
1485
+ if (!Y(e.catalog)) return X("Viewer catalog 必须是合法的物料目录。");
1486
+ if (e.datasetPort !== void 0 && !o(e.datasetPort)) return X("Viewer dataset port must provide list, describe and query.");
1487
+ let t = e.resourceTimeoutMs ?? 15e3;
1488
+ return !Number.isInteger(t) || t < 100 || t > 6e4 ? X("resourceTimeoutMs 必须是 100..60000 的整数。") : e.resourcePort !== void 0 && !Le(e.resourcePort) ? X("Viewer resource port 必须是含 resolve 的对象。") : e.hostCatalogPort !== void 0 && !Re(e.hostCatalogPort) ? X("Viewer host catalog port 必须同时提供 list、describe 与 resolve。") : e.conditionalStylePort !== void 0 && !Ve(e.conditionalStylePort) ? X("Viewer conditional style port 必须是含 resolve 的对象。") : e.runtimeContributions !== void 0 && !ze(e.runtimeContributions) ? X("Viewer runtime contributions 必须是含 getResourceType 的对象。") : e.blueprintRuntimePort !== void 0 && !Be(e.blueprintRuntimePort) ? X("Viewer blueprint runtime port 必须是含 emit 的对象。") : e.blueprintHostActionPort !== void 0 && !He(e.blueprintHostActionPort) ? X("Viewer blueprint host action port 必须是含 execute 的对象。") : {
1489
+ ok: !0,
1490
+ value: {
1491
+ ...e,
1492
+ resourceTimeoutMs: t
1493
+ },
1494
+ diagnostics: []
1495
+ };
1496
+ }
1497
+ var Z = class {
1498
+ host;
1499
+ #e = /* @__PURE__ */ new Map();
1500
+ #t = !1;
1501
+ constructor(e) {
1502
+ this.host = e;
1503
+ }
1504
+ sync(e) {
1505
+ let t = /* @__PURE__ */ new Map();
1506
+ for (let n of e === void 0 ? [] : d(e)) {
1507
+ let e = We(n);
1508
+ e !== void 0 && t.set(n.id, e);
1509
+ }
1510
+ for (let [e, n] of this.#e) t.get(e) !== n.intervalSeconds && (clearTimeout(n.timer), this.#e.delete(e));
1511
+ for (let [e, n] of t) this.#e.has(e) || this.#n(e, n);
1512
+ }
1513
+ suspend() {
1514
+ this.#t = !0;
1515
+ for (let e of this.#e.values()) clearTimeout(e.timer);
1516
+ this.#e.clear();
1517
+ }
1518
+ resume() {
1519
+ this.#t = !1, this.sync(this.host.readDocument());
1520
+ }
1521
+ dispose() {
1522
+ this.#t = !0;
1523
+ for (let e of this.#e.values()) clearTimeout(e.timer);
1524
+ this.#e.clear();
1525
+ }
1526
+ #n(e, t) {
1527
+ if (this.#t) return;
1528
+ let n = setTimeout(() => {
1529
+ this.#e.delete(e), this.host.readRenderer()?.refreshDataSource(e, { trigger: "polling" }), this.#n(e, t);
1530
+ }, t * 1e3);
1531
+ this.#e.set(e, {
1532
+ intervalSeconds: t,
1533
+ timer: n
1534
+ });
1535
+ }
1536
+ };
1537
+ function We(e) {
1538
+ return e.updatePolicy?.mode === "auto" ? e.updatePolicy.intervalSeconds : void 0;
1539
+ }
1540
+ var Ge = class {
1541
+ #e;
1542
+ #t = /* @__PURE__ */ new Map();
1543
+ #n = 0;
1544
+ #r = !1;
1545
+ #i = !1;
1546
+ #a;
1547
+ #o = "manual";
1548
+ #s;
1549
+ #c = !1;
1550
+ constructor(e) {
1551
+ this.#e = e;
1552
+ }
1553
+ get hasDeferredDocument() {
1554
+ return this.#a !== void 0;
1555
+ }
1556
+ refreshData(e) {
1557
+ let t = typeof e == "string" ? { componentId: e } : e ?? {}, n = this.#e.readRenderer();
1558
+ if (n === void 0 || t.componentId !== void 0 && !this.#m(t.componentId)) return;
1559
+ let r = t.trigger === "polling" ? "polling" : "manual", i = t.traceId;
1560
+ if (t.componentId !== void 0) {
1561
+ this.refreshVariables(i === void 0 ? {} : { traceId: i }), n.refreshData(t.componentId, r, i);
1562
+ return;
1563
+ }
1564
+ n.refreshData(void 0, r, i);
1565
+ }
1566
+ refreshVariables(e = {}) {
1567
+ let t = this.#e.readDocument(), n = this.#e.readRenderer();
1568
+ if (t === void 0 || n === void 0) return;
1569
+ let r = e.variableIds === void 0 ? void 0 : new Set(e.variableIds), i = /* @__PURE__ */ new Set();
1570
+ for (let e of t.variables) {
1571
+ let t = u(e);
1572
+ if (!(r !== void 0 && !r.has(t.id))) for (let e of v(t.value).dataSourceIds) i.add(e);
1573
+ }
1574
+ for (let t of i) n.refreshDataSource(t, {
1575
+ trigger: "variable",
1576
+ ...e.traceId === void 0 ? {} : { traceId: e.traceId }
1577
+ });
1578
+ }
1579
+ handleDataSourceSettled(e) {
1580
+ let t = this.#a;
1581
+ if (t !== void 0) {
1582
+ let e = this.#e.readBlueprintPlan(), n = this.#e.readRenderer();
1583
+ if (e !== void 0 && n !== void 0 && this.#u(t.document, n)) {
1584
+ this.#a = void 0, this.#d(t.document, t.componentId, t.trigger, t.traceId, e);
1585
+ return;
1586
+ }
1587
+ }
1588
+ if (this.#t.has(e)) {
1589
+ if (this.#r) {
1590
+ this.#i = !0;
1591
+ return;
1592
+ }
1593
+ this.#f("variable");
1594
+ }
1595
+ }
1596
+ start(e, t = !1, n = !1) {
1597
+ if (this.#r) {
1598
+ this.#i = !0;
1599
+ return;
1600
+ }
1601
+ n && this.#n++;
1602
+ let r = t ? this.#o : this.#c ? "document-change" : "initial", i = t ? this.#s : void 0;
1603
+ this.#l(e, t, r, i);
1604
+ }
1605
+ cancel() {
1606
+ this.#n++, this.#r = !1, this.#i = !1, this.#t.clear(), this.#a = void 0;
1607
+ }
1608
+ reset() {
1609
+ this.cancel(), this.#c = !1, this.#o = "manual", this.#s = void 0;
1610
+ }
1611
+ #l(e, t, n, r) {
1612
+ let i = this.#e.readRenderer(), a = this.#e.readDocument(), o = this.#e.readBlueprintPlan();
1613
+ if (i !== void 0 && a !== void 0 && o !== void 0) {
1614
+ if (!t && e === void 0) {
1615
+ let t = this.#e.readBlueprintVariables() ?? o.initialVariables, s = /* @__PURE__ */ new Set();
1616
+ for (let e of a.variables) {
1617
+ let t = u(e);
1618
+ for (let e of v(t.value).dataSourceIds) s.add(e);
1619
+ }
1620
+ if (i.prepareDataSources(a, t, {
1621
+ trigger: n,
1622
+ traceId: r ?? ""
1623
+ }, s), !this.#u(a, i)) {
1624
+ this.#a = {
1625
+ document: a,
1626
+ componentId: e,
1627
+ trigger: n,
1628
+ traceId: r
1629
+ };
1630
+ return;
1631
+ }
1632
+ }
1633
+ this.#a = void 0, this.#d(a, e, n, r, o, t);
1634
+ }
1635
+ }
1636
+ #u(e, t) {
1637
+ for (let n of e.variables) {
1638
+ let e = u(n);
1639
+ if (e.value.kind === "data-source-field" && !t.isDataSourceSettled(e.value.dataSourceId)) return !1;
1640
+ }
1641
+ return !0;
1642
+ }
1643
+ #d(e, t, n, r, i, a = !1) {
1644
+ let o = this.#e.readRenderer();
1645
+ if (o === void 0) return;
1646
+ let s = ++this.#n, c = this.#p(e, i, o);
1647
+ if (s === this.#n) {
1648
+ this.#r = !0;
1649
+ try {
1650
+ let i = o.setVariables(c);
1651
+ if (!i.ok) {
1652
+ this.#e.emitDiagnostics(i.diagnostics);
1653
+ return;
1654
+ }
1655
+ let s = o.render(e, {
1656
+ trigger: n,
1657
+ traceId: r ?? ""
1658
+ });
1659
+ if (!s.ok) {
1660
+ this.#e.emitDiagnostics(s.diagnostics);
1661
+ return;
1662
+ }
1663
+ s.diagnostics.length > 0 && this.#e.emitDiagnostics(s.diagnostics), this.#e.writeBlueprintVariables(c), a || (this.#c = !0), a && o.refreshData(t, n === "polling" ? "polling" : "manual", r);
1664
+ } finally {
1665
+ this.#r = !1;
1666
+ }
1667
+ this.#i && (this.#i = !1, this.#f("variable"));
1668
+ }
1669
+ }
1670
+ #f(e) {
1671
+ let t = this.#e.readRenderer(), n = this.#e.readDocument(), r = this.#e.readBlueprintPlan();
1672
+ if (t === void 0 || n === void 0 || r === void 0) return;
1673
+ let i = this.#p(n, r, t), a = this.#e.readBlueprintVariables();
1674
+ if (a !== void 0 && C(a) === C(i)) return;
1675
+ let o = ++this.#n;
1676
+ this.#r = !0;
1677
+ try {
1678
+ let r = t.setVariables(i);
1679
+ if (!r.ok) {
1680
+ this.#e.emitDiagnostics(r.diagnostics);
1681
+ return;
1682
+ }
1683
+ let a = t.render(n, {
1684
+ trigger: e,
1685
+ traceId: ""
1686
+ });
1687
+ if (!a.ok) {
1688
+ this.#e.emitDiagnostics(a.diagnostics);
1689
+ return;
1690
+ }
1691
+ if (a.diagnostics.length > 0 && this.#e.emitDiagnostics(a.diagnostics), o !== this.#n) return;
1692
+ this.#e.writeBlueprintVariables(i);
1693
+ } finally {
1694
+ this.#r = !1;
1695
+ }
1696
+ }
1697
+ #p(e, t, n) {
1698
+ let r = this.#e.readBlueprintVariables() ?? t.initialVariables, i = {}, a = /* @__PURE__ */ new Map();
1699
+ for (let t of e.variables) {
1700
+ let e = u(t), o = e.value;
1701
+ if (o.kind === "inline") {
1702
+ i[e.id] = r[e.id] ?? o.value;
1703
+ continue;
1704
+ }
1705
+ if (o.kind !== "data-source-field") {
1706
+ i[e.id] = e.initialValue;
1707
+ continue;
1708
+ }
1709
+ let s = n.evaluateValueRef(o);
1710
+ i[e.id] = s.kind === "value" && s.value !== void 0 ? s.value : e.controlled ? null : e.initialValue;
1711
+ let c = a.get(o.dataSourceId);
1712
+ c === void 0 ? a.set(o.dataSourceId, [e.id]) : c.push(e.id);
1713
+ }
1714
+ return this.#t = a, i;
1715
+ }
1716
+ #m(e) {
1717
+ return this.#e.readDocument()?.components.some((t) => t.id === e) ?? !1;
1718
+ }
1719
+ };
1720
+ function Q(e) {
1721
+ let t = u(e);
1722
+ if (t.value.kind === "data-source-field") return {
1723
+ ok: !1,
1724
+ diagnostics: [{
1725
+ severity: "error",
1726
+ code: "VARIABLE_WRITE_FORBIDDEN",
1727
+ path: ["variables", t.id],
1728
+ message: "Derived variable values are overwritten by the next data source refresh."
1729
+ }]
1730
+ };
1731
+ }
1732
+ function Ke(e, t, n) {
1733
+ if (e === void 0) return n;
1734
+ let r;
1735
+ for (let i of e.variables) {
1736
+ let e = u(i);
1737
+ $(t[e.id], n[e.id]) || Q(i) !== void 0 && (r ??= { ...n }, r[e.id] = t[e.id] ?? null);
1738
+ }
1739
+ return r ?? n;
1740
+ }
1741
+ var qe = class {
1742
+ host;
1743
+ #e = /* @__PURE__ */ new Map();
1744
+ constructor(e) {
1745
+ this.host = e;
1746
+ }
1747
+ get(e) {
1748
+ let t = this.host.readDocument()?.variables.find((t) => t.id === e);
1749
+ if (t === void 0) return;
1750
+ let n = this, r = u(t);
1751
+ return {
1752
+ id: e,
1753
+ get value() {
1754
+ let t = n.host.readVariables()?.[e];
1755
+ return t === void 0 ? r.value.kind === "inline" ? r.value.value : r.initialValue : t;
1756
+ },
1757
+ set: (r) => {
1758
+ let i = Q(t);
1759
+ return i === void 0 ? n.host.setValue(e, r) : i;
1760
+ },
1761
+ onChange: (t) => n.subscribe(e, t)
1762
+ };
1763
+ }
1764
+ clear() {
1765
+ this.#e.clear();
1766
+ }
1767
+ notify(e, t) {
1768
+ let n = [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !$(e[n], t[n]));
1769
+ for (let e of n) {
1770
+ let n = t[e] ?? null;
1771
+ for (let t of this.#e.get(e) ?? []) try {
1772
+ t(n);
1773
+ } catch {
1774
+ this.host.reportListenerFailure();
1775
+ }
1776
+ }
1777
+ return n;
1778
+ }
1779
+ subscribe(e, t) {
1780
+ let n = this.#e.get(e) ?? /* @__PURE__ */ new Set();
1781
+ return n.add(t), this.#e.set(e, n), () => {
1782
+ n.delete(t), n.size === 0 && this.#e.delete(e);
1783
+ };
1784
+ }
1785
+ };
1786
+ function $(e, t) {
1787
+ return JSON.stringify(e) === JSON.stringify(t);
1788
+ }
1789
+ var Je = globalThis.HTMLElement ?? class {}, Ye = class extends Je {
1790
+ #e;
1791
+ #t;
1792
+ #n;
1793
+ #r;
1794
+ #i;
1795
+ #a;
1796
+ #o;
1797
+ #s;
1798
+ #c;
1799
+ #l;
1800
+ #u;
1801
+ #d = 15e3;
1802
+ #f = "viewer";
1803
+ #p = "viewer";
1804
+ #m;
1805
+ #h;
1806
+ #g;
1807
+ #_;
1808
+ #v;
1809
+ #y = new qe({
1810
+ readDocument: () => this.#c,
1811
+ readVariables: () => this.#u,
1812
+ setValue: (e, t) => this.setVariableValue(e, t),
1813
+ reportListenerFailure: () => this.emitLifecycleDiagnostic("Variable change listener failed.")
1814
+ });
1815
+ #b = new Ge({
1816
+ readRenderer: () => this.#h,
1817
+ readDocument: () => this.#c,
1818
+ readBlueprintPlan: () => this.#l,
1819
+ readBlueprintVariables: () => this.#u,
1820
+ writeBlueprintVariables: (e) => {
1821
+ this.writeBlueprintVariables(e, !0);
1822
+ },
1823
+ emitDiagnostics: (e) => this.emitDiagnostics(e)
1824
+ });
1825
+ #x = new Z({
1826
+ readRenderer: () => this.#h,
1827
+ readDocument: () => this.#c
1828
+ });
1829
+ configure(e) {
1830
+ if (this.#h !== void 0) return X("Viewer 已初始化,请先 unload 再重新配置。");
1831
+ let t = Ue(e);
1832
+ if (!t.ok) return t;
1833
+ let n = t.value;
1834
+ return this.#e = n.catalog, this.#t = n.resourcePort, this.#n = n.datasetPort, this.#r = n.hostCatalogPort, this.#i = n.conditionalStylePort, this.#a = n.runtimeContributions, this.#o = n.blueprintRuntimePort, this.#s = n.blueprintHostActionPort, this.#d = n.resourceTimeoutMs, this.#f = n.instanceId ?? "viewer", this.#p = n.mode ?? "viewer", this.#m = n.observer, this.#_ = n.projectId, this.#v = n.documentRevision, this.initialize(), this.#b.start(void 0, !1, !0), this.#x.sync(this.#c), {
1835
+ ok: !0,
1836
+ value: null,
1837
+ diagnostics: []
1838
+ };
1839
+ }
1840
+ get catalog() {
1841
+ return this.#e;
1842
+ }
1843
+ set catalog(e) {
1844
+ if (this.#h !== void 0 && e !== this.#e) {
1845
+ this.emitLifecycleDiagnostic("Catalog cannot change after initialization. Call unload first.");
1846
+ return;
1847
+ }
1848
+ this.#e = e;
1849
+ }
1850
+ refreshCatalog(e) {
1851
+ let t = this.#e;
1852
+ if (t === void 0 || !Y(e)) return X("Viewer must have a configured catalog before refreshing a valid catalog.");
1853
+ if (t === e) return {
1854
+ ok: !0,
1855
+ value: null,
1856
+ diagnostics: []
1857
+ };
1858
+ let n = this.#h, r = this.#c;
1859
+ if (n === void 0) return r === void 0 ? (this.#e = e, {
1860
+ ok: !0,
1861
+ value: null,
1862
+ diagnostics: []
1863
+ }) : X("Catalog refresh requires an initialized renderer while a document is loaded.");
1864
+ if (r !== void 0) {
1865
+ let t = n.validateCatalog(r, e);
1866
+ if (!t.ok) return t;
1867
+ }
1868
+ let i = this.#b.hasDeferredDocument;
1869
+ try {
1870
+ let a = n.setCatalog(e);
1871
+ if (!a.ok) return a;
1872
+ let o = r === void 0 || i ? {
1873
+ ok: !0,
1874
+ value: null,
1875
+ diagnostics: []
1876
+ } : n.render(r);
1877
+ if (o.ok && !o.diagnostics.some((e) => e.severity === "error")) return this.#e = e, o;
1878
+ let s = n.setCatalog(t), c = s.ok && r !== void 0 && !i ? n.render(r) : s;
1879
+ return {
1880
+ ok: !1,
1881
+ diagnostics: [...o.diagnostics, ...c.diagnostics]
1882
+ };
1883
+ } catch {
1884
+ let e = X("Viewer catalog refresh failed.");
1885
+ try {
1886
+ let a = n.setCatalog(t), o = a.ok && r !== void 0 && !i ? n.render(r) : a;
1887
+ return {
1888
+ ok: !1,
1889
+ diagnostics: [...e.diagnostics, ...o.diagnostics]
1890
+ };
1891
+ } catch {
1892
+ return {
1893
+ ok: !1,
1894
+ diagnostics: [...e.diagnostics, ...X("Viewer catalog rollback failed.").diagnostics]
1895
+ };
1896
+ }
1897
+ }
1898
+ }
1899
+ get datasetPort() {
1900
+ return this.#n;
1901
+ }
1902
+ get resourcePort() {
1903
+ return this.#t;
1904
+ }
1905
+ get hostCatalogPort() {
1906
+ return this.#r;
1907
+ }
1908
+ get conditionalStylePort() {
1909
+ return this.#i;
1910
+ }
1911
+ set conditionalStylePort(e) {
1912
+ if (this.#h !== void 0 && e !== this.#i) {
1913
+ this.emitLifecycleDiagnostic("Conditional style port cannot change after initialization. Call unload first.");
1914
+ return;
1915
+ }
1916
+ this.#i = e;
1917
+ }
1918
+ get resourceTimeoutMs() {
1919
+ return this.#d;
1920
+ }
1921
+ set resourceTimeoutMs(e) {
1922
+ if (this.#h !== void 0 && e !== this.#d) {
1923
+ this.emitLifecycleDiagnostic("Resource timeout cannot change after initialization. Call unload first.");
1924
+ return;
1925
+ }
1926
+ if (!Number.isInteger(e) || e < 100 || e > 6e4) {
1927
+ this.emitLifecycleDiagnostic("Resource timeout must be an integer between 100 and 60000.");
1928
+ return;
1929
+ }
1930
+ this.#d = e;
1931
+ }
1932
+ set hostCatalogPort(e) {
1933
+ if (this.#h !== void 0 && e !== this.#r) {
1934
+ this.emitLifecycleDiagnostic("Host catalog port cannot change after initialization. Call unload first.");
1935
+ return;
1936
+ }
1937
+ this.#r = e;
1938
+ }
1939
+ set runtimeContributions(e) {
1940
+ if (this.#h !== void 0 && e !== this.#a) {
1941
+ this.emitLifecycleDiagnostic("Runtime contributions cannot change after initialization. Call unload first.");
1942
+ return;
1943
+ }
1944
+ this.#a = e;
1945
+ }
1946
+ set resourcePort(e) {
1947
+ if (this.#h !== void 0 && e !== this.#t) {
1948
+ this.emitLifecycleDiagnostic("Resource port cannot change after initialization. Call unload first.");
1949
+ return;
1950
+ }
1951
+ this.#t = e;
1952
+ }
1953
+ get blueprintRuntimePort() {
1954
+ return this.#o;
1955
+ }
1956
+ set blueprintRuntimePort(e) {
1957
+ this.#o = e;
1958
+ }
1959
+ get blueprintHostActionPort() {
1960
+ return this.#s;
1961
+ }
1962
+ set blueprintHostActionPort(e) {
1963
+ this.#s = e;
1964
+ }
1965
+ get document() {
1966
+ return this.#c;
1967
+ }
1968
+ set document(e) {
1969
+ this.#b.cancel(), this.#x.suspend(), this.#h?.resetBlueprintVisibility(), this.#c = e, this.compileBlueprint(), this.initialize(), this.#b.start(void 0, !1, !0), this.#x.resume();
1970
+ }
1971
+ connectedCallback() {
1972
+ this.initialize(), this.#b.start(void 0, !1, !0), this.#x.resume();
1973
+ }
1974
+ disconnectedCallback() {
1975
+ this.#x.suspend(), this.#b.cancel(), this.#h?.clear();
1976
+ }
1977
+ unload() {
1978
+ this.#x.dispose(), this.#b.reset(), this.#y.clear(), this.disposeRenderer(), this.#c = void 0, this.compileBlueprint();
1979
+ }
1980
+ refreshData(e) {
1981
+ this.#b.refreshData(e);
1982
+ }
1983
+ refreshVariables(e) {
1984
+ this.#b.refreshVariables(e);
1985
+ }
1986
+ refreshConditionalStyles(e) {
1987
+ this.#h?.refreshConditionalStyles(e);
1988
+ }
1989
+ getVariable(e) {
1990
+ return this.#y.get(e);
1991
+ }
1992
+ initialize() {
1993
+ if (!this.isConnected || this.#e === void 0 || this.#h !== void 0) return;
1994
+ let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
1995
+ this.#g = this.ownerDocument.createElement("div"), e.appendChild(this.#g), this.#h = q({
1996
+ root: this.#g,
1997
+ catalog: this.#e,
1998
+ mode: "viewer",
1999
+ interactive: !0,
2000
+ componentFailurePolicy: "skip",
2001
+ onMaterialEvent: (e) => {
2002
+ this.handleMaterialEvent(e), this.dispatchEvent(new CustomEvent("base-screen-material-event", {
2003
+ bubbles: !0,
2004
+ composed: !0,
2005
+ detail: e
2006
+ }));
2007
+ },
2008
+ resourcePort: this.#t,
2009
+ ...this.#n === void 0 ? {} : { datasetPort: this.#n },
2010
+ ...this.#r === void 0 ? {} : { hostCatalogPort: this.#r },
2011
+ onDataSourceSettled: (e) => this.#b.handleDataSourceSettled(e),
2012
+ ...this.#i === void 0 ? {} : { conditionalStylePort: this.#i },
2013
+ resourceTimeoutMs: this.#d,
2014
+ ...this.#a === void 0 ? {} : { contributionIndex: this.#a },
2015
+ ...this.#m === void 0 ? {} : { observer: this.#m },
2016
+ ...this.#f === void 0 ? {} : { instanceId: this.#f },
2017
+ ...this.#p === void 0 ? {} : { executionMode: this.#p },
2018
+ ...this.#_ === void 0 ? {} : { projectId: this.#_ },
2019
+ ...this.#v === void 0 ? {} : { documentRevision: this.#v }
2020
+ });
2021
+ }
2022
+ disposeRenderer() {
2023
+ this.#h?.dispose(), this.#h = void 0, this.#g?.remove(), this.#g = void 0;
2024
+ }
2025
+ compileBlueprint() {
2026
+ if (this.#c === void 0) {
2027
+ this.#l = void 0, this.#u = void 0;
2028
+ return;
2029
+ }
2030
+ let e = b(this.#c, this.#a ?? { hasBlueprintCapability: () => !1 });
2031
+ if (!e.ok) {
2032
+ this.#l = void 0, this.#u = void 0, this.dispatchEvent(new CustomEvent("base-screen-diagnostic", { detail: { diagnostics: e.diagnostics } }));
2033
+ return;
2034
+ }
2035
+ this.#l = e.value, this.#u = e.value.initialVariables;
2036
+ }
2037
+ handleMaterialEvent(e) {
2038
+ this.handleBlueprintEvent({
2039
+ type: "material-event",
2040
+ componentId: e.componentId,
2041
+ name: e.name,
2042
+ payload: e.payload
2043
+ });
2044
+ }
2045
+ handleBlueprintEvent(e, t = 0) {
2046
+ if (this.#l === void 0 || this.#u === void 0) return;
2047
+ if (t > 32) {
2048
+ this.emitLifecycleDiagnostic("Blueprint variable event cycle exceeded its limit.");
2049
+ return;
2050
+ }
2051
+ let n = this.#u, r = h(this.#l, n, e);
2052
+ if (!r.ok) {
2053
+ this.emitLifecycleDiagnostic("Blueprint event payload is invalid.");
2054
+ return;
2055
+ }
2056
+ let i = this.#h, a = this.#c, o = {
2057
+ ...r.value,
2058
+ variables: Ke(a, n, r.value.variables)
2059
+ }, s = this.writeBlueprintVariables(o.variables, !1);
2060
+ if (i !== void 0 && a !== void 0) {
2061
+ let e = Ie(i, a, n, o);
2062
+ e.length > 0 && this.emitDiagnostics(e);
2063
+ }
2064
+ for (let e of r.value.hostEvents) this.#o === void 0 ? this.dispatchEvent(new CustomEvent("base-screen-blueprint-event", { detail: e })) : Promise.resolve(this.#o.emit(e)).catch(() => {
2065
+ this.emitLifecycleDiagnostic("Blueprint host event failed.");
2066
+ });
2067
+ for (let e of r.value.hostActions) this.#s === void 0 ? this.emitLifecycleDiagnostic("Blueprint host action is unavailable.") : Promise.resolve(this.#s.execute(e)).catch(() => {
2068
+ this.emitLifecycleDiagnostic("Blueprint host action failed.");
2069
+ });
2070
+ for (let e of r.value.componentDataRequests) i?.refreshData(e);
2071
+ r.value.variableRequests.length > 0 && this.#b.refreshVariables({ variableIds: [...new Set(r.value.variableRequests)] });
2072
+ for (let e of s) this.handleBlueprintEvent({
2073
+ type: "variable-event",
2074
+ variableId: e,
2075
+ name: "data-updated",
2076
+ payload: r.value.variables[e] ?? null
2077
+ }, t + 1);
2078
+ }
2079
+ setVariableValue(t, n) {
2080
+ let r = e(n);
2081
+ if (!r.ok) return r;
2082
+ let i = this.#h, a = this.#c, o = this.#u, s = a?.variables.find((e) => e.id === t);
2083
+ if (i === void 0 || a === void 0 || o === void 0 || s === void 0) return X("Viewer variable is unavailable.");
2084
+ let c = Q(s);
2085
+ if (c !== void 0) return c;
2086
+ if ($(o[t], r.value)) return {
2087
+ ok: !0,
2088
+ value: null,
2089
+ diagnostics: []
2090
+ };
2091
+ let l = {
2092
+ ...o,
2093
+ [t]: r.value
2094
+ }, u = i.setVariables(l);
2095
+ if (!u.ok) return u;
2096
+ let d = i.render(a, { trigger: "variable" });
2097
+ return d.ok ? (this.writeBlueprintVariables(l, !1), this.handleBlueprintEvent({
2098
+ type: "variable-event",
2099
+ variableId: t,
2100
+ name: "data-updated",
2101
+ payload: r.value
2102
+ }), {
2103
+ ok: !0,
2104
+ value: null,
2105
+ diagnostics: d.diagnostics
2106
+ }) : (i.setVariables(o), d);
2107
+ }
2108
+ writeBlueprintVariables(e, t = !1) {
2109
+ let n = this.#u;
2110
+ if (this.#u = e, n === void 0) return [];
2111
+ let r = this.#y.notify(n, e);
2112
+ if (t) for (let t of r) this.handleBlueprintEvent({
2113
+ type: "variable-event",
2114
+ variableId: t,
2115
+ name: "data-updated",
2116
+ payload: e[t] ?? null
2117
+ });
2118
+ return r;
2119
+ }
2120
+ emitDiagnostics(e) {
2121
+ this.dispatchEvent(new CustomEvent("base-screen-diagnostic", { detail: { diagnostics: e } }));
2122
+ }
2123
+ emitLifecycleDiagnostic(e) {
2124
+ this.emitDiagnostics([{
2125
+ severity: "error",
2126
+ code: "PLUGIN_CORE_LIFECYCLE_INVALID",
2127
+ path: [],
2128
+ message: e
2129
+ }]);
2130
+ }
2131
+ };
2132
+ //#endregion
2133
+ export { q as n, Ye as t };
2134
+
2135
+ //# sourceMappingURL=dist-CAdGDmU3.js.map