@sim-design/training 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +481 -15
  2. package/dist/{ArrowLeftOutlined-CiSQq3bL.js → ArrowLeftOutlined-BxA84GXs.js} +1 -1
  3. package/dist/ArrowLeftOutlined-D785XjyB.js +12 -0
  4. package/dist/{AssessmentPlugin-Bx4VrBdV.js → AssessmentPlugin-D_iesmyg.js} +7 -7
  5. package/dist/AssessmentPlugin-zRr-IsdA.js +607 -0
  6. package/dist/CaseAnalysisPlugin-CXuQpkPd.js +2196 -0
  7. package/dist/CaseAnalysisPlugin-DytlXsRD.js +2196 -0
  8. package/dist/CaseDetailContent-DT5nCtRT.js +28613 -0
  9. package/dist/CaseDetailContent-Y7Q430MG.js +28595 -0
  10. package/dist/{CharacterDialoguePanel-Bvdab3qj.js → CharacterDialoguePanel-CdtUl-Sv.js} +178 -139
  11. package/dist/CharacterDialoguePanel-D_4YNFZv.js +815 -0
  12. package/dist/{CheckCircleFilled-Byo8CDfW.js → CheckCircleFilled-CnslIY7j.js} +1 -1
  13. package/dist/CheckCircleFilled-NvZaC2sk.js +12 -0
  14. package/dist/DecisionMakingPlugin-B_KQUFzW.js +1385 -0
  15. package/dist/DecisionMakingPlugin-ILLGek3S.js +1385 -0
  16. package/dist/{DecisionSelectPlugin-DtQ2KV34.js → DecisionSelectPlugin-BGQiHGBK.js} +20 -11
  17. package/dist/DecisionSelectPlugin-Bqmh6XGh.js +872 -0
  18. package/dist/{DecisionShared-Dh9oeQFT.js → DecisionShared-BHq1lEqt.js} +2 -2
  19. package/dist/DecisionShared-Be-zKZLT.js +65 -0
  20. package/dist/DeleteOutlined-BvMjU7m5.js +12 -0
  21. package/dist/DeleteOutlined-Dqy6M2LH.js +12 -0
  22. package/dist/{CustomLayoutRenderer--rnQrqQ2.js → DialogueFormPlugin-BpCeFadt.js} +22724 -21631
  23. package/dist/DialogueFormPlugin-CXlbxX-z.js +123617 -0
  24. package/dist/DialoguePlugin-CO7Nzv0K.js +596 -0
  25. package/dist/DialoguePlugin-DDNdsylz.js +596 -0
  26. package/dist/DocumentReviewPlugin-2CnKQwVG.js +1967 -0
  27. package/dist/DocumentReviewPlugin-qYYrnjvE.js +1967 -0
  28. package/dist/{EyeOutlined-XvOAKlLs.js → EyeOutlined-BrKCNjui.js} +1 -1
  29. package/dist/EyeOutlined-CW0tYV0f.js +12 -0
  30. package/dist/FormFillingPlugin-C3h8ySOZ.js +969 -0
  31. package/dist/FormFillingPlugin-CPmd76Qr.js +969 -0
  32. package/dist/HolderOutlined-CH0tShWu.js +12 -0
  33. package/dist/HolderOutlined-Dm6TBtqf.js +12 -0
  34. package/dist/ModelEditor-BjEbFloQ.js +11753 -0
  35. package/dist/ModelEditor-CwR67DFQ.js +11753 -0
  36. package/dist/{ProcessOperationPlugin-IijngDlX.js → ProcessOperationPlugin-1Lz431aC.js} +12 -12
  37. package/dist/ProcessOperationPlugin-BkmdG3ch.js +88 -0
  38. package/dist/QAPlugin-0C4kpq3J.js +172 -0
  39. package/dist/QAPlugin-UC8uywcg.js +172 -0
  40. package/dist/{ReloadOutlined-Daor2m11.js → ReloadOutlined-BZ92nlYF.js} +1 -1
  41. package/dist/ReloadOutlined-CYoPOwLl.js +12 -0
  42. package/dist/{SettingOutlined-CLEOgXB-.js → SettingOutlined-F466s0Ti.js} +33 -65
  43. package/dist/SettingOutlined-c2hikCfN.js +60 -0
  44. package/dist/StarFilled-Bilmj6UK.js +28 -0
  45. package/dist/StarFilled-CtH30fL0.js +28 -0
  46. package/dist/StrategyLabPlugin-CvO07sXV.js +12445 -0
  47. package/dist/StrategyLabPlugin-DUqZYctQ.js +12445 -0
  48. package/dist/ThunderboltOutlined-BpmoCKdV.js +28 -0
  49. package/dist/ThunderboltOutlined-DDQFi5Cv.js +28 -0
  50. package/dist/TrainingModelContainer-DqCsdC7C.js +11241 -0
  51. package/dist/TrainingModelContainer-yi8W6KFl.js +11241 -0
  52. package/dist/{UndoOutlined-ChUQYUul.js → UndoOutlined-6JZVzmdX.js} +26 -42
  53. package/dist/UndoOutlined-Dw6_9_OL.js +68 -0
  54. package/dist/{WarningFilled-1Rc4hr0C.js → WarningFilled-Cy1tvuQy.js} +1 -1
  55. package/dist/WarningFilled-lkr453eh.js +12 -0
  56. package/dist/{adapters-D1FFZFoA.js → adapters-BbCnXSYo.js} +2 -2
  57. package/dist/{analysisTools-CXyOvSZT.js → analysisTools-Cp5-3DaU.js} +59 -12
  58. package/dist/creator.js +4 -2
  59. package/dist/designTokens-walF_QkZ.js +23 -0
  60. package/dist/images/healthcare/bg.jpg +0 -0
  61. package/dist/{index-CYjdXPgc.js → index-C71iHgSs.js} +2640 -2722
  62. package/dist/{index-XuBVjlmu.js → index-CBvqcbIU.js} +7214 -7643
  63. package/dist/index-D94YNWTb.js +433 -0
  64. package/dist/index-DSYmOXnQ.js +6486 -0
  65. package/dist/index-fP97rKeQ.js +433 -0
  66. package/dist/index.js +8 -6
  67. package/dist/judgement-xTGXlDcn.js +29 -0
  68. package/dist/runtime.js +1 -1
  69. package/dist/sortable.esm-bm_c5vmI.js +3307 -0
  70. package/dist/types.js +1 -1
  71. package/dist/useDialogueLogic-D1lkUKUZ.js +576 -0
  72. package/dist/useDialogueLogic-vOJ9XRNP.js +576 -0
  73. package/dist-types/client/src/admin/CaseDataEditor.d.ts +20 -0
  74. package/dist-types/client/src/admin/CaseEditor.d.ts +19 -0
  75. package/dist-types/client/src/admin/DialogueFormCheckRulesEditor.d.ts +11 -0
  76. package/dist-types/client/src/admin/DialogueFormInitDataEditor.d.ts +31 -0
  77. package/dist-types/client/src/admin/InitDataEditors.d.ts +7 -0
  78. package/dist-types/client/src/admin/ModelEditor.d.ts +11 -0
  79. package/dist-types/client/src/admin/ModelPreview.d.ts +13 -0
  80. package/dist-types/client/src/admin/OptionSelector.d.ts +32 -0
  81. package/dist-types/client/src/admin/StageStepEditor.d.ts +20 -0
  82. package/dist-types/client/src/admin/StepAnswerKeyEditor.d.ts +19 -0
  83. package/dist-types/client/src/admin/StepByStepCreator.d.ts +27 -0
  84. package/dist-types/client/src/admin/components/AbilityMapEditor.d.ts +12 -0
  85. package/dist-types/client/src/admin/components/CasePreview.d.ts +8 -0
  86. package/dist-types/client/src/admin/components/StepAbilitySelector.d.ts +9 -0
  87. package/dist-types/client/src/admin/constants/creatorConstants.d.ts +39 -0
  88. package/dist-types/client/src/admin/editors/CaseAnalysisEditor.d.ts +11 -0
  89. package/dist-types/client/src/admin/editors/DecisionMakingEditor.d.ts +7 -0
  90. package/dist-types/client/src/admin/editors/DialogueEditor.d.ts +12 -0
  91. package/dist-types/client/src/admin/editors/DocumentReviewEditor.d.ts +7 -0
  92. package/dist-types/client/src/admin/editors/DocumentReviewRuntimeRulesEditor.d.ts +15 -0
  93. package/dist-types/client/src/admin/editors/FormFillingEditor.d.ts +33 -0
  94. package/dist-types/client/src/admin/editors/ModelUIConfigEditor.d.ts +5 -0
  95. package/dist-types/client/src/admin/editors/QAEditor.d.ts +6 -0
  96. package/dist-types/client/src/admin/editors/RouterEditors.d.ts +18 -0
  97. package/dist-types/client/src/admin/editors/StepBriefingEditor.d.ts +14 -0
  98. package/dist-types/client/src/admin/editors/StrategyLabEditor.d.ts +24 -0
  99. package/dist-types/client/src/admin/editors/decisionEditorParts.d.ts +18 -0
  100. package/dist-types/client/src/admin/editors/index.d.ts +8 -0
  101. package/dist-types/client/src/admin/editors/shared.d.ts +17 -0
  102. package/dist-types/client/src/admin/hooks/useStep1Intent.d.ts +16 -0
  103. package/dist-types/client/src/admin/hooks/useStep2Outline.d.ts +41 -0
  104. package/dist-types/client/src/admin/hooks/useStep3Details.d.ts +123 -0
  105. package/dist-types/client/src/admin/hooks/useStep4Cases.d.ts +48 -0
  106. package/dist-types/client/src/admin/hooks/useStep5Validation.d.ts +16 -0
  107. package/dist-types/client/src/admin/landingValidation.d.ts +74 -0
  108. package/dist-types/client/src/admin/schemaFieldUtils.d.ts +55 -0
  109. package/dist-types/client/src/admin/services.d.ts +461 -0
  110. package/dist-types/client/src/admin/shared-editors.d.ts +31 -0
  111. package/dist-types/client/src/admin/types/creatorArtifacts.d.ts +140 -0
  112. package/dist-types/client/src/components/AbilityMapView.d.ts +15 -0
  113. package/dist-types/client/src/components/CaseDetail/CaseDetailContent.d.ts +12 -0
  114. package/dist-types/client/src/components/ConversationalDataCollector/IntentConfirmPanel.d.ts +20 -0
  115. package/dist-types/client/src/components/ConversationalDataCollector/index.d.ts +7 -0
  116. package/dist-types/client/src/components/ConversationalDataCollector/intentState.d.ts +24 -0
  117. package/dist-types/client/src/components/ConversationalDataCollector/types.d.ts +95 -0
  118. package/dist-types/client/src/components/ConversationalDataCollector/utils.d.ts +62 -0
  119. package/dist-types/client/src/components/CustomLayoutRenderer.d.ts +8 -0
  120. package/dist-types/client/src/components/MarkdownRenderer.d.ts +15 -0
  121. package/dist-types/client/src/components/StrategyLabScene/VisualInputComponents.d.ts +85 -0
  122. package/dist-types/client/src/components/StrategyLabScene/components/AdversarialView.d.ts +18 -0
  123. package/dist-types/client/src/components/StrategyLabScene/components/BottomBar.d.ts +22 -0
  124. package/dist-types/client/src/components/StrategyLabScene/components/CharacterCard.d.ts +14 -0
  125. package/dist-types/client/src/components/StrategyLabScene/components/CharacterDialoguePanel.d.ts +32 -0
  126. package/dist-types/client/src/components/StrategyLabScene/components/CollaborativeView.d.ts +20 -0
  127. package/dist-types/client/src/components/StrategyLabScene/components/ComparisonView.d.ts +16 -0
  128. package/dist-types/client/src/components/StrategyLabScene/components/DecisionInput.d.ts +27 -0
  129. package/dist-types/client/src/components/StrategyLabScene/components/DecisionSwitcher.d.ts +14 -0
  130. package/dist-types/client/src/components/StrategyLabScene/components/EvaluationReport.d.ts +13 -0
  131. package/dist-types/client/src/components/StrategyLabScene/components/NodeChainPanels.d.ts +32 -0
  132. package/dist-types/client/src/components/StrategyLabScene/components/ProgressSteps.d.ts +15 -0
  133. package/dist-types/client/src/components/StrategyLabScene/components/SandboxView.d.ts +19 -0
  134. package/dist-types/client/src/components/StrategyLabScene/components/ScenarioPanel.d.ts +17 -0
  135. package/dist-types/client/src/components/StrategyLabScene/components/SimulationAnimation.d.ts +13 -0
  136. package/dist-types/client/src/components/StrategyLabScene/components/SimulationResult.d.ts +15 -0
  137. package/dist-types/client/src/components/StrategyLabScene/components/StressTestView.d.ts +22 -0
  138. package/dist-types/client/src/components/StrategyLabScene/themeMatching.d.ts +21 -0
  139. package/dist-types/client/src/components/StrategyLabScene/themes/education.d.ts +45 -0
  140. package/dist-types/client/src/components/StrategyLabScene/themes/healthcare.d.ts +7 -0
  141. package/dist-types/client/src/components/StrategyLabScene/themes/index.d.ts +22 -0
  142. package/dist-types/client/src/components/StrategyLabScene/themes/professional.d.ts +7 -0
  143. package/dist-types/client/src/components/StrategyLabScene/themes/technology.d.ts +7 -0
  144. package/dist-types/client/src/components/StrategyLabScene/types.d.ts +82 -0
  145. package/dist-types/client/src/components/StrategyLabScene/views/UnifiedStrategyLabView.d.ts +72 -0
  146. package/dist-types/client/src/components/TrainingEngine/BriefingQAChat.d.ts +19 -0
  147. package/dist-types/client/src/components/TrainingEngine/CaseInfoModal.d.ts +12 -0
  148. package/dist-types/client/src/components/TrainingEngine/CaseSelector.d.ts +15 -0
  149. package/dist-types/client/src/components/TrainingEngine/ClassicView.d.ts +7 -0
  150. package/dist-types/client/src/components/TrainingEngine/DashboardHomePage.d.ts +7 -0
  151. package/dist-types/client/src/components/TrainingEngine/EnhancedStudentProfilePanel.d.ts +9 -0
  152. package/dist-types/client/src/components/TrainingEngine/EvaluationPanel.d.ts +8 -0
  153. package/dist-types/client/src/components/TrainingEngine/GlobalQAPanel.d.ts +34 -0
  154. package/dist-types/client/src/components/TrainingEngine/GuidanceHistoryDrawer.d.ts +7 -0
  155. package/dist-types/client/src/components/TrainingEngine/GuidancePanel.d.ts +3 -0
  156. package/dist-types/client/src/components/TrainingEngine/ImmersiveGameView.d.ts +7 -0
  157. package/dist-types/client/src/components/TrainingEngine/PluginRenderer.d.ts +15 -0
  158. package/dist-types/client/src/components/TrainingEngine/ProgressTracker.d.ts +3 -0
  159. package/dist-types/client/src/components/TrainingEngine/StageAssessingOverlay.d.ts +17 -0
  160. package/dist-types/client/src/components/TrainingEngine/StageAssessmentPanel.d.ts +10 -0
  161. package/dist-types/client/src/components/TrainingEngine/StepExecutor.d.ts +20 -0
  162. package/dist-types/client/src/components/TrainingEngine/StepNodeMap.d.ts +15 -0
  163. package/dist-types/client/src/components/TrainingEngine/StudentProfilePanel.d.ts +6 -0
  164. package/dist-types/client/src/components/TrainingEngine/ThemeContext.d.ts +8 -0
  165. package/dist-types/client/src/components/TrainingEngine/TrainingMaterialsSidebar.d.ts +21 -0
  166. package/dist-types/client/src/components/TrainingEngine/TrainingModelContainer.d.ts +42 -0
  167. package/dist-types/client/src/components/TrainingEngine/ViewProps.d.ts +37 -0
  168. package/dist-types/client/src/components/TrainingEngine/profileDataSelectors.d.ts +23 -0
  169. package/dist-types/client/src/components/TrainingEngine/stepInitData.d.ts +42 -0
  170. package/dist-types/client/src/components/TrainingEngine/targetAbilityUtils.d.ts +11 -0
  171. package/dist-types/client/src/components/VisualizationRenderer/ChartRenderer.d.ts +12 -0
  172. package/dist-types/client/src/components/VisualizationRenderer/types.d.ts +41 -0
  173. package/dist-types/client/src/config/appConfig.d.ts +15 -0
  174. package/dist-types/client/src/configs/agentConfig.d.ts +66 -0
  175. package/dist-types/client/src/configs/intentDiscoveryConfig.d.ts +22 -0
  176. package/dist-types/client/src/data/mockTrainingModel.d.ts +10 -0
  177. package/dist-types/client/src/hooks/useAIService.d.ts +17 -0
  178. package/dist-types/client/src/hooks/useDialogueLogic.d.ts +53 -0
  179. package/dist-types/client/src/hooks/useFormFillingLogic.d.ts +26 -0
  180. package/dist-types/client/src/hooks/useFormRealtimeGuidance.d.ts +45 -0
  181. package/dist-types/client/src/hooks/useRealtimeGuidance.d.ts +66 -0
  182. package/dist-types/client/src/hooks/useStageAssessment.d.ts +8 -0
  183. package/dist-types/client/src/hooks/useStepExecution.d.ts +14 -0
  184. package/dist-types/client/src/hooks/useTrainingModel.d.ts +30 -0
  185. package/dist-types/client/src/lib/creator.d.ts +1 -0
  186. package/dist-types/client/src/lib/index.d.ts +1 -0
  187. package/dist-types/client/src/lib/types.d.ts +113 -22
  188. package/dist-types/client/src/plugins/AssessmentPlugin.d.ts +8 -0
  189. package/dist-types/client/src/plugins/CaseAnalysisPlugin.d.ts +9 -0
  190. package/dist-types/client/src/plugins/CaseAnalysisPluginView.d.ts +26 -0
  191. package/dist-types/client/src/plugins/DecisionSelectPlugin.d.ts +8 -0
  192. package/dist-types/client/src/plugins/DialogueFormPlugin.d.ts +9 -0
  193. package/dist-types/client/src/plugins/DialogueFormPluginView.d.ts +37 -0
  194. package/dist-types/client/src/plugins/DialoguePlugin.d.ts +8 -0
  195. package/dist-types/client/src/plugins/DialoguePluginView.d.ts +44 -0
  196. package/dist-types/client/src/plugins/DocumentReview/DocumentCard.d.ts +47 -0
  197. package/dist-types/client/src/plugins/DocumentReview/LayoutComponents.d.ts +47 -0
  198. package/dist-types/client/src/plugins/DocumentReview/MarkListPanel.d.ts +51 -0
  199. package/dist-types/client/src/plugins/DocumentReview/MarkModal.d.ts +37 -0
  200. package/dist-types/client/src/plugins/DocumentReview/ResultPanel.d.ts +32 -0
  201. package/dist-types/client/src/plugins/DocumentReview/Toolbar.d.ts +31 -0
  202. package/dist-types/client/src/plugins/DocumentReview/designTokens.d.ts +76 -0
  203. package/dist-types/client/src/plugins/DocumentReviewPlugin.d.ts +14 -0
  204. package/dist-types/client/src/plugins/ProcessOperationPlugin.d.ts +8 -0
  205. package/dist-types/client/src/plugins/QAPlugin.d.ts +9 -0
  206. package/dist-types/client/src/plugins/StrategyLabPlugin.d.ts +7 -0
  207. package/dist-types/client/src/plugins/decision-making/DecisionMakingPlugin.d.ts +4 -0
  208. package/dist-types/client/src/plugins/decision-making/DecisionWorkspace.d.ts +23 -0
  209. package/dist-types/client/src/plugins/decision-making/MaterialsPanel.d.ts +18 -0
  210. package/dist-types/client/src/plugins/decision-making/logic.d.ts +46 -0
  211. package/dist-types/client/src/plugins/decision-making/scoring.d.ts +79 -0
  212. package/dist-types/client/src/plugins/decision-making/styles.d.ts +743 -0
  213. package/dist-types/client/src/plugins/decision-making/types.d.ts +179 -0
  214. package/dist-types/client/src/plugins/form-filling/DocumentFormLayout.d.ts +22 -0
  215. package/dist-types/client/src/plugins/form-filling/FormAssistPanel.d.ts +20 -0
  216. package/dist-types/client/src/plugins/form-filling/FormFillingPlugin.d.ts +15 -0
  217. package/dist-types/client/src/plugins/form-filling/forms.d.ts +28 -0
  218. package/dist-types/client/src/plugins/form-filling/scoring.d.ts +86 -0
  219. package/dist-types/client/src/plugins/form-filling/useFormFilling.d.ts +42 -0
  220. package/dist-types/client/src/plugins/form-filling/validationRules.d.ts +26 -0
  221. package/dist-types/client/src/plugins/shared/DecisionShared.d.ts +54 -0
  222. package/dist-types/client/src/plugins/shared/FrameworkWidget.d.ts +19 -0
  223. package/dist-types/client/src/plugins/shared/PluginFooter.d.ts +4 -0
  224. package/dist-types/client/src/plugins/shared/PluginHeader.d.ts +4 -0
  225. package/dist-types/client/src/plugins/shared/analysisTools.d.ts +30 -0
  226. package/dist-types/client/src/plugins/shared/disturbanceUtils.d.ts +5 -0
  227. package/dist-types/client/src/plugins/shared/index.d.ts +5 -0
  228. package/dist-types/client/src/plugins/shared/jsonRepair.d.ts +39 -0
  229. package/dist-types/client/src/plugins/shared/judgement.d.ts +46 -0
  230. package/dist-types/client/src/plugins/shared/nodeChain.d.ts +15 -0
  231. package/dist-types/client/src/plugins/shared/renderFieldGrid.d.ts +16 -0
  232. package/dist-types/client/src/plugins/shared/reportBlocks.d.ts +33 -0
  233. package/dist-types/client/src/plugins/shared/reportEvaluation.d.ts +30 -0
  234. package/dist-types/client/src/plugins/shared/reportExport.d.ts +12 -0
  235. package/dist-types/client/src/plugins/shared/reportWorkbench/BlockPropertiesPanel.d.ts +9 -0
  236. package/dist-types/client/src/plugins/shared/reportWorkbench/BlockToolbox.d.ts +11 -0
  237. package/dist-types/client/src/plugins/shared/reportWorkbench/ReportWorkbench.d.ts +20 -0
  238. package/dist-types/client/src/plugins/shared/reportWorkbench/SortableBlock.d.ts +15 -0
  239. package/dist-types/client/src/plugins/shared/reportWorkbench/factory.d.ts +14 -0
  240. package/dist-types/client/src/plugins/shared/reportWorkbench/outlineDraft.d.ts +7 -0
  241. package/dist-types/client/src/plugins/shared/simulationEngine.d.ts +112 -0
  242. package/dist-types/client/src/plugins/shared/simulationModes.d.ts +21 -0
  243. package/dist-types/client/src/plugins/shared/themes.d.ts +5 -0
  244. package/dist-types/client/src/plugins/shared/types.d.ts +1247 -0
  245. package/dist-types/client/src/services/AICommandHandler.d.ts +68 -0
  246. package/dist-types/client/src/services/cozeApiClient.d.ts +44 -0
  247. package/dist-types/client/src/services/mockApi.d.ts +48 -0
  248. package/dist-types/client/src/services/storageService.d.ts +88 -0
  249. package/dist-types/client/src/stores/abilityStore.d.ts +33 -0
  250. package/dist-types/client/src/stores/dialogueStore.d.ts +30 -0
  251. package/dist-types/client/src/stores/formRegistryStore.d.ts +45 -0
  252. package/dist-types/client/src/stores/guidanceStore.d.ts +17 -0
  253. package/dist-types/client/src/stores/stepEvidenceStore.d.ts +14 -0
  254. package/dist-types/client/src/stores/strategyLabStore.d.ts +46 -0
  255. package/dist-types/client/src/stores/trainingStore.d.ts +84 -0
  256. package/dist-types/client/src/types/ai-commands.d.ts +144 -0
  257. package/dist-types/client/src/types.d.ts +17 -0
  258. package/dist-types/client/src/utils/abilityMapGenerator.d.ts +27 -0
  259. package/dist-types/client/src/utils/formUtils.d.ts +66 -0
  260. package/dist-types/client/src/utils/rule-engine.d.ts +36 -0
  261. package/dist-types/shared/types/index.d.ts +592 -0
  262. package/package.json +5 -3
  263. package/dist/CaseAnalysisPlugin-CQvF9_zr.js +0 -416
  264. package/dist/DialogueFormPlugin-C9ssnVMr.js +0 -959
  265. package/dist/DialoguePlugin-DU00QpmQ.js +0 -416
  266. package/dist/DocumentReviewPlugin-HNOZY1T4.js +0 -977
  267. package/dist/FormFillingPlugin-DURWsioi.js +0 -445
  268. package/dist/ModelEditor-BPJsPR0S.js +0 -8264
  269. package/dist/PluginHeader-B-GESJmT.js +0 -87
  270. package/dist/QAPlugin-Bh_UjK1N.js +0 -184
  271. package/dist/RadarChart-C5ZM0kWt.js +0 -24963
  272. package/dist/StrategyLabPlugin-DGeZsr_7.js +0 -14361
  273. package/dist/ThunderboltOutlined-nH_FO_4A.js +0 -44
  274. package/dist/ToolOutlined-DtuNJDB2.js +0 -28
  275. package/dist/TrainingModelContainer-DpW-uB8O.js +0 -11883
  276. package/dist/WarningOutlined-5g1d66hO.js +0 -164
  277. package/dist/judgement-D_9i7x9S.js +0 -20
  278. package/dist/useDialogueLogic-IHELcN3X.js +0 -368
@@ -0,0 +1,1385 @@
1
+ import { j as e, u as ye, a as ke, r as Se } from "./CaseDetailContent-DT5nCtRT.js";
2
+ import { useRef as te, useMemo as oe, useEffect as de, useState as U, useCallback as R } from "react";
3
+ const j = "#389e0d", ve = "#237804", K = "#f0fdf4", fe = "#dcfce7", le = "#1890ff", je = "#096dd9", ce = "#52c41a", w = "#e8e8e8", se = "#fafafa", V = "#8c8c8c", H = "#434343", L = 13, Y = 16, Z = 19, Ce = 22, we = (o) => o, t = we({
4
+ /* ---------- 整体骨架(填满父容器 + min-height 兜底,兼容 inline/modal) ---------- */
5
+ root: {
6
+ display: "flex",
7
+ flexDirection: "column",
8
+ height: "100%",
9
+ minHeight: "78vh",
10
+ background: "#fff",
11
+ overflow: "hidden"
12
+ },
13
+ scenarioBar: {
14
+ flexShrink: 0,
15
+ padding: "12px 22px",
16
+ background: "linear-gradient(135deg, #e6f7ff, #f0f5ff)",
17
+ borderBottom: `1px solid ${w}`,
18
+ display: "flex",
19
+ gap: 10,
20
+ alignItems: "flex-start"
21
+ },
22
+ scenarioBarLabel: {
23
+ flexShrink: 0,
24
+ fontSize: 18,
25
+ fontWeight: 700,
26
+ color: je,
27
+ background: "#fff",
28
+ border: "1px solid #91d5ff",
29
+ borderRadius: 4,
30
+ padding: "2px 8px",
31
+ marginTop: 1
32
+ },
33
+ scenarioBarText: {
34
+ fontSize: 17,
35
+ lineHeight: 1.6,
36
+ color: H,
37
+ maxHeight: 96,
38
+ overflowY: "auto",
39
+ whiteSpace: "pre-wrap"
40
+ },
41
+ workspace: { display: "flex", flex: 1, overflow: "hidden", minHeight: 0 },
42
+ /* ---------- 左栏:材料 ---------- */
43
+ panelMaterials: {
44
+ width: "48%",
45
+ minWidth: 340,
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ borderRight: `1px solid ${w}`,
49
+ minHeight: 0
50
+ },
51
+ materialHeader: {
52
+ flexShrink: 0,
53
+ padding: "20px 28px",
54
+ borderBottom: `1px solid ${w}`,
55
+ fontSize: Z,
56
+ fontWeight: 700,
57
+ color: H,
58
+ display: "flex",
59
+ alignItems: "center"
60
+ },
61
+ tabNav: {
62
+ flexShrink: 0,
63
+ display: "flex",
64
+ gap: 4,
65
+ padding: "0 20px",
66
+ background: se,
67
+ borderBottom: `1px solid ${w}`,
68
+ overflowX: "auto"
69
+ },
70
+ tab: {
71
+ padding: "12px 22px",
72
+ cursor: "pointer",
73
+ fontSize: L,
74
+ color: V,
75
+ // 拆分写法:tabActive 只改 borderBottomColor,基态用 borderBottom 简写会在切走激活态时触发样式冲突告警
76
+ borderBottomWidth: 2,
77
+ borderBottomStyle: "solid",
78
+ borderBottomColor: "transparent",
79
+ whiteSpace: "nowrap",
80
+ userSelect: "none",
81
+ background: "transparent",
82
+ border: "none",
83
+ transition: "all .2s"
84
+ },
85
+ tabActive: { color: le, fontWeight: 600, borderBottomColor: le, background: "#fff" },
86
+ materialBody: { flex: 1, overflowY: "auto", padding: "26px", minHeight: 0, scrollBehavior: "smooth" },
87
+ /* ---------- 材料块:richText ---------- */
88
+ sectionTitle: {
89
+ fontSize: Z,
90
+ fontWeight: 700,
91
+ color: H,
92
+ margin: "24px 0 16px",
93
+ paddingLeft: 14,
94
+ borderLeft: `3px solid ${j}`,
95
+ lineHeight: 1.4
96
+ },
97
+ /** 可标注块的统一包裹层:提供定位上下文 + 右侧为「+」按钮留白 */
98
+ markableWrap: {
99
+ position: "relative",
100
+ marginBottom: 18,
101
+ paddingRight: 40,
102
+ borderRadius: 4,
103
+ transition: "background .15s"
104
+ },
105
+ paragraphBase: {
106
+ fontSize: Y,
107
+ lineHeight: 1.95,
108
+ color: H,
109
+ textAlign: "justify",
110
+ margin: 0
111
+ },
112
+ markerBtn: {
113
+ position: "absolute",
114
+ right: 6,
115
+ top: 10,
116
+ width: 28,
117
+ height: 28,
118
+ borderRadius: "50%",
119
+ background: j,
120
+ color: "#fff",
121
+ border: "none",
122
+ cursor: "pointer",
123
+ fontSize: 18,
124
+ lineHeight: 1,
125
+ display: "flex",
126
+ alignItems: "center",
127
+ justifyContent: "center",
128
+ boxShadow: "0 2px 8px rgba(56,158,13,.4)"
129
+ },
130
+ /** 块下方标注标签条(统一展示该块已有标注) */
131
+ blockMarkersBar: { display: "flex", flexWrap: "wrap", gap: 6, marginTop: 8 },
132
+ inlineTag: {
133
+ display: "inline-block",
134
+ padding: "2px 10px",
135
+ borderRadius: 12,
136
+ fontSize: 12,
137
+ cursor: "pointer",
138
+ transition: "transform .15s"
139
+ },
140
+ /* ---------- 材料块:table ---------- */
141
+ tableWrap: { overflowX: "auto", borderRadius: 10, border: `1px solid ${w}` },
142
+ table: { width: "100%", borderCollapse: "collapse", fontSize: L },
143
+ th: {
144
+ background: `linear-gradient(180deg, ${K}, ${fe})`,
145
+ padding: "12px 15px",
146
+ textAlign: "left",
147
+ fontWeight: 600,
148
+ color: H,
149
+ borderBottom: "2px solid #86efac",
150
+ whiteSpace: "nowrap"
151
+ },
152
+ td: { padding: "11px 15px", borderBottom: `1px solid ${w}`, color: "#595959" },
153
+ cellWarning: { color: "#d46b08", fontWeight: 700, background: "#fffbe6" },
154
+ cellDanger: { color: "#cf1322", fontWeight: 700, background: "#fff1f0" },
155
+ /* ---------- 材料块:infoCard ---------- */
156
+ infoCard: {
157
+ background: "linear-gradient(135deg, #e6f7ff, #f0f5ff)",
158
+ border: "1px solid #91d5ff",
159
+ borderRadius: 10,
160
+ padding: "22px 26px"
161
+ },
162
+ infoCardHeader: { display: "flex", alignItems: "center", gap: 10, marginBottom: 16 },
163
+ infoCardName: { fontSize: Ce, fontWeight: 700, color: "#262626" },
164
+ infoCardBadge: { fontSize: 12, fontWeight: 600, padding: "3px 11px", borderRadius: 11 },
165
+ infoCardItems: { display: "flex", flexWrap: "wrap", gap: "8px 28px" },
166
+ infoCardItem: { fontSize: L, color: "#595959" },
167
+ /* ---------- 材料块:timeline ---------- */
168
+ timeline: {},
169
+ timelineItem: {
170
+ display: "flex",
171
+ gap: 14,
172
+ padding: "12px 0",
173
+ paddingLeft: 24,
174
+ borderLeft: `2px solid ${w}`,
175
+ position: "relative"
176
+ },
177
+ timelineDot: {
178
+ position: "absolute",
179
+ left: -6,
180
+ top: 16,
181
+ width: 10,
182
+ height: 10,
183
+ borderRadius: "50%",
184
+ border: "2px solid #fff"
185
+ },
186
+ timelineLabel: { fontSize: 13, fontWeight: 700, color: H, minWidth: 64, flexShrink: 0 },
187
+ timelineDetail: { fontSize: 13, color: "#595959", lineHeight: 1.7 },
188
+ /* ---------- 材料块:引用卡(previousEvidence) ---------- */
189
+ refCard: {
190
+ background: "linear-gradient(135deg, #fffbe6, #fff7d6)",
191
+ border: "1px solid #ffe58f",
192
+ borderRadius: 8,
193
+ padding: "14px 18px",
194
+ margin: "12px 0"
195
+ },
196
+ refCardTitle: { fontSize: 13, fontWeight: 700, color: "#ad6800", marginBottom: 6 },
197
+ refCardDesc: { fontSize: 13, color: "#595959", lineHeight: 1.7 },
198
+ refCardFact: { fontSize: 12, color: V, marginTop: 4 },
199
+ /* ---------- 右栏:决策工作区 ---------- */
200
+ panelDecision: { flex: 1, display: "flex", flexDirection: "column", minWidth: 380, minHeight: 0 },
201
+ stepNav: { flexShrink: 0, display: "flex", padding: "0 28px", background: se, borderBottom: `1px solid ${w}` },
202
+ stepItem: { flex: 1, textAlign: "center", padding: "16px 10px", cursor: "pointer", position: "relative" },
203
+ stepNum: {
204
+ position: "relative",
205
+ zIndex: 1,
206
+ width: 34,
207
+ height: 34,
208
+ borderRadius: "50%",
209
+ display: "inline-flex",
210
+ alignItems: "center",
211
+ justifyContent: "center",
212
+ fontSize: L,
213
+ fontWeight: 700,
214
+ marginBottom: 5,
215
+ background: "#e8e8e8",
216
+ color: V,
217
+ transition: "all .25s"
218
+ },
219
+ stepNumActive: { background: j, color: "#fff", boxShadow: "0 2px 8px rgba(56,158,13,.35)" },
220
+ stepNumDone: { background: ce, color: "#fff" },
221
+ stepLabel: { fontSize: L, color: "#bfbfbf" },
222
+ stepLabelActive: { color: j, fontWeight: 600 },
223
+ stepLabelDone: { color: ce },
224
+ decisionBody: { flex: 1, overflowY: "auto", padding: "26px 34px", minHeight: 0 },
225
+ /* ---------- Step1:标注列表 ---------- */
226
+ hint: {
227
+ background: `linear-gradient(135deg, ${K}, ${fe})`,
228
+ border: "1px solid #86efac",
229
+ borderRadius: 10,
230
+ padding: "18px 22px",
231
+ marginBottom: 24,
232
+ fontSize: L,
233
+ color: "#166534",
234
+ display: "flex",
235
+ gap: 10,
236
+ lineHeight: 1.6
237
+ },
238
+ annotatedItem: {
239
+ display: "flex",
240
+ alignItems: "center",
241
+ gap: 14,
242
+ padding: "14px 18px",
243
+ border: `1px solid ${w}`,
244
+ borderRadius: 10,
245
+ marginBottom: 10,
246
+ cursor: "pointer",
247
+ transition: "all .2s"
248
+ },
249
+ annotatedDot: { width: 12, height: 12, borderRadius: "50%", flexShrink: 0 },
250
+ annotatedInfo: { flex: 1, minWidth: 0 },
251
+ annotatedDesc: { fontSize: L, fontWeight: 600, color: H, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
252
+ annotatedSource: { fontSize: 11, color: "#bfbfbf", marginTop: 2 },
253
+ annotatedActions: { display: "flex", gap: 6 },
254
+ iconBtn: {
255
+ width: 30,
256
+ height: 30,
257
+ border: `1px solid ${w}`,
258
+ borderRadius: 5,
259
+ background: "#fff",
260
+ cursor: "pointer",
261
+ fontSize: 14,
262
+ color: V
263
+ },
264
+ emptyState: { textAlign: "center", padding: "40px 0", color: "#bfbfbf" },
265
+ emptyIcon: { fontSize: 40, marginBottom: 12 },
266
+ emptyText: { fontSize: L, lineHeight: 1.7 },
267
+ /* ---------- Step2:决策题组 ---------- */
268
+ group: { marginBottom: 30 },
269
+ groupTitle: { fontSize: Z, fontWeight: 700, color: H, marginBottom: 16, display: "flex", alignItems: "center", gap: 8 },
270
+ typeTag: { fontSize: 12, padding: "3px 10px", borderRadius: 10, fontWeight: "normal", background: K, color: ve },
271
+ optionList: { display: "flex", flexDirection: "column", gap: 10 },
272
+ option: {
273
+ display: "flex",
274
+ alignItems: "center",
275
+ gap: 12,
276
+ padding: "14px 18px",
277
+ // 拆分写法:optionSelected 只改 borderColor,基态用 border 简写会在取消选中时触发样式冲突告警
278
+ borderWidth: 1,
279
+ borderStyle: "solid",
280
+ borderColor: w,
281
+ borderRadius: 10,
282
+ cursor: "pointer",
283
+ transition: "all .2s"
284
+ },
285
+ optionSelected: { borderColor: j, background: K },
286
+ optionRadio: { width: 20, height: 20, borderWidth: 2, borderStyle: "solid", borderColor: "#d9d9d9", borderRadius: "50%", flexShrink: 0, position: "relative" },
287
+ optionRadioOn: { borderColor: j },
288
+ optionCheckbox: { width: 20, height: 20, borderWidth: 2, borderStyle: "solid", borderColor: "#d9d9d9", borderRadius: 4, flexShrink: 0, position: "relative" },
289
+ optionCheckboxOn: { borderColor: j, background: j },
290
+ optionText: { fontSize: L, color: H, lineHeight: 1.5 },
291
+ /* freeform 卡片 */
292
+ freeCard: { border: `1px solid ${w}`, borderRadius: 10, overflow: "hidden", marginBottom: 20 },
293
+ freeHeader: {
294
+ background: "linear-gradient(135deg, #059669, #10b981)",
295
+ color: "#fff",
296
+ padding: "14px 20px",
297
+ fontSize: Y,
298
+ fontWeight: 600,
299
+ display: "flex",
300
+ alignItems: "center",
301
+ gap: 8
302
+ },
303
+ freeHeaderBadge: {
304
+ fontSize: 11,
305
+ background: "rgba(255,255,255,.25)",
306
+ padding: "2px 8px",
307
+ borderRadius: 10,
308
+ fontWeight: "normal"
309
+ },
310
+ freeBody: { padding: 20 },
311
+ field: { marginBottom: 18 },
312
+ fieldLabel: { fontSize: 14, color: V, marginBottom: 6, display: "block" },
313
+ fieldInput: {
314
+ width: "100%",
315
+ border: "1px solid #d9d9d9",
316
+ borderRadius: 5,
317
+ padding: "12px 15px",
318
+ fontSize: L,
319
+ fontFamily: "inherit",
320
+ lineHeight: 1.65,
321
+ boxSizing: "border-box",
322
+ resize: "vertical",
323
+ minHeight: 68
324
+ },
325
+ /* ---------- Step3:理由 ---------- */
326
+ reasonToolbar: { display: "flex", gap: 10, marginBottom: 16, flexWrap: "wrap" },
327
+ toolbarBtn: {
328
+ padding: "8px 15px",
329
+ border: `1px solid ${w}`,
330
+ borderRadius: 5,
331
+ background: "#fff",
332
+ fontSize: 14,
333
+ color: "#595959",
334
+ cursor: "pointer",
335
+ display: "flex",
336
+ alignItems: "center",
337
+ gap: 5
338
+ },
339
+ toolbarDot: { width: 8, height: 8, borderRadius: "50%" },
340
+ reasonEditor: {
341
+ width: "100%",
342
+ minHeight: 280,
343
+ border: `1px solid ${w}`,
344
+ borderRadius: 10,
345
+ padding: 18,
346
+ fontSize: Y,
347
+ lineHeight: 1.9,
348
+ resize: "vertical",
349
+ fontFamily: "inherit",
350
+ boxSizing: "border-box"
351
+ },
352
+ reasonMeta: { marginTop: 12, display: "flex", gap: 8, fontSize: 12, color: "#bfbfbf" },
353
+ /* ---------- 底部操作栏 ---------- */
354
+ submitArea: { flexShrink: 0, padding: "22px 34px", borderTop: `1px solid ${w}`, background: se, display: "flex", gap: 12 },
355
+ btnPrimary: {
356
+ padding: "12px 34px",
357
+ background: `linear-gradient(135deg, ${j}, #22c55e)`,
358
+ color: "#fff",
359
+ border: "none",
360
+ borderRadius: 10,
361
+ fontSize: Y,
362
+ fontWeight: 700,
363
+ cursor: "pointer",
364
+ transition: "all .2s"
365
+ },
366
+ btnSecondary: {
367
+ padding: "12px 26px",
368
+ background: "#fff",
369
+ color: "#595959",
370
+ border: "1px solid #d9d9d9",
371
+ borderRadius: 10,
372
+ fontSize: Y,
373
+ cursor: "pointer"
374
+ },
375
+ btnSuccess: { padding: "12px 34px", background: `linear-gradient(135deg, ${j}, #22c55e)`, color: "#fff", border: "none", borderRadius: 10, fontSize: Y, fontWeight: 700, cursor: "pointer" },
376
+ btnDisabled: { background: "#f5f5f5", color: "#bfbfbf", cursor: "not-allowed", opacity: 0.7 },
377
+ errorTip: {
378
+ padding: "10px 14px",
379
+ background: "#fff7e6",
380
+ border: "1px solid #ffc069",
381
+ borderRadius: 6,
382
+ color: "#d46b08",
383
+ fontSize: 13,
384
+ marginBottom: 16
385
+ },
386
+ /* ---------- 标注弹窗 ---------- */
387
+ overlay: {
388
+ position: "fixed",
389
+ inset: 0,
390
+ background: "rgba(0,0,0,.45)",
391
+ zIndex: 1e3,
392
+ display: "flex",
393
+ alignItems: "center",
394
+ justifyContent: "center"
395
+ },
396
+ modalBox: { background: "#fff", borderRadius: 14, width: 520, maxHeight: "84vh", overflowY: "auto", boxShadow: "0 10px 30px rgba(0,0,0,.18)" },
397
+ modalHeader: { padding: "22px 28px", borderBottom: `1px solid ${w}`, display: "flex", alignItems: "center", justifyContent: "space-between" },
398
+ modalTitle: { fontSize: Z, fontWeight: 700, color: "#262626" },
399
+ modalClose: { width: 36, height: 36, border: "none", background: "none", cursor: "pointer", fontSize: 22, color: "#bfbfbf", borderRadius: "50%" },
400
+ modalBody: { padding: 28 },
401
+ formGroup: { marginBottom: 20 },
402
+ formLabel: { display: "block", fontSize: L, fontWeight: 600, color: H, marginBottom: 6 },
403
+ formInput: { width: "100%", padding: "12px 15px", border: "1px solid #d9d9d9", borderRadius: 5, fontSize: L, boxSizing: "border-box", fontFamily: "inherit" },
404
+ typeSelector: { display: "flex", gap: 10, flexWrap: "wrap" },
405
+ typeOption: { padding: "10px 18px", borderWidth: 1, borderStyle: "solid", borderColor: "#d9d9d9", borderRadius: 22, fontSize: L, cursor: "pointer", display: "flex", alignItems: "center", gap: 6 },
406
+ typeOptionSelected: { borderColor: j, background: K, color: "#166534", fontWeight: 500 },
407
+ typeDot: { width: 8, height: 8, borderRadius: "50%" },
408
+ modalFooter: { padding: "18px 28px", borderTop: `1px solid ${w}`, display: "flex", justifyContent: "flex-end", gap: 10 },
409
+ /* ---------- toast ---------- */
410
+ toast: {
411
+ position: "fixed",
412
+ top: 70,
413
+ left: "50%",
414
+ transform: "translateX(-50%)",
415
+ background: "#262626",
416
+ color: "#fff",
417
+ padding: "11px 24px",
418
+ borderRadius: 8,
419
+ fontSize: 13,
420
+ zIndex: 1100,
421
+ boxShadow: "0 10px 30px rgba(0,0,0,.18)"
422
+ }
423
+ }), Be = `
424
+ @keyframes dmFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
425
+ @keyframes dmModalIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
426
+ .dm-fade { animation: dmFadeIn .3s ease; }
427
+ .dm-modal-box { animation: dmModalIn .28s ease; }
428
+ .dm-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
429
+ .dm-scroll::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 4px; }
430
+ .dm-mat-header::before { content: ''; display: inline-block; width: 4px; height: 18px; background: ${j}; border-radius: 2px; margin-right: 8px; }
431
+ .dm-markable { position: relative; }
432
+ .dm-markable:hover { background: #f6ffed; }
433
+ .dm-markable .dm-marker-btn { opacity: 0; transition: opacity .2s, transform .2s; }
434
+ .dm-markable:hover .dm-marker-btn { opacity: 1; }
435
+ .dm-marker-btn:hover { transform: scale(1.12); filter: brightness(1.08); }
436
+ .dm-inline-tag:hover { transform: scale(1.05); }
437
+ .dm-step-item::after { content: ''; position: absolute; right: 0; top: 33px; width: calc(100% - 28px); height: 2px; background: #e8e8e8; transform: translateX(50%); z-index: 0; }
438
+ .dm-step-item:last-child::after { display: none; }
439
+ .dm-step-item.is-active::after, .dm-step-item.is-done::after { background: ${ce}; }
440
+ .dm-tab:hover { color: ${le}; }
441
+ .dm-option:hover { border-color: ${j}; background: ${K}; }
442
+ .dm-annotated:hover { border-color: ${j}; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
443
+ .dm-icon-btn:hover { border-color: ${j}; color: ${j}; }
444
+ .dm-icon-btn.danger:hover { border-color: #ff4d4f; color: #ff4d4f; }
445
+ .dm-toolbar-btn:hover { border-color: ${j}; color: ${j}; }
446
+ .dm-type-option:hover { border-color: ${j}; }
447
+ .dm-btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,158,13,.35); }
448
+ .dm-btn-success:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,158,13,.35); }
449
+ .dm-field-input.hint-mode { background: linear-gradient(to bottom, transparent 90%, #f0fdf4 90%); }
450
+ .dm-field-input:focus, .dm-reason-editor:focus, .dm-form-input:focus { border-color: ${j}; box-shadow: 0 0 0 3px rgba(56,158,13,.12); outline: none; }
451
+ `, me = "__previous_evidence__", ae = (o) => o === "high" ? "#ff4d4f" : o === "medium" ? "#faad14" : "#52c41a", Ie = ({
452
+ materials: o,
453
+ categories: r,
454
+ previousEvidence: d,
455
+ activeTab: s,
456
+ markers: g,
457
+ scrollSignal: B,
458
+ onTabChange: v,
459
+ onRequestMarker: I
460
+ }) => {
461
+ var N, _;
462
+ const b = te(null), z = oe(
463
+ () => Object.fromEntries(r.map((a) => [a.key, a])),
464
+ [r]
465
+ ), c = ((d == null ? void 0 : d.length) ?? 0) > 0, y = oe(() => {
466
+ const a = o.map((h) => ({ id: h.id, title: h.title }));
467
+ return c && a.push({ id: me, title: "📎 前序结论" }), a;
468
+ }, [o, c]), f = ((N = y.find((a) => a.id === s)) == null ? void 0 : N.id) || ((_ = y[0]) == null ? void 0 : _.id) || "", x = o.find((a) => a.id === f);
469
+ de(() => {
470
+ if (!B || !b.current) return;
471
+ const a = b.current.querySelector(
472
+ `[data-block-id="${B.blockId}"]`
473
+ );
474
+ if (a) {
475
+ a.scrollIntoView({ behavior: "smooth", block: "center" });
476
+ const h = a.style.background;
477
+ a.style.background = "#fff7d6", setTimeout(() => {
478
+ a.style.background = h;
479
+ }, 1400);
480
+ }
481
+ }, [B]);
482
+ const M = (a) => {
483
+ switch (a.kind) {
484
+ case "richText":
485
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
486
+ a.title && /* @__PURE__ */ e.jsx("div", { style: t.sectionTitle, children: a.title }),
487
+ /* @__PURE__ */ e.jsx("p", { style: t.paragraphBase, children: a.text })
488
+ ] });
489
+ case "table":
490
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
491
+ a.title && /* @__PURE__ */ e.jsx("div", { style: t.sectionTitle, children: a.title }),
492
+ /* @__PURE__ */ e.jsx("div", { style: t.tableWrap, children: /* @__PURE__ */ e.jsxs("table", { style: t.table, children: [
493
+ /* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsx("tr", { children: a.headers.map((h, u) => /* @__PURE__ */ e.jsx("th", { style: t.th, children: h }, u)) }) }),
494
+ /* @__PURE__ */ e.jsx("tbody", { children: a.rows.map((h, u) => /* @__PURE__ */ e.jsx("tr", { children: h.cells.map((k, A) => /* @__PURE__ */ e.jsx(
495
+ "td",
496
+ {
497
+ style: {
498
+ ...t.td,
499
+ ...k.status === "warning" ? t.cellWarning : {},
500
+ ...k.status === "danger" ? t.cellDanger : {}
501
+ },
502
+ children: k.value
503
+ },
504
+ A
505
+ )) }, u)) })
506
+ ] }) })
507
+ ] });
508
+ case "infoCard":
509
+ return /* @__PURE__ */ e.jsxs("div", { style: t.infoCard, children: [
510
+ /* @__PURE__ */ e.jsxs("div", { style: t.infoCardHeader, children: [
511
+ /* @__PURE__ */ e.jsx("span", { style: t.infoCardName, children: a.title }),
512
+ a.badge && /* @__PURE__ */ e.jsx(
513
+ "span",
514
+ {
515
+ style: {
516
+ ...t.infoCardBadge,
517
+ background: `${ae(a.badge.level)}22`,
518
+ color: ae(a.badge.level)
519
+ },
520
+ children: a.badge.text
521
+ }
522
+ )
523
+ ] }),
524
+ /* @__PURE__ */ e.jsx("div", { style: t.infoCardItems, children: a.items.map((h, u) => /* @__PURE__ */ e.jsxs("span", { style: t.infoCardItem, children: [
525
+ /* @__PURE__ */ e.jsxs("strong", { children: [
526
+ h.label,
527
+ ":"
528
+ ] }),
529
+ h.value
530
+ ] }, u)) })
531
+ ] });
532
+ case "timeline":
533
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
534
+ a.title && /* @__PURE__ */ e.jsx("div", { style: t.sectionTitle, children: a.title }),
535
+ /* @__PURE__ */ e.jsx("div", { style: t.timeline, children: a.items.map((h, u) => /* @__PURE__ */ e.jsxs("div", { style: t.timelineItem, children: [
536
+ /* @__PURE__ */ e.jsx("span", { style: { ...t.timelineDot, background: ae(h.level) } }),
537
+ /* @__PURE__ */ e.jsx("span", { style: t.timelineLabel, children: h.label }),
538
+ /* @__PURE__ */ e.jsx("span", { style: t.timelineDetail, children: h.detail })
539
+ ] }, u)) })
540
+ ] });
541
+ default:
542
+ return null;
543
+ }
544
+ }, F = (a) => {
545
+ const h = g.filter(
546
+ (k) => k.materialId === f && k.blockId === a.id
547
+ ), u = a.markable !== !1 && r.length > 0;
548
+ return /* @__PURE__ */ e.jsxs(
549
+ "div",
550
+ {
551
+ className: "dm-markable",
552
+ style: t.markableWrap,
553
+ "data-block-id": a.id,
554
+ children: [
555
+ M(a),
556
+ h.length > 0 && /* @__PURE__ */ e.jsx("div", { style: t.blockMarkersBar, children: h.map((k) => {
557
+ const A = z[k.categoryKey], E = (A == null ? void 0 : A.color) || "#1890ff";
558
+ return /* @__PURE__ */ e.jsx(
559
+ "span",
560
+ {
561
+ className: "dm-inline-tag",
562
+ title: k.desc,
563
+ style: {
564
+ ...t.inlineTag,
565
+ background: `${E}1a`,
566
+ border: `1px solid ${E}`,
567
+ color: E
568
+ },
569
+ children: k.desc.length > 12 ? `${k.desc.slice(0, 12)}…` : k.desc
570
+ },
571
+ k.id
572
+ );
573
+ }) }),
574
+ u && /* @__PURE__ */ e.jsx(
575
+ "button",
576
+ {
577
+ className: "dm-marker-btn",
578
+ style: t.markerBtn,
579
+ title: "添加决策点标注",
580
+ onClick: () => I(f, a.id),
581
+ children: "+"
582
+ }
583
+ )
584
+ ]
585
+ },
586
+ a.id
587
+ );
588
+ };
589
+ return /* @__PURE__ */ e.jsxs("div", { style: t.panelMaterials, children: [
590
+ /* @__PURE__ */ e.jsxs("div", { className: "dm-mat-header", style: t.materialHeader, children: [
591
+ "📋 决策材料",
592
+ /* @__PURE__ */ e.jsxs("span", { style: { fontSize: 12, fontWeight: "normal", color: "#bfbfbf", marginLeft: 8 }, children: [
593
+ "共 ",
594
+ o.length,
595
+ " 份"
596
+ ] })
597
+ ] }),
598
+ /* @__PURE__ */ e.jsx("div", { style: t.tabNav, children: y.map((a) => /* @__PURE__ */ e.jsx(
599
+ "button",
600
+ {
601
+ className: "dm-tab",
602
+ style: { ...t.tab, ...f === a.id ? t.tabActive : {} },
603
+ onClick: () => v(a.id),
604
+ children: a.title
605
+ },
606
+ a.id
607
+ )) }),
608
+ /* @__PURE__ */ e.jsx("div", { ref: b, className: "dm-scroll", style: t.materialBody, children: f === me ? (d || []).map((a, h) => /* @__PURE__ */ e.jsxs("div", { style: t.refCard, children: [
609
+ /* @__PURE__ */ e.jsxs("div", { style: t.refCardTitle, children: [
610
+ "引用:",
611
+ a.title || "前序步骤结论"
612
+ ] }),
613
+ /* @__PURE__ */ e.jsx("div", { style: t.refCardDesc, children: a.summary }),
614
+ a.conclusion && /* @__PURE__ */ e.jsxs("div", { style: { ...t.refCardDesc, marginTop: 6 }, children: [
615
+ /* @__PURE__ */ e.jsx("strong", { children: "结论:" }),
616
+ a.conclusion
617
+ ] }),
618
+ (a.keyFacts || []).map((u, k) => /* @__PURE__ */ e.jsxs("div", { style: t.refCardFact, children: [
619
+ /* @__PURE__ */ e.jsxs("strong", { children: [
620
+ u.label,
621
+ ":"
622
+ ] }),
623
+ u.value
624
+ ] }, k))
625
+ ] }, h)) : x == null ? void 0 : x.blocks.map((a) => F(a)) })
626
+ ] });
627
+ };
628
+ let he = 0;
629
+ function Te() {
630
+ return he += 1, `marker-${Date.now().toString(36)}-${he}`;
631
+ }
632
+ function $e(o) {
633
+ var r, d;
634
+ return {
635
+ currentStep: 1,
636
+ activeTab: ((d = (r = o.materials) == null ? void 0 : r[0]) == null ? void 0 : d.id) ?? "",
637
+ markers: [],
638
+ groupSelections: {},
639
+ freeformFields: {},
640
+ reason: "",
641
+ lastModified: Date.now()
642
+ };
643
+ }
644
+ function ze(o, r) {
645
+ const d = Math.max(1, Math.min(3, r));
646
+ return { ...o, currentStep: d, lastModified: Date.now() };
647
+ }
648
+ function ge(o, r) {
649
+ return { ...o, activeTab: r, lastModified: Date.now() };
650
+ }
651
+ function Re(o, r) {
652
+ const d = { id: Te(), ...r };
653
+ return { ...o, markers: [...o.markers, d], lastModified: Date.now() };
654
+ }
655
+ function Me(o, r, d) {
656
+ return {
657
+ ...o,
658
+ markers: o.markers.map((s) => s.id === r ? { ...s, ...d } : s),
659
+ lastModified: Date.now()
660
+ };
661
+ }
662
+ function Le(o, r) {
663
+ return {
664
+ ...o,
665
+ markers: o.markers.filter((d) => d.id !== r),
666
+ lastModified: Date.now()
667
+ };
668
+ }
669
+ function Fe(o, r, d) {
670
+ return {
671
+ ...o,
672
+ groupSelections: { ...o.groupSelections, [r]: [d] },
673
+ lastModified: Date.now()
674
+ };
675
+ }
676
+ function We(o, r, d) {
677
+ const s = o.groupSelections[r] ?? [], g = s.includes(d) ? s.filter((B) => B !== d) : [...s, d];
678
+ return {
679
+ ...o,
680
+ groupSelections: { ...o.groupSelections, [r]: g },
681
+ lastModified: Date.now()
682
+ };
683
+ }
684
+ function Ne(o, r, d, s) {
685
+ return {
686
+ ...o,
687
+ freeformFields: {
688
+ ...o.freeformFields,
689
+ [r]: { ...o.freeformFields[r] ?? {}, [d]: s }
690
+ },
691
+ lastModified: Date.now()
692
+ };
693
+ }
694
+ function Ae(o, r) {
695
+ return { ...o, reason: r, lastModified: Date.now() };
696
+ }
697
+ function xe(o) {
698
+ return o.replace(/\s/g, "").length;
699
+ }
700
+ function He(o, r, d) {
701
+ const s = [], g = d.minMarkers ?? 0;
702
+ o.markers.length < g && s.push({ type: "minMarkers", message: `至少需要标注 ${g} 个决策点` }), (r.decisionGroups ?? []).forEach((v) => {
703
+ var I;
704
+ v.kind === "single" || v.kind === "multi" ? v.required && (((I = o.groupSelections[v.id]) == null ? void 0 : I.length) ?? 0) === 0 && s.push({ type: "requiredGroup", groupId: v.id, message: `「${v.title}」为必答` }) : v.kind === "freeform" && (v.fields ?? []).forEach((b) => {
705
+ var c;
706
+ const z = (c = o.freeformFields[v.id]) == null ? void 0 : c[b.name];
707
+ b.required && (z == null || typeof z == "string" && !z.trim()) && s.push({
708
+ type: "requiredField",
709
+ groupId: v.id,
710
+ fieldName: b.name,
711
+ message: `${b.label}为必填项`
712
+ }), b.maxLength && typeof z == "string" && z.length > b.maxLength && s.push({
713
+ type: "maxLength",
714
+ groupId: v.id,
715
+ fieldName: b.name,
716
+ message: `${b.label}不能超过 ${b.maxLength} 字`
717
+ });
718
+ });
719
+ });
720
+ const B = xe(o.reason);
721
+ return d.requireReason && B === 0 && s.push({ type: "requireReason", message: "请填写决策理由" }), d.minReasonLength && B < d.minReasonLength && s.push({ type: "minReasonLength", message: `决策理由至少 ${d.minReasonLength} 字` }), { valid: s.length === 0, errors: s };
722
+ }
723
+ function ee(o, r) {
724
+ return {
725
+ type: r,
726
+ data: {
727
+ markers: o.markers,
728
+ groupSelections: o.groupSelections,
729
+ freeformFields: o.freeformFields,
730
+ reason: o.reason
731
+ },
732
+ timestamp: Date.now()
733
+ };
734
+ }
735
+ function Ee(o, r = 3e4) {
736
+ return o === 0 ? !0 : Date.now() - o >= r;
737
+ }
738
+ function De(o, r, d) {
739
+ return {
740
+ stepId: r,
741
+ operationType: "decision-making",
742
+ operationData: {
743
+ markers: o.markers,
744
+ groupSelections: o.groupSelections,
745
+ freeformFields: o.freeformFields,
746
+ reason: o.reason,
747
+ markerCount: o.markers.length
748
+ },
749
+ operationLog: [],
750
+ timestamp: Date.now(),
751
+ evidenceSummary: _e(o, d, r)
752
+ };
753
+ }
754
+ function _e(o, r, d) {
755
+ var b, z;
756
+ const s = (c) => {
757
+ var y, f;
758
+ return ((f = (y = r.markerCategories) == null ? void 0 : y.find((x) => x.key === c)) == null ? void 0 : f.label) ?? c;
759
+ }, g = [], B = [];
760
+ o.markers.forEach((c) => {
761
+ g.push({ label: `标注·${s(c.categoryKey)}`, value: c.desc });
762
+ }), (r.decisionGroups ?? []).forEach((c) => {
763
+ if (c.kind === "single" || c.kind === "multi") {
764
+ const f = (o.groupSelections[c.id] ?? []).map((x) => {
765
+ var M, F;
766
+ return ((F = (M = c.options) == null ? void 0 : M.find((N) => N.value === x)) == null ? void 0 : F.label) ?? x;
767
+ });
768
+ f.length && (g.push({ label: c.title, value: f.join("、") }), B.push(`${c.title}:${f.join("、")}`));
769
+ } else c.kind === "freeform" && (c.fields ?? []).forEach((y) => {
770
+ var x;
771
+ const f = (x = o.freeformFields[c.id]) == null ? void 0 : x[y.name];
772
+ f && g.push({ label: y.label, value: String(f) });
773
+ });
774
+ });
775
+ let v = "已完成决策";
776
+ const I = (r.decisionGroups ?? []).find((c) => c.kind === "single");
777
+ if (I) {
778
+ const y = (o.groupSelections[I.id] ?? []).map((f) => {
779
+ var x, M;
780
+ return ((M = (x = I.options) == null ? void 0 : x.find((F) => F.value === f)) == null ? void 0 : M.label) ?? f;
781
+ });
782
+ y.length && (v = y.join("、"));
783
+ } else {
784
+ const c = (r.decisionGroups ?? []).find((f) => f.kind === "freeform"), y = (b = c == null ? void 0 : c.fields) == null ? void 0 : b[0];
785
+ if (c && y) {
786
+ const f = (z = o.freeformFields[c.id]) == null ? void 0 : z[y.name];
787
+ f && (v = String(f));
788
+ }
789
+ }
790
+ return {
791
+ sourceStepId: d,
792
+ sourceType: "decision-making",
793
+ title: (r.decisionScenario ?? "").substring(0, 50),
794
+ summary: B.join(";") || "已完成决策",
795
+ keyFacts: g,
796
+ conclusion: v
797
+ };
798
+ }
799
+ const Ge = ["标注决策点", "做出决策", "阐述理由"], Oe = (o) => {
800
+ const {
801
+ formState: r,
802
+ decisionGroups: d,
803
+ reasonConfig: s,
804
+ categories: g,
805
+ runtimeRules: B,
806
+ initData: v,
807
+ isSubmitting: I,
808
+ onGoStep: b,
809
+ onEditMarker: z,
810
+ onRemoveMarker: c,
811
+ onAnnotatedClick: y,
812
+ onSelectSingle: f,
813
+ onToggleMulti: x,
814
+ onFreeformChange: M,
815
+ onReasonChange: F,
816
+ onSubmit: N,
817
+ showToast: _
818
+ } = o, a = te(null), h = r.currentStep, u = Object.fromEntries(g.map((i) => [i.key, i])), k = He(r, v, B), A = () => {
819
+ if (k.valid) {
820
+ N();
821
+ return;
822
+ }
823
+ const i = k.errors[0], l = i.type === "minMarkers" ? 1 : i.type === "requireReason" || i.type === "minReasonLength" ? 3 : 2;
824
+ _(i.message, !1), l !== h && b(l);
825
+ }, E = (i) => {
826
+ var Q;
827
+ const l = ((Q = u[i]) == null ? void 0 : Q.label) || i, S = r.markers.filter((q) => q.categoryKey === i);
828
+ if (S.length === 0) {
829
+ _(`暂无「${l}」标注可引用`, !1);
830
+ return;
831
+ }
832
+ const T = `【${l}:${S.map((q) => q.desc).join("、")}】`, C = a.current, $ = C ? C.selectionStart : r.reason.length, J = r.reason, ie = J.slice(0, $) + T + J.slice($);
833
+ F(ie), setTimeout(() => {
834
+ C && (C.focus(), C.setSelectionRange($ + T.length, $ + T.length));
835
+ }, 0);
836
+ }, G = (i, l) => {
837
+ var C;
838
+ const S = ((C = r.freeformFields[i]) == null ? void 0 : C[l.name]) ?? "", T = {
839
+ className: "dm-field-input",
840
+ style: t.fieldInput,
841
+ placeholder: l.placeholder
842
+ };
843
+ return l.type === "textarea" ? /* @__PURE__ */ e.jsx(
844
+ "textarea",
845
+ {
846
+ ...T,
847
+ className: "dm-field-input hint-mode",
848
+ rows: 3,
849
+ maxLength: l.maxLength,
850
+ value: S,
851
+ onChange: ($) => M(i, l.name, $.target.value)
852
+ }
853
+ ) : l.type === "select" ? /* @__PURE__ */ e.jsxs(
854
+ "select",
855
+ {
856
+ ...T,
857
+ value: S,
858
+ onChange: ($) => M(i, l.name, $.target.value),
859
+ children: [
860
+ /* @__PURE__ */ e.jsx("option", { value: "", children: "请选择" }),
861
+ (l.options || []).map(($) => /* @__PURE__ */ e.jsx("option", { value: $, children: $ }, $))
862
+ ]
863
+ }
864
+ ) : /* @__PURE__ */ e.jsx(
865
+ "input",
866
+ {
867
+ ...T,
868
+ type: l.type === "number" ? "number" : "text",
869
+ maxLength: l.maxLength,
870
+ value: S,
871
+ onChange: ($) => M(i, l.name, $.target.value)
872
+ }
873
+ );
874
+ }, re = (i, l) => {
875
+ const S = (r.groupSelections[i.id] || []).includes(l.value), T = i.kind === "single";
876
+ return /* @__PURE__ */ e.jsxs(
877
+ "div",
878
+ {
879
+ className: "dm-option",
880
+ style: { ...t.option, ...S ? t.optionSelected : {} },
881
+ onClick: () => T ? f(i.id, l.value) : x(i.id, l.value),
882
+ children: [
883
+ T ? /* @__PURE__ */ e.jsx("span", { style: { ...t.optionRadio, ...S ? t.optionRadioOn : {} }, children: S && /* @__PURE__ */ e.jsx(
884
+ "span",
885
+ {
886
+ style: { position: "absolute", inset: 3, borderRadius: "50%", background: "#389e0d" }
887
+ }
888
+ ) }) : /* @__PURE__ */ e.jsx("span", { style: { ...t.optionCheckbox, ...S ? t.optionCheckboxOn : {} }, children: S && /* @__PURE__ */ e.jsx(
889
+ "span",
890
+ {
891
+ style: {
892
+ position: "absolute",
893
+ inset: 0,
894
+ color: "#fff",
895
+ fontSize: 13,
896
+ display: "flex",
897
+ alignItems: "center",
898
+ justifyContent: "center"
899
+ },
900
+ children: "✓"
901
+ }
902
+ ) }),
903
+ /* @__PURE__ */ e.jsx("span", { style: t.optionText, children: l.label })
904
+ ]
905
+ },
906
+ l.value
907
+ );
908
+ }, ne = (i) => `${i.kind === "single" ? "单选" : i.kind === "multi" ? "多选" : "填写"} · ${i.required ? "必答" : "选填"}`, O = xe(r.reason), P = B.minReasonLength;
909
+ return /* @__PURE__ */ e.jsxs("div", { style: t.panelDecision, children: [
910
+ /* @__PURE__ */ e.jsx("div", { style: t.stepNav, children: Ge.map((i, l) => {
911
+ const S = l + 1, T = h === S, C = h > S;
912
+ return /* @__PURE__ */ e.jsxs(
913
+ "div",
914
+ {
915
+ className: `dm-step-item${T ? " is-active" : ""}${C ? " is-done" : ""}`,
916
+ style: t.stepItem,
917
+ onClick: () => b(S),
918
+ children: [
919
+ /* @__PURE__ */ e.jsx(
920
+ "div",
921
+ {
922
+ style: {
923
+ ...t.stepNum,
924
+ ...T ? t.stepNumActive : {},
925
+ ...C ? t.stepNumDone : {}
926
+ },
927
+ children: C ? "✓" : S
928
+ }
929
+ ),
930
+ /* @__PURE__ */ e.jsx(
931
+ "div",
932
+ {
933
+ style: {
934
+ ...t.stepLabel,
935
+ ...T ? t.stepLabelActive : {},
936
+ ...C ? t.stepLabelDone : {}
937
+ },
938
+ children: i
939
+ }
940
+ )
941
+ ]
942
+ },
943
+ S
944
+ );
945
+ }) }),
946
+ /* @__PURE__ */ e.jsxs("div", { className: "dm-scroll", style: t.decisionBody, children: [
947
+ h === 1 && /* @__PURE__ */ e.jsxs("div", { className: "dm-fade", children: [
948
+ /* @__PURE__ */ e.jsxs("div", { style: t.hint, children: [
949
+ /* @__PURE__ */ e.jsx("span", { style: { fontSize: 20 }, children: "💡" }),
950
+ /* @__PURE__ */ e.jsxs("span", { children: [
951
+ "请在左侧材料中点击材料块右上角的 ",
952
+ /* @__PURE__ */ e.jsx("strong", { children: "「+」" }),
953
+ " ",
954
+ "按钮,标注你认为关键的",
955
+ /* @__PURE__ */ e.jsx("strong", { children: "决策点" }),
956
+ "。已标注项会列在下方。"
957
+ ] })
958
+ ] }),
959
+ r.markers.length === 0 ? /* @__PURE__ */ e.jsxs("div", { style: t.emptyState, children: [
960
+ /* @__PURE__ */ e.jsx("div", { style: t.emptyIcon, children: "🏷️" }),
961
+ /* @__PURE__ */ e.jsxs("div", { style: t.emptyText, children: [
962
+ "尚未标注任何决策点",
963
+ /* @__PURE__ */ e.jsx("br", {}),
964
+ "请在左侧材料中点击「+」开始标注"
965
+ ] })
966
+ ] }) : r.markers.map((i) => {
967
+ const l = u[i.categoryKey];
968
+ return /* @__PURE__ */ e.jsxs(
969
+ "div",
970
+ {
971
+ className: "dm-annotated",
972
+ style: t.annotatedItem,
973
+ onClick: () => y(i.materialId, i.blockId),
974
+ children: [
975
+ /* @__PURE__ */ e.jsx("span", { style: { ...t.annotatedDot, background: (l == null ? void 0 : l.color) || "#1890ff" } }),
976
+ /* @__PURE__ */ e.jsxs("div", { style: t.annotatedInfo, children: [
977
+ /* @__PURE__ */ e.jsx("div", { style: t.annotatedDesc, children: i.desc }),
978
+ /* @__PURE__ */ e.jsx("div", { style: t.annotatedSource, children: (l == null ? void 0 : l.label) || i.categoryKey })
979
+ ] }),
980
+ /* @__PURE__ */ e.jsxs("div", { style: t.annotatedActions, children: [
981
+ /* @__PURE__ */ e.jsx(
982
+ "button",
983
+ {
984
+ className: "dm-icon-btn",
985
+ style: t.iconBtn,
986
+ title: "编辑",
987
+ onClick: (S) => {
988
+ S.stopPropagation(), z(i.id);
989
+ },
990
+ children: "✏️"
991
+ }
992
+ ),
993
+ /* @__PURE__ */ e.jsx(
994
+ "button",
995
+ {
996
+ className: "dm-icon-btn danger",
997
+ style: t.iconBtn,
998
+ title: "删除",
999
+ onClick: (S) => {
1000
+ S.stopPropagation(), c(i.id);
1001
+ },
1002
+ children: "🗑️"
1003
+ }
1004
+ )
1005
+ ] })
1006
+ ]
1007
+ },
1008
+ i.id
1009
+ );
1010
+ })
1011
+ ] }),
1012
+ h === 2 && /* @__PURE__ */ e.jsx("div", { className: "dm-fade", children: d.map((i) => /* @__PURE__ */ e.jsxs("div", { style: t.group, children: [
1013
+ /* @__PURE__ */ e.jsxs("div", { style: t.groupTitle, children: [
1014
+ i.title,
1015
+ /* @__PURE__ */ e.jsx("span", { style: t.typeTag, children: ne(i) })
1016
+ ] }),
1017
+ i.hint && /* @__PURE__ */ e.jsx("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 10 }, children: i.hint }),
1018
+ i.kind === "freeform" ? /* @__PURE__ */ e.jsxs("div", { style: t.freeCard, children: [
1019
+ /* @__PURE__ */ e.jsxs("div", { style: t.freeHeader, children: [
1020
+ /* @__PURE__ */ e.jsxs("span", { children: [
1021
+ "✍️ ",
1022
+ i.title
1023
+ ] }),
1024
+ /* @__PURE__ */ e.jsx("span", { style: t.freeHeaderBadge, children: "AI 辅助引导" })
1025
+ ] }),
1026
+ /* @__PURE__ */ e.jsx("div", { style: t.freeBody, children: (i.fields || []).map((l) => /* @__PURE__ */ e.jsxs("div", { style: t.field, children: [
1027
+ /* @__PURE__ */ e.jsxs("label", { style: t.fieldLabel, children: [
1028
+ l.label,
1029
+ l.required && /* @__PURE__ */ e.jsx("span", { style: { color: "#ff4d4f" }, children: " *" })
1030
+ ] }),
1031
+ G(i.id, l)
1032
+ ] }, l.name)) })
1033
+ ] }) : /* @__PURE__ */ e.jsx("div", { style: t.optionList, children: (i.options || []).map((l) => re(i, l)) })
1034
+ ] }, i.id)) }),
1035
+ h === 3 && /* @__PURE__ */ e.jsxs("div", { className: "dm-fade", children: [
1036
+ (s == null ? void 0 : s.enableMarkerRefs) !== !1 && g.length > 0 && /* @__PURE__ */ e.jsx("div", { style: t.reasonToolbar, children: g.map((i) => /* @__PURE__ */ e.jsxs(
1037
+ "button",
1038
+ {
1039
+ className: "dm-toolbar-btn",
1040
+ style: t.toolbarBtn,
1041
+ onClick: () => E(i.key),
1042
+ children: [
1043
+ /* @__PURE__ */ e.jsx("span", { style: { ...t.toolbarDot, background: i.color } }),
1044
+ "引用",
1045
+ i.label
1046
+ ]
1047
+ },
1048
+ i.key
1049
+ )) }),
1050
+ /* @__PURE__ */ e.jsx(
1051
+ "textarea",
1052
+ {
1053
+ ref: a,
1054
+ className: "dm-reason-editor",
1055
+ style: t.reasonEditor,
1056
+ value: r.reason,
1057
+ placeholder: (s == null ? void 0 : s.placeholder) || "请在此阐述你的决策理由,可引用上方已标注的决策点作为论证依据…",
1058
+ onChange: (i) => F(i.target.value)
1059
+ }
1060
+ ),
1061
+ /* @__PURE__ */ e.jsxs("div", { style: t.reasonMeta, children: [
1062
+ ((s == null ? void 0 : s.hints) || []).map((i, l) => /* @__PURE__ */ e.jsxs("span", { children: [
1063
+ "💡 ",
1064
+ i
1065
+ ] }, l)),
1066
+ /* @__PURE__ */ e.jsxs("span", { style: { marginLeft: "auto" }, children: [
1067
+ "已输入 ",
1068
+ /* @__PURE__ */ e.jsx("strong", { children: O }),
1069
+ " 字",
1070
+ P ? `(建议 ≥ ${P})` : ""
1071
+ ] })
1072
+ ] })
1073
+ ] })
1074
+ ] }),
1075
+ /* @__PURE__ */ e.jsxs("div", { style: t.submitArea, children: [
1076
+ h > 1 && /* @__PURE__ */ e.jsx("button", { style: t.btnSecondary, onClick: () => b(h - 1), disabled: I, children: "← 上一步" }),
1077
+ h < 3 ? /* @__PURE__ */ e.jsx("button", { className: "dm-btn-primary", style: t.btnPrimary, onClick: () => b(h + 1), children: "下一步 →" }) : /* @__PURE__ */ e.jsx(
1078
+ "button",
1079
+ {
1080
+ className: "dm-btn-success",
1081
+ style: { ...t.btnSuccess, ...I ? t.btnDisabled : {} },
1082
+ onClick: A,
1083
+ disabled: I,
1084
+ children: I ? "提交中…" : "🚀 提交决策"
1085
+ }
1086
+ )
1087
+ ] })
1088
+ ] });
1089
+ }, ue = "decision-making-injected-css";
1090
+ function Ye(o, r) {
1091
+ switch (o.kind) {
1092
+ case "richText":
1093
+ return { ...o, title: o.title ? r(o.title) : o.title, text: r(o.text) };
1094
+ case "table":
1095
+ return {
1096
+ ...o,
1097
+ title: o.title ? r(o.title) : o.title,
1098
+ headers: o.headers.map((d) => r(d)),
1099
+ rows: o.rows.map((d) => ({
1100
+ cells: d.cells.map((s) => ({ ...s, value: r(s.value) }))
1101
+ }))
1102
+ };
1103
+ case "infoCard":
1104
+ return {
1105
+ ...o,
1106
+ title: r(o.title),
1107
+ badge: o.badge ? { ...o.badge, text: r(o.badge.text) } : o.badge,
1108
+ items: o.items.map((d) => ({ label: r(d.label), value: r(d.value) }))
1109
+ };
1110
+ case "timeline":
1111
+ return {
1112
+ ...o,
1113
+ title: o.title ? r(o.title) : o.title,
1114
+ items: o.items.map((d) => ({ ...d, label: r(d.label), detail: r(d.detail) }))
1115
+ };
1116
+ default:
1117
+ return o;
1118
+ }
1119
+ }
1120
+ const qe = ({
1121
+ initData: o,
1122
+ runtimeRules: r,
1123
+ onFinish: d,
1124
+ onRealtimeData: s
1125
+ }) => {
1126
+ const g = o, B = r || {}, v = (o == null ? void 0 : o.stepId) || "decision-making", { currentCase: I } = ye(), b = ke((n) => n.filledData), z = oe(() => I || {}, [I]), c = oe(() => {
1127
+ var m;
1128
+ const n = (p) => Se(p || "", z, b);
1129
+ return {
1130
+ ...g,
1131
+ decisionScenario: n(g.decisionScenario),
1132
+ materials: (g.materials || []).map((p) => ({
1133
+ ...p,
1134
+ title: n(p.title),
1135
+ blocks: (p.blocks || []).map((W) => Ye(W, n))
1136
+ })),
1137
+ markerCategories: g.markerCategories || [],
1138
+ decisionGroups: (g.decisionGroups || []).map((p) => {
1139
+ var W, X;
1140
+ return {
1141
+ ...p,
1142
+ title: n(p.title),
1143
+ hint: p.hint ? n(p.hint) : p.hint,
1144
+ options: (W = p.options) == null ? void 0 : W.map((D) => ({ ...D, label: n(D.label) })),
1145
+ fields: (X = p.fields) == null ? void 0 : X.map((D) => {
1146
+ var pe;
1147
+ return {
1148
+ ...D,
1149
+ label: n(D.label),
1150
+ placeholder: D.placeholder ? n(D.placeholder) : D.placeholder,
1151
+ options: (pe = D.options) == null ? void 0 : pe.map((be) => n(be))
1152
+ };
1153
+ })
1154
+ };
1155
+ }),
1156
+ reasonConfig: g.reasonConfig ? {
1157
+ ...g.reasonConfig,
1158
+ placeholder: g.reasonConfig.placeholder ? n(g.reasonConfig.placeholder) : g.reasonConfig.placeholder,
1159
+ hints: (m = g.reasonConfig.hints) == null ? void 0 : m.map((p) => n(p))
1160
+ } : g.reasonConfig
1161
+ };
1162
+ }, [g, z, b]), y = c.markerCategories || [], [f, x] = U(() => $e(g)), [M, F] = U(!1), [N, _] = U(null), [a, h] = U(null), [u, k] = U({
1163
+ open: !1,
1164
+ mode: "add",
1165
+ materialId: "",
1166
+ blockId: "",
1167
+ desc: "",
1168
+ categoryKey: ""
1169
+ }), A = te(0), E = te(null);
1170
+ de(() => {
1171
+ if (!document.getElementById(ue)) {
1172
+ const n = document.createElement("style");
1173
+ n.id = ue, n.textContent = Be, document.head.appendChild(n);
1174
+ }
1175
+ }, []);
1176
+ const G = R((n, m = !0) => {
1177
+ _({ msg: n, ok: m }), E.current && clearTimeout(E.current), E.current = setTimeout(() => _(null), 2200);
1178
+ }, []);
1179
+ de(() => {
1180
+ Ee(A.current) && (A.current = Date.now(), s == null || s({ type: "autoDraft", data: f }));
1181
+ }, [f, s]);
1182
+ const re = R(
1183
+ (n, m) => {
1184
+ var p;
1185
+ k({
1186
+ open: !0,
1187
+ mode: "add",
1188
+ materialId: n,
1189
+ blockId: m,
1190
+ desc: "",
1191
+ categoryKey: ((p = y[0]) == null ? void 0 : p.key) || ""
1192
+ });
1193
+ },
1194
+ [y]
1195
+ ), ne = R(
1196
+ (n) => {
1197
+ const m = f.markers.find((p) => p.id === n);
1198
+ m && k({
1199
+ open: !0,
1200
+ mode: "edit",
1201
+ materialId: m.materialId,
1202
+ blockId: m.blockId,
1203
+ markerId: n,
1204
+ desc: m.desc,
1205
+ categoryKey: m.categoryKey
1206
+ });
1207
+ },
1208
+ [f.markers]
1209
+ ), O = R(() => k((n) => ({ ...n, open: !1 })), []), P = R(() => {
1210
+ const n = u.desc.trim();
1211
+ if (!n) {
1212
+ G("请输入标注描述", !1);
1213
+ return;
1214
+ }
1215
+ x((m) => {
1216
+ const p = u.mode === "add" ? Re(m, {
1217
+ materialId: u.materialId,
1218
+ blockId: u.blockId,
1219
+ categoryKey: u.categoryKey,
1220
+ desc: n
1221
+ }) : Me(m, u.markerId, { desc: n, categoryKey: u.categoryKey });
1222
+ return s == null || s(ee(p, "markerChange")), p;
1223
+ }), O(), G(u.mode === "add" ? "标注已添加 ✓" : "标注已更新 ✓");
1224
+ }, [u, s, G, O]), i = R(
1225
+ (n) => {
1226
+ x((m) => {
1227
+ const p = Le(m, n);
1228
+ return s == null || s(ee(p, "markerChange")), p;
1229
+ }), G("标注已删除");
1230
+ },
1231
+ [s, G]
1232
+ ), l = R((n, m) => {
1233
+ x((p) => ge(p, n)), h({ blockId: m, ts: Date.now() });
1234
+ }, []), S = R((n) => {
1235
+ x((m) => ze(m, n));
1236
+ }, []), T = R((n) => {
1237
+ x((m) => ge(m, n));
1238
+ }, []), C = (n) => s == null ? void 0 : s(ee(n, "decisionChange")), $ = R(
1239
+ (n, m) => {
1240
+ x((p) => {
1241
+ const W = Fe(p, n, m);
1242
+ return C(W), W;
1243
+ });
1244
+ },
1245
+ [s]
1246
+ ), J = R(
1247
+ (n, m) => {
1248
+ x((p) => {
1249
+ const W = We(p, n, m);
1250
+ return C(W), W;
1251
+ });
1252
+ },
1253
+ [s]
1254
+ ), ie = R(
1255
+ (n, m, p) => {
1256
+ x((W) => {
1257
+ const X = Ne(W, n, m, p);
1258
+ return C(X), X;
1259
+ });
1260
+ },
1261
+ [s]
1262
+ ), Q = R(
1263
+ (n) => {
1264
+ x((m) => {
1265
+ const p = Ae(m, n);
1266
+ return s == null || s(ee(p, "reasonChange")), p;
1267
+ });
1268
+ },
1269
+ [s]
1270
+ ), q = R(async () => {
1271
+ F(!0);
1272
+ try {
1273
+ d(De(f, v, c));
1274
+ } finally {
1275
+ F(!1);
1276
+ }
1277
+ }, [f, c, v, d]);
1278
+ return /* @__PURE__ */ e.jsxs("div", { style: t.root, children: [
1279
+ c.decisionScenario && /* @__PURE__ */ e.jsxs("div", { style: t.scenarioBar, children: [
1280
+ /* @__PURE__ */ e.jsx("span", { style: t.scenarioBarLabel, children: "决策场景" }),
1281
+ /* @__PURE__ */ e.jsx("div", { style: t.scenarioBarText, className: "dm-scroll", children: c.decisionScenario })
1282
+ ] }),
1283
+ /* @__PURE__ */ e.jsxs("div", { style: t.workspace, children: [
1284
+ /* @__PURE__ */ e.jsx(
1285
+ Ie,
1286
+ {
1287
+ materials: c.materials,
1288
+ categories: y,
1289
+ previousEvidence: c.previousEvidence,
1290
+ activeTab: f.activeTab,
1291
+ markers: f.markers,
1292
+ scrollSignal: a,
1293
+ onTabChange: T,
1294
+ onRequestMarker: re
1295
+ }
1296
+ ),
1297
+ /* @__PURE__ */ e.jsx(
1298
+ Oe,
1299
+ {
1300
+ formState: f,
1301
+ decisionGroups: c.decisionGroups,
1302
+ reasonConfig: c.reasonConfig,
1303
+ categories: y,
1304
+ runtimeRules: B,
1305
+ initData: c,
1306
+ isSubmitting: M,
1307
+ onGoStep: S,
1308
+ onEditMarker: ne,
1309
+ onRemoveMarker: i,
1310
+ onAnnotatedClick: l,
1311
+ onSelectSingle: $,
1312
+ onToggleMulti: J,
1313
+ onFreeformChange: ie,
1314
+ onReasonChange: Q,
1315
+ onSubmit: q,
1316
+ showToast: G
1317
+ }
1318
+ )
1319
+ ] }),
1320
+ u.open && /* @__PURE__ */ e.jsx("div", { style: t.overlay, onClick: O, children: /* @__PURE__ */ e.jsxs("div", { style: t.modalBox, className: "dm-modal-box", onClick: (n) => n.stopPropagation(), children: [
1321
+ /* @__PURE__ */ e.jsxs("div", { style: t.modalHeader, children: [
1322
+ /* @__PURE__ */ e.jsx("div", { style: t.modalTitle, children: u.mode === "add" ? "🏷️ 添加决策点标注" : "✏️ 编辑决策点标注" }),
1323
+ /* @__PURE__ */ e.jsx("button", { style: t.modalClose, onClick: O, children: "×" })
1324
+ ] }),
1325
+ /* @__PURE__ */ e.jsxs("div", { style: t.modalBody, children: [
1326
+ /* @__PURE__ */ e.jsxs("div", { style: t.formGroup, children: [
1327
+ /* @__PURE__ */ e.jsx("label", { style: t.formLabel, children: "标注描述 *" }),
1328
+ /* @__PURE__ */ e.jsx(
1329
+ "input",
1330
+ {
1331
+ className: "dm-form-input",
1332
+ style: t.formInput,
1333
+ value: u.desc,
1334
+ autoFocus: !0,
1335
+ placeholder: "简要描述这个决策点的关键内容…",
1336
+ onChange: (n) => k((m) => ({ ...m, desc: n.target.value })),
1337
+ onKeyDown: (n) => {
1338
+ n.key === "Enter" && P();
1339
+ }
1340
+ }
1341
+ )
1342
+ ] }),
1343
+ /* @__PURE__ */ e.jsxs("div", { style: t.formGroup, children: [
1344
+ /* @__PURE__ */ e.jsx("label", { style: t.formLabel, children: "标注类别 *" }),
1345
+ /* @__PURE__ */ e.jsx("div", { style: t.typeSelector, children: y.map((n) => {
1346
+ const m = u.categoryKey === n.key;
1347
+ return /* @__PURE__ */ e.jsxs(
1348
+ "div",
1349
+ {
1350
+ className: "dm-type-option",
1351
+ style: {
1352
+ ...t.typeOption,
1353
+ ...m ? t.typeOptionSelected : {}
1354
+ },
1355
+ onClick: () => k((p) => ({ ...p, categoryKey: n.key })),
1356
+ children: [
1357
+ /* @__PURE__ */ e.jsx("span", { style: { ...t.typeDot, background: n.color } }),
1358
+ n.label
1359
+ ]
1360
+ },
1361
+ n.key
1362
+ );
1363
+ }) })
1364
+ ] })
1365
+ ] }),
1366
+ /* @__PURE__ */ e.jsxs("div", { style: t.modalFooter, children: [
1367
+ /* @__PURE__ */ e.jsx("button", { style: t.btnSecondary, onClick: O, children: "取消" }),
1368
+ /* @__PURE__ */ e.jsx("button", { className: "dm-btn-primary", style: t.btnPrimary, onClick: P, children: u.mode === "add" ? "确认添加" : "保存修改" })
1369
+ ] })
1370
+ ] }) }),
1371
+ N && /* @__PURE__ */ e.jsx(
1372
+ "div",
1373
+ {
1374
+ style: {
1375
+ ...t.toast,
1376
+ ...N.ok ? { background: "#389e0d" } : { background: "#d48806" }
1377
+ },
1378
+ children: N.msg
1379
+ }
1380
+ )
1381
+ ] });
1382
+ };
1383
+ export {
1384
+ qe as default
1385
+ };