@labelbee/lb-components 1.24.0-alpha.6 → 1.24.0-alpha.61

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 (173) hide show
  1. package/dist/_virtual/2DViewWorker.js +1 -1
  2. package/dist/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
  3. package/dist/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
  4. package/dist/components/DynamicResizer/DynamicResizer.js +1 -1
  5. package/dist/components/DynamicResizer/hooks/useDrag.js +1 -1
  6. package/dist/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
  7. package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
  8. package/dist/components/DynamicResizer/utils/index.js +1 -0
  9. package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
  10. package/dist/components/LLMMultiWheelView/index.js +1 -1
  11. package/dist/components/LLMToolView/index.js +1 -1
  12. package/dist/components/LLMToolView/modelAPIView/index.js +1 -1
  13. package/dist/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  14. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  15. package/dist/components/LLMToolView/questionView/index.js +1 -1
  16. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  17. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  18. package/dist/components/attributeInputEditor/index.js +1 -0
  19. package/dist/components/attributeList/index.js +1 -1
  20. package/dist/components/audioAnnotate/index.js +1 -1
  21. package/dist/components/audioPlayer/index.js +1 -1
  22. package/dist/components/longText/index.js +1 -1
  23. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  24. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  25. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  26. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  27. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  28. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  29. package/dist/components/pointCloudView/components/TitleButton/index.js +1 -1
  30. package/dist/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
  31. package/dist/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
  32. package/dist/components/pointCloudView/hooks/useConfig.js +1 -1
  33. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  34. package/dist/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
  35. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  36. package/dist/components/pointCloudView/index.js +1 -1
  37. package/dist/components/tagList/index.js +1 -1
  38. package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -1
  39. package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -1
  40. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +2 -1
  41. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -1
  42. package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -1
  43. package/dist/components/videoAnnotate/videoClipTool/index.js +2 -1
  44. package/dist/components/videoPlayer/components/SpeedController/index.js +1 -1
  45. package/dist/components/videoPlayer/index.js +1 -1
  46. package/dist/constant/index.js +1 -1
  47. package/dist/index.css +161 -96
  48. package/dist/store/Actions.js +1 -1
  49. package/dist/store/annotation/actionCreators.js +1 -1
  50. package/dist/store/annotation/reducer.js +1 -1
  51. package/dist/store/toolConfig/pointCloudToolConfig.js +1 -1
  52. package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +3 -3
  53. package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +24 -7
  54. package/dist/types/components/DynamicResizer/hooks/useDraggingAllowed.d.ts +12 -0
  55. package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +10 -21
  56. package/dist/types/components/DynamicResizer/types/interface.d.ts +14 -6
  57. package/dist/types/components/DynamicResizer/utils/index.d.ts +4 -0
  58. package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +2 -0
  59. package/dist/types/components/LLMMultiWheelView/index.d.ts +2 -0
  60. package/dist/types/components/LLMToolView/questionView/components/audioView/index.d.ts +8 -0
  61. package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +3 -1
  62. package/dist/types/components/attributeInputEditor/index.d.ts +8 -0
  63. package/dist/types/components/attributeList/components/limitPopover/index.d.ts +2 -2
  64. package/dist/types/components/longText/index.d.ts +1 -1
  65. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
  66. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +4 -0
  67. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
  68. package/dist/types/components/pointCloudView/hooks/useConfig.d.ts +2 -1
  69. package/dist/types/components/pointCloudView/hooks/usePointCloudAttribute.d.ts +3 -0
  70. package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
  71. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
  72. package/dist/types/components/pointCloudView/index.d.ts +2 -0
  73. package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +1 -0
  74. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +32 -1
  75. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  76. package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +1 -1
  77. package/dist/types/components/videoPlayer/index.d.ts +1 -1
  78. package/dist/types/constant/index.d.ts +4 -2
  79. package/dist/types/store/Actions.d.ts +1 -0
  80. package/dist/types/store/annotation/actionCreators.d.ts +9 -1
  81. package/dist/types/store/annotation/map.d.ts +1 -0
  82. package/dist/types/store/annotation/reducer.d.ts +5 -1
  83. package/dist/types/store/annotation/types.d.ts +4 -2
  84. package/dist/types/store/toolConfig/types.d.ts +2 -0
  85. package/dist/types/utils/LLM.d.ts +6 -0
  86. package/dist/types/views/MainView/index.d.ts +2 -0
  87. package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +3 -0
  88. package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +9 -0
  89. package/dist/types/views/MainView/sidebar/GlobalTagList/index.d.ts +9 -0
  90. package/dist/types/views/MainView/sidebar/VideoClipToolAttributeList/index.d.ts +11 -0
  91. package/dist/types/views/MainView/sidebar/index.d.ts +2 -0
  92. package/dist/utils/LLM.js +1 -0
  93. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -1
  94. package/dist/views/MainView/index.js +1 -1
  95. package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  96. package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  97. package/dist/views/MainView/sidebar/GlobalTagList/index.js +1 -0
  98. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  99. package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
  100. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  101. package/dist/views/MainView/sidebar/ToolIcons.js +1 -1
  102. package/dist/views/MainView/sidebar/VideoClipToolAttributeList/index.js +1 -0
  103. package/dist/views/MainView/sidebar/index.js +1 -1
  104. package/es/_virtual/2DViewWorker.js +1 -1
  105. package/es/assets/annotation/rectTool/three_points_rect.svg.js +1 -0
  106. package/es/assets/annotation/rectTool/two_points_rect.svg.js +1 -0
  107. package/es/components/DynamicResizer/DynamicResizer.js +1 -1
  108. package/es/components/DynamicResizer/hooks/useDrag.js +1 -1
  109. package/es/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
  110. package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
  111. package/es/components/DynamicResizer/utils/index.js +1 -0
  112. package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
  113. package/es/components/LLMMultiWheelView/index.js +1 -1
  114. package/es/components/LLMToolView/index.js +1 -1
  115. package/es/components/LLMToolView/modelAPIView/index.js +1 -1
  116. package/es/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  117. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  118. package/es/components/LLMToolView/questionView/index.js +1 -1
  119. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  120. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  121. package/es/components/attributeInputEditor/index.js +1 -0
  122. package/es/components/attributeList/index.js +1 -1
  123. package/es/components/audioAnnotate/index.js +1 -1
  124. package/es/components/audioPlayer/index.js +1 -1
  125. package/es/components/longText/index.js +1 -1
  126. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  127. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  128. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  129. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  130. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  131. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  132. package/es/components/pointCloudView/components/TitleButton/index.js +1 -1
  133. package/es/components/pointCloudView/components/UnifyParamsModal/index.js +1 -1
  134. package/es/components/pointCloudView/components/sideAndBackOverView/index.js +1 -1
  135. package/es/components/pointCloudView/hooks/useConfig.js +1 -1
  136. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  137. package/es/components/pointCloudView/hooks/usePointCloudAttribute.js +1 -0
  138. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  139. package/es/components/pointCloudView/index.js +1 -1
  140. package/es/components/tagList/index.js +1 -1
  141. package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -1
  142. package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -1
  143. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +2 -1
  144. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -1
  145. package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -1
  146. package/es/components/videoAnnotate/videoClipTool/index.js +2 -1
  147. package/es/components/videoPlayer/components/SpeedController/index.js +1 -1
  148. package/es/components/videoPlayer/index.js +1 -1
  149. package/es/constant/index.js +1 -1
  150. package/es/index.css +161 -96
  151. package/es/store/Actions.js +1 -1
  152. package/es/store/annotation/actionCreators.js +1 -1
  153. package/es/store/annotation/reducer.js +1 -1
  154. package/es/store/toolConfig/pointCloudToolConfig.js +1 -1
  155. package/es/utils/LLM.js +1 -0
  156. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -1
  157. package/es/views/MainView/index.js +1 -1
  158. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  159. package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  160. package/es/views/MainView/sidebar/GlobalTagList/index.js +1 -0
  161. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  162. package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
  163. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  164. package/es/views/MainView/sidebar/ToolIcons.js +1 -1
  165. package/es/views/MainView/sidebar/VideoClipToolAttributeList/index.js +1 -0
  166. package/es/views/MainView/sidebar/index.js +1 -1
  167. package/package.json +8 -8
  168. package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
  169. package/dist/components/DynamicResizer/assets/divider.svg.js +0 -1
  170. package/dist/components/DynamicResizer/assets/topToZero.svg.js +0 -1
  171. package/es/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
  172. package/es/components/DynamicResizer/assets/divider.svg.js +0 -1
  173. package/es/components/DynamicResizer/assets/topToZero.svg.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS",UPDATE_IMG_INDEX_BY_EXTERNAL:"@@UPDATE_IMG_INDEX_BY_EXTERNAL"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS",UPDATE_IMG_INDEX_BY_EXTERNAL:"@@UPDATE_IMG_INDEX_BY_EXTERNAL",CHANGE_PAGE_CHECK:"@@CHANGE_PAGE_CHECK"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(t,e,n)=>new Promise((a,r)=>{var o=s=>{try{T(n.next(s))}catch(p){r(p)}},i=s=>{try{T(n.throw(s))}catch(p){r(p)}},T=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,i);T((n=n.apply(t,e)).next())});const dispatchTasks=(t,e)=>e.map(n=>t(n)),getSubmitByPageOperation=t=>t===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:t===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:t===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(t,e)=>{var n,a,r;const{imgList:o,imgIndex:i}=t,{dataSourceStep:T}=reducer.getStepConfig(t.stepList,t.step);return((r=(a=index$1.jsonParser((n=o[i-1])==null?void 0:n.result)[`step_${T}`])==null?void 0:a.result)==null?void 0:r.length)-1||e};function UpdateToolInstance(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function SetTaskStepList({stepList:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:t}}}function SetTaskConfig({stepList:t,step:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function UpdateOnSubmit(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function UpdateOnSave(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:t}}}function UpdateOnPageChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function UpdateOnStepChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function UpdateGetFileData(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function UpdatePageSize(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function UpdateGetFileList(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(t){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function UpdateBeforeRotate(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function UpdatePreDataProcess(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function UpdateImgIndexByExternal(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function BatchUpdateTrackID({id:t,newID:e,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(t,e,n){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=t=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:t}}),UpdateHighlightAttribute=t=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function InitTaskData({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,step:T,stepList:s,skipBeforePageTurning:p,beforeRotate:N,checkMode:A,highlightAttribute:d,preDataProcess:I,getImgIndexByExternal:l}){const u=[];return t&&u.push(UpdateOnSubmit(t)),e&&u.push(UpdateOnSave(e)),n&&u.push(UpdateOnPageChange(n)),a&&u.push(UpdateOnStepChange(a)),r&&u.push(UpdateGetFileData(r)),i&&u.push(UpdateGetFileList(i)),o&&u.push(UpdatePageSize(o)),p&&u.push(UpdateSkipBeforePageTurning(p)),N&&u.push(UpdateBeforeRotate(N)),I&&u.push(UpdatePreDataProcess(I)),typeof A=="boolean"&&u.push(UpdateCheckMode(A)),l&&u.push(UpdateImgIndexByExternal(l)),u.push(UpdateHighlightAttribute(d)),u.push(SetTaskConfig({stepList:s,step:T})),u.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),u.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),O=>dispatchTasks(O,u)}function UpdateInjectFunc({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,stepList:T,beforeRotate:s,highlightAttribute:p,preDataProcess:N}){const A=[];return t&&A.push(UpdateOnSubmit(t)),e&&A.push(UpdateOnSave(e)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),i&&A.push(UpdateGetFileList(i)),o&&A.push(UpdatePageSize(o)),s&&A.push(UpdateBeforeRotate(s)),N&&A.push(UpdatePreDataProcess(N)),A.push(UpdateHighlightAttribute(p)),A.push(SetTaskStepList({stepList:T})),d=>dispatchTasks(d,A)}const getNextStep=(t,e)=>{var n;const a=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[a+1])==null?void 0:n.step},ToNextStep=t=>(e,n)=>{const{annotation:a}=n(),{step:r,stepList:o}=a,i=getNextStep(r,o);return[e(UpdateProcessingStep(i,t))]},UpdateProcessingStep=(t,e)=>(n,a)=>{var r,o;const{annotation:i}=a();(r=i==null?void 0:i.onStepChange)==null||r.call(i,t);const T=(o=i==null?void 0:i.imgIndex)!=null?o:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:t}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(e!=null?e:T,0))]},ToSubmitFileData=t=>e=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:t}})],SubmitAndChangeFileIndex=(t,e,n,a)=>__async(void 0,null,function*(){t(ToSubmitFileData(n)),yield t(SubmitHandler(n)),t(reducer.LoadFileAndFileData(e,a))}),ChangeBasicIndex=(t,e)=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:e}})],ChangeTriggerEventAfterIndexChanged=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},PageBackward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Backward,t),PageForward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Forward,t),PageJump=(t,e=!1)=>(n,a)=>{if(t!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,e,t)},loadImgList=(t,e,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:o,imgList:i,pageSize:T}=e().annotation,s=Math.floor(n/T);SetAnnotationLoading(t,!0);try{const p=yield o(s,T);if(SetAnnotationLoading(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const N=a?new Array(p.total):[...i];return N.splice(s*T,T,...p.fileList),t({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(p){SetAnnotationLoading(t,!1),console.error(p)}}),DispatcherTurning=(t,e,n,a=!1,r)=>__async(void 0,null,function*(){var o,i;const T=e().annotation,s=getSubmitByPageOperation(n);let{fileIndexChanged:p,fileIndex:N,basicIndexChanged:A,basicIndex:d}=PageOperator.getNextPageInfo(n,T,r);const I=(o=T==null?void 0:T.getImgIndexByExternal)==null?void 0:o.call(T,T.imgIndex,s);if(I!==void 0&&(p=!0,N=I),ChangeTriggerEventAfterIndexChanged(t,a),p){if(T.loading||!T.imgList[N]&&!(yield loadImgList(t,e,N)))return;const l=e();(i=T.onPageChange)==null||i.call(T,N);const u=s===index.ESubmitType.Backward?getBasicIndex(l.annotation,d):d;return SubmitAndChangeFileIndex(t,N,s,u)}return A?ChangeBasicIndex(t,d):t(ToSubmitFileData(s))}),ChangeSave=t=>{t(ToSubmitFileData(index.ESubmitType.Save)),t({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetLoadPCDFileLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},InitAnnotationState=t=>{t({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:e}})},SetPredictResultVisible=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},GetBoxesByID=(t,e)=>(n,a)=>{const{imgList:r,step:o}=a().annotation;return util.getBoxesByTrackID(r,o,t,e)},PreDataProcess=t=>(e,n)=>{var a,r;const{annotation:o}=n();return(r=(a=o==null?void 0:o.preDataProcess)==null?void 0:a.call(o,t))!=null?r:t.dataList},SubmitHandler=t=>(e,n)=>__async(void 0,null,function*(){const{annotation:a}=n(),{onSubmit:r,imgIndex:o,imgList:i}=a;!r||(yield r([i[o]],t,o,i))});exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.SubmitHandler=SubmitHandler,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateImgIndexByExternal=UpdateImgIndexByExternal,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),lbUtils=require("@labelbee/lb-utils"),lbAnnotation=require("@labelbee/lb-annotation"),util=require("../../components/predictTracking/previewResult/util.js"),antd=require("antd"),__async=(e,t,n)=>new Promise((a,r)=>{var o=s=>{try{T(n.next(s))}catch(u){r(u)}},i=s=>{try{T(n.throw(s))}catch(u){r(u)}},T=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,i);T((n=n.apply(e,t)).next())});const dispatchTasks=(e,t)=>t.map(n=>e(n)),getSubmitByPageOperation=e=>e===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:e===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:e===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(e,t)=>{var n,a,r;const{imgList:o,imgIndex:i}=e,{dataSourceStep:T}=reducer.getStepConfig(e.stepList,e.step);return((r=(a=index$1.jsonParser((n=o[i-1])==null?void 0:n.result)[`step_${T}`])==null?void 0:a.result)==null?void 0:r.length)-1||t};function UpdateToolInstance(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:e}}}function SetTaskStepList({stepList:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:e}}}function SetTaskConfig({stepList:e,step:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:e,step:t}}}function UpdateOnSubmit(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:e}}}function UpdateOnSave(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:e}}}function UpdateOnPageChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:e}}}function UpdateOnStepChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:e}}}function UpdateGetFileData(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:e}}}function UpdatePageSize(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:e}}}function UpdateGetFileList(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:e}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(e){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:e}}}function UpdateBeforeRotate(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:e}}}function UpdatePreDataProcess(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:e}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function UpdateImgIndexByExternal(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:e}}}function BatchUpdateTrackID({id:e,newID:t,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:e,newID:t,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(e,t,n,a){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:e,newData:t,rangeIndex:n,imgList:a}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=e=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:e}}),UpdateHighlightAttribute=e=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:e}});function InitTaskData({onSubmit:e,onSave:t,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,step:T,stepList:s,skipBeforePageTurning:u,beforeRotate:N,checkMode:p,highlightAttribute:d,preDataProcess:l,getImgIndexByExternal:I}){const A=[];return e&&A.push(UpdateOnSubmit(e)),t&&A.push(UpdateOnSave(t)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),i&&A.push(UpdateGetFileList(i)),o&&A.push(UpdatePageSize(o)),u&&A.push(UpdateSkipBeforePageTurning(u)),N&&A.push(UpdateBeforeRotate(N)),l&&A.push(UpdatePreDataProcess(l)),typeof p=="boolean"&&A.push(UpdateCheckMode(p)),I&&A.push(UpdateImgIndexByExternal(I)),A.push(UpdateHighlightAttribute(d)),A.push(SetTaskConfig({stepList:s,step:T})),A.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),A.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),O=>dispatchTasks(O,A)}function UpdateInjectFunc({onSubmit:e,onSave:t,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,stepList:T,beforeRotate:s,highlightAttribute:u,preDataProcess:N}){const p=[];return e&&p.push(UpdateOnSubmit(e)),t&&p.push(UpdateOnSave(t)),n&&p.push(UpdateOnPageChange(n)),a&&p.push(UpdateOnStepChange(a)),r&&p.push(UpdateGetFileData(r)),i&&p.push(UpdateGetFileList(i)),o&&p.push(UpdatePageSize(o)),s&&p.push(UpdateBeforeRotate(s)),N&&p.push(UpdatePreDataProcess(N)),p.push(UpdateHighlightAttribute(u)),p.push(SetTaskStepList({stepList:T})),d=>dispatchTasks(d,p)}const getNextStep=(e,t)=>{var n;const a=t==null?void 0:t.findIndex(r=>(r==null?void 0:r.step)===e);return(n=t[a+1])==null?void 0:n.step},ToNextStep=e=>(t,n)=>{const{annotation:a}=n(),{step:r,stepList:o}=a,i=getNextStep(r,o);return[t(UpdateProcessingStep(i,e))]},UpdateProcessingStep=(e,t)=>(n,a)=>{var r,o;const{annotation:i}=a();(r=i==null?void 0:i.onStepChange)==null||r.call(i,e);const T=(o=i==null?void 0:i.imgIndex)!=null?o:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:e}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(t!=null?t:T,0))]},ToSubmitFileData=e=>t=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:e}})],SubmitAndChangeFileIndex=(e,t,n,a)=>__async(void 0,null,function*(){SetAnnotationLoading(e,!0),e(ToSubmitFileData(n)),yield e(SubmitHandler(n)),e(reducer.LoadFileAndFileData(t,a))}),ChangeBasicIndex=(e,t)=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:t}})],ChangeTriggerEventAfterIndexChanged=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:t}})},PageBackward=(e=!1)=>(t,n)=>CheckExecutePageTurning(t,n,AnnotationSize.EPageTurningOperation.Backward,e),PageForward=(e=!1)=>(t,n)=>CheckExecutePageTurning(t,n,AnnotationSize.EPageTurningOperation.Forward,e),PageJump=(e,t=!1)=>(n,a)=>{if(e!==a().imgIndex)return CheckExecutePageTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,t,e)},loadImgList=(e,t,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:o,imgList:i,pageSize:T}=t().annotation,s=Math.floor(n/T);SetAnnotationLoading(e,!0);try{const u=yield o(s,T);if(SetAnnotationLoading(e,!1),!((r=u==null?void 0:u.fileList)==null?void 0:r.length)||!(u==null?void 0:u.total))throw new Error("fileList and total are required");const N=a?new Array(u.total):[...i];return N.splice(s*T,T,...u.fileList),e({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(u){SetAnnotationLoading(e,!1),console.error(u)}}),CheckExecutePageTurning=(e,t,n,a=!1,r)=>__async(void 0,null,function*(){e({type:Actions.ANNOTATION_ACTIONS.CHANGE_PAGE_CHECK});const{t:o}=lbUtils.i18n,i=t(),{confirmPageTurning:T,stepList:s,step:u}=i.annotation||!1,N=reducer.getStepConfig(s,u),{confirm:p,destroyAll:d}=antd.Modal;return!T||N.tool!==lbAnnotation.EVideoToolName.VideoTagTool?DispatcherTurning(e,t,n,a,r):new Promise(l=>{d(),p({centered:!0,title:o("TheCurrentImageHasNotBeenAnnotatedYetAreYouSureToTurnThePage"),onCancel:()=>l(!1),onOk:()=>l(!0)})}).then(l=>l?DispatcherTurning(e,t,n,a,r):Promise.resolve())}),DispatcherTurning=(e,t,n,a=!1,r)=>__async(void 0,null,function*(){var o,i;const T=t().annotation,s=getSubmitByPageOperation(n);let{fileIndexChanged:u,fileIndex:N,basicIndexChanged:p,basicIndex:d}=PageOperator.getNextPageInfo(n,T,r);const l=(o=T==null?void 0:T.getImgIndexByExternal)==null?void 0:o.call(T,T.imgIndex,s);if(l!==void 0&&(u=!0,N=l),ChangeTriggerEventAfterIndexChanged(e,a),u){if(T.loading||!T.imgList[N]&&!(yield loadImgList(e,t,N)))return;const I=t();(i=T.onPageChange)==null||i.call(T,N);const A=s===index.ESubmitType.Backward?getBasicIndex(I.annotation,d):d;return SubmitAndChangeFileIndex(e,N,s,A)}return p?ChangeBasicIndex(e,d):e(ToSubmitFileData(s))}),ChangeSave=e=>{e(ToSubmitFileData(index.ESubmitType.Save)),e({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:t}})},SetLoadPCDFileLoading=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:t}})},InitAnnotationState=e=>{e({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:t}})},SetPredictResultVisible=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:t}})},GetBoxesByID=(e,t)=>(n,a)=>{const{imgList:r,step:o}=a().annotation;return util.getBoxesByTrackID(r,o,e,t)},PreDataProcess=e=>(t,n)=>{var a,r;const{annotation:o}=n();return(r=(a=o==null?void 0:o.preDataProcess)==null?void 0:a.call(o,e))!=null?r:e.dataList},SubmitHandler=e=>(t,n)=>__async(void 0,null,function*(){const{annotation:a}=n(),{onSubmit:r,imgIndex:o,imgList:i}=a;!r||(yield r([i[o]],e,o,i))});exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CheckExecutePageTurning=CheckExecutePageTurning,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.SubmitHandler=SubmitHandler,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateImgIndexByExternal=UpdateImgIndexByExternal,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__spreadValues=(e,t)=>{for(var l in t||(t={}))__hasOwnProp.call(t,l)&&__defNormalProp(e,l,t[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(t))__propIsEnum.call(t,l)&&__defNormalProp(e,l,t[l]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,l)=>new Promise((g,u)=>{var S=I=>{try{O(l.next(I))}catch(m){u(m)}},p=I=>{try{O(l.throw(I))}catch(m){u(m)}},O=I=>I.done?g(I.value):Promise.resolve(I.value).then(S,p);O((l=l.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(l=>l.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:l}=e;return Math.ceil(t.length/l)},calcStepProgress=(e,t)=>e.reduce((l,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return l+1}return l},0)/e.length,updateToolInstance=(e,t)=>{const{step:l,stepList:g}=e,u=StepUtils.getCurrentStepInfo(l,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP,ToolType.EToolName.LLMMultiWheel].includes(u==null?void 0:u.tool))return;const p=document.getElementById("toolContainer");if(!p)throw"Not exist dom named id-toolContainer";const O=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:p,toolName:u.tool,size:O,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(l,g)=>__async(void 0,null,function*(){var u,S;const{stepList:p,step:O}=g().annotation,I=StepUtils.currentToolIsVideo(O,p),m=StepUtils.currentToolIsPointCloud(O,p),D=[ToolType.EToolName.LLM,ToolType.EToolName.LLMMultiWheel].includes((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool),y=((S=StepUtils.getCurrentStepInfo(O,p))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(O,p);if(actionCreators.SetAnnotationLoading(l,!0),yield l(TryGetFileDataByAPI(e)),I){l(AfterVideoLoaded(e));return}if(m||D||P||y){l(AfterCommonLoaded(e));return}l(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,l)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=l().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(l,g)=>{var u;const{toolInstance:S,imgList:p}=g().annotation,O=(u=p==null?void 0:p[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(O).then(I=>{actionCreators.SetAnnotationLoading(l,!1),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(l,!1),S==null||S.setErrorImg(),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:l,stepList:g,step:u=1})=>{var S,p,O,I;const m=((S=t[l])==null?void 0:S.result)||"",[D,y,P]=(p=e==null?void 0:e.exportData())!=null?p:[],x=(I=(O=e==null?void 0:e.exportCustomData)==null?void 0:O.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((b,F)=>F===l?__spreadValues(__spreadProps(__spreadValues({},b),{result:w}),P):__spreadValues({},b))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var l,g,u,S,p,O,I,m,D,y,P,x,B,w,b,F,G,V,q,k,H,z,W,K,$,X,Y,J;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,s=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:s})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:s,stepList:i,toolInstance:a,onSubmit:r,resultList:A}=e;if(!a||!n[o])return e;const T=((l=n[o])==null?void 0:l.result)||"",[,d,c]=(g=a==null?void 0:a.exportData())!=null?g:[],N=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(T,d),L=data.composeResult(f,{step:s,stepList:i},{rect:A},N),C=e.imgList.map((v,E)=>{if(E===o){const U=AnnotationDataUtils.dataCorrection(L,T,s,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:U}),c)}return v});if(((p=t.payload)==null?void 0:p.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:C});const R=calcStepProgress(C,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:C})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:s}=e;return s==null||s(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:s,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(O=i==null?void 0:i.exportData())!=null?O:[];let A=r;if((a==null?void 0:a.length)>0){const T=(I=a[o])==null?void 0:I.id,d=r.map(c=>__spreadProps(__spreadValues({},c),{sourceID:T}));A=___default.default.cloneDeep(s).filter(c=>c.sourceID!==T),A.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:A,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:s,imgIndex:i,stepList:a,annotationEngine:r,resultList:A,basicResultList:T}=e;if(!n||!r)return e;const d=t.payload.basicIndex,c=(m=T[d])==null?void 0:m.id,N=index.jsonParser((D=s[i])==null?void 0:D.result),f=(A||[]).filter(U=>U.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:C,tool:R}=L,v=getStepConfig(a,C);let E=[];return C&&R&&(E=(y=N[`step_${C}`])==null?void 0:y.result,(E==null?void 0:E.length)>0?(r==null||r.setBasicInfo(v.tool,E[d]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:s,annotationEngine:i,stepList:a}=e;if(!s)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:A,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((P=n[A])==null?void 0:P.result),L=f[`step_${r.step}`],C=!L,R={rotate:(x=f.rotate)!=null?x:0,valid:(B=f.valid)!=null?B:!0};T&&c!==!0?i==null||i.setImgNode(T,R):s==null||s.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:E,tool:U}=v,Z=getStepConfig(a,E),M=E&&U,h=(b=(w=f[`step_${E}`])==null?void 0:w.result)!=null?b:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,h,C);if(i==null||i.launchOperation(),M&&((h==null?void 0:h.length)>0?i==null||i.setBasicInfo(Z.tool,h[N]):(i==null||i.setBasicInfo(Z.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"&&M){const Q=(G=(F=h[N])==null?void 0:F.id)!=null?G:"",ee=M?j.filter(te=>lbAnnotation.CommonToolUtils.isSameSourceID(te.sourceID,Q)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(ee)}return __spreadProps(__spreadValues({},e),{imgIndex:A,basicIndex:N,basicResultList:h,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:s,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL:return __spreadProps(__spreadValues({},e),{getImgIndexByExternal:t.payload.getImgIndexByExternal});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:s}=e,i=[...s];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:s,step:i,stepList:a}=e;if(!n)return e;if(o===0||o>=s.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const r=s[o-1].result;if(!r)return e;const A=StepUtils.getCurrentStepInfo(i,a),T=(W=A==null?void 0:A.step)!=null?W:i,d=(K=n==null?void 0:n.valid)!=null?K:!0,c=AnnotationDataUtils.copyResultChange({copyResult:r,step:T,currentResult:($=s[o].result)!=null?$:"",preMappingImgList:(X=s[o-1].mappingImgList)!=null?X:[],mappingImgList:(Y=s[o].mappingImgList)!=null?Y:[],valid:d});s[o]=__spreadProps(__spreadValues({},s[o]),{result:c});const f=index.jsonParser(c)[`step_${i}`],L=(f==null?void 0:f.result)||[];return n==null||n.setResult(L),n==null||n.history.pushHistory(L),(J=n==null?void 0:n.asyncData)==null||J.call(n,s[o]),__spreadProps(__spreadValues({},e),{imgList:[...s]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:s}=t.payload;if(o){const i=getStepConfig(n,s);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:s,toolInstance:o==null?void 0:o.toolInstance})}return __spreadProps(__spreadValues({},e),{step:s})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:s,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:s}=t.payload,{imgList:i,imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:s,step:i,predictionResult:a}=e,r={};a.forEach(c=>{const{index:N}=c;r[N]=___default.default.pick(c,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const A=`step_${i}`,T=[],d=o.map((c,N)=>{if(r[N]){const f=c.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:s},{rect:[]},{})):index.jsonParser(c.result);f[A].result.push(r[N]);const L=__spreadProps(__spreadValues({},c),{result:JSON.stringify(f)});return T.push({imgIndex:N,newInfo:L}),L}return c});return n==null||n(d,index$1.ESubmitType.BatchUpdateImgList,-1,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__spreadValues=(e,t)=>{for(var l in t||(t={}))__hasOwnProp.call(t,l)&&__defNormalProp(e,l,t[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(t))__propIsEnum.call(t,l)&&__defNormalProp(e,l,t[l]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,l)=>new Promise((g,u)=>{var S=A=>{try{O(l.next(A))}catch(m){u(m)}},p=A=>{try{O(l.throw(A))}catch(m){u(m)}},O=A=>A.done?g(A.value):Promise.resolve(A.value).then(S,p);O((l=l.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(l=>l.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:"",confirmPageTurning:!1},getTotalPage=e=>{const{imgList:t,imgPageSize:l}=e;return Math.ceil(t.length/l)},calcStepProgress=(e,t)=>e.reduce((l,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return l+1}return l},0)/e.length,updateToolInstance=(e,t)=>{const{step:l,stepList:g}=e,u=StepUtils.getCurrentStepInfo(l,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP,ToolType.EToolName.LLMMultiWheel].includes(u==null?void 0:u.tool))return;const p=document.getElementById("toolContainer");if(!p)throw"Not exist dom named id-toolContainer";const O=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),A=new lbAnnotation.AnnotationEngine({container:p,toolName:u.tool,size:O,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:A==null?void 0:A.toolInstance,annotationEngine:A}},LoadFileAndFileData=(e,t)=>(l,g)=>__async(void 0,null,function*(){var u,S;const{stepList:p,step:O}=g().annotation,A=StepUtils.currentToolIsVideo(O,p),m=StepUtils.currentToolIsPointCloud(O,p),D=[ToolType.EToolName.LLM,ToolType.EToolName.LLMMultiWheel].includes((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool),y=((S=StepUtils.getCurrentStepInfo(O,p))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(O,p);if(actionCreators.SetAnnotationLoading(l,!0),yield l(TryGetFileDataByAPI(e)),A){l(AfterVideoLoaded(e));return}if(m||D||P||y){l(AfterCommonLoaded(e));return}l(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,l)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=l().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(l,g)=>{var u;const{toolInstance:S,imgList:p}=g().annotation,O=(u=p==null?void 0:p[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(O).then(A=>{actionCreators.SetAnnotationLoading(l,!1),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:A,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(l,!1),S==null||S.setErrorImg(),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:l,stepList:g,step:u=1})=>{var S,p,O,A;const m=((S=t[l])==null?void 0:S.result)||"",[D,y,P]=(p=e==null?void 0:e.exportData())!=null?p:[],x=(A=(O=e==null?void 0:e.exportCustomData)==null?void 0:O.call(e))!=null?A:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((U,F)=>F===l?__spreadValues(__spreadProps(__spreadValues({},U),{result:w}),P):__spreadValues({},U))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var l,g,u,S,p,O,A,m,D,y,P,x,B,w,U,F,G,V,q,k,H,z,K,W,$,X,Y,J,Z;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,s=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:s})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:s,stepList:i,toolInstance:a,onSubmit:r,resultList:I}=e;if(!a||!n[o])return e;const T=((l=n[o])==null?void 0:l.result)||"",[,d,c]=(g=a==null?void 0:a.exportData())!=null?g:[],N=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(T,d),L=data.composeResult(f,{step:s,stepList:i},{rect:I},N),E=e.imgList.map((v,C)=>{if(C===o){const h=AnnotationDataUtils.dataCorrection(L,T,s,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:h}),c)}return v});if(((p=t.payload)==null?void 0:p.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:E});const R=calcStepProgress(E,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:E})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:s}=e;return s==null||s(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:s,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(O=i==null?void 0:i.exportData())!=null?O:[];let I=r;if((a==null?void 0:a.length)>0){const T=(A=a[o])==null?void 0:A.id,d=r.map(c=>__spreadProps(__spreadValues({},c),{sourceID:T}));I=___default.default.cloneDeep(s).filter(c=>c.sourceID!==T),I.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:I,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:s,imgIndex:i,stepList:a,annotationEngine:r,resultList:I,basicResultList:T}=e;if(!n||!r)return e;const d=t.payload.basicIndex,c=(m=T[d])==null?void 0:m.id,N=index.jsonParser((D=s[i])==null?void 0:D.result),f=(I||[]).filter(h=>h.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:E,tool:R}=L,v=getStepConfig(a,E);let C=[];return E&&R&&(C=(y=N[`step_${E}`])==null?void 0:y.result,(C==null?void 0:C.length)>0?(r==null||r.setBasicInfo(v.tool,C[d]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:s,annotationEngine:i,stepList:a}=e;if(!s)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:I,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((P=n[I])==null?void 0:P.result),L=f[`step_${r.step}`],E=!L,R={rotate:(x=f.rotate)!=null?x:0,valid:(B=f.valid)!=null?B:!0};T&&c!==!0?i==null||i.setImgNode(T,R):s==null||s.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:C,tool:h}=v,Q=getStepConfig(a,C),M=C&&h,b=(U=(w=f[`step_${C}`])==null?void 0:w.result)!=null?U:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,b,E);i==null||i.launchOperation();const ee=[ToolType.EToolName.Cuboid,ToolType.EToolName.ScribbleTool].includes(h);if(M&&((b==null?void 0:b.length)>0?i==null||i.setBasicInfo(Q.tool,b[N]):(i==null||i.setBasicInfo(Q.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"&&(ee||M)){const te=(G=(F=b[N])==null?void 0:F.id)!=null?G:"",ne=M?j.filter(oe=>lbAnnotation.CommonToolUtils.isSameSourceID(oe.sourceID,te)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(ne)}return __spreadProps(__spreadValues({},e),{imgIndex:I,basicIndex:N,basicResultList:b,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:s,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL:return __spreadProps(__spreadValues({},e),{getImgIndexByExternal:t.payload.getImgIndexByExternal});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:s}=e,i=[...s];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:s,step:i,stepList:a}=e;if(!n)return e;if(o===0||o>=s.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const r=s[o-1].result;if(!r)return e;const I=StepUtils.getCurrentStepInfo(i,a),T=(K=I==null?void 0:I.step)!=null?K:i,d=(W=n==null?void 0:n.valid)!=null?W:!0,c=AnnotationDataUtils.copyResultChange({copyResult:r,step:T,currentResult:($=s[o].result)!=null?$:"",preMappingImgList:(X=s[o-1].mappingImgList)!=null?X:[],mappingImgList:(Y=s[o].mappingImgList)!=null?Y:[],valid:d});s[o]=__spreadProps(__spreadValues({},s[o]),{result:c});const f=index.jsonParser(c)[`step_${i}`],L=(f==null?void 0:f.result)||[];return n==null||n.setResult(L),n==null||n.history.pushHistory(L),(J=n==null?void 0:n.asyncData)==null||J.call(n,s[o]),__spreadProps(__spreadValues({},e),{imgList:[...s]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:s}=t.payload;if(o){const i=getStepConfig(n,s);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:s,toolInstance:o==null?void 0:o.toolInstance})}return __spreadProps(__spreadValues({},e),{step:s})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:s,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,I=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:d.result})});return I.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:I}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const n=t,{id:o,newData:s,rangeIndex:i,imgList:a}=n.payload,{imgIndex:r,onSubmit:I}=e,T=[],d=a.map((c,N)=>{if(lbAnnotation.MathUtils.isInRange(N,i)){const f=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:o,newData:s,result:c.result})});return T.push({imgIndex:N,newInfo:f}),f}return c});return I&&I([d[r]],index$1.ESubmitType.BatchUpdateTrackID,r,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:s,step:i,predictionResult:a}=e,r={};a.forEach(c=>{const{index:N}=c;r[N]=___default.default.pick(c,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const I=`step_${i}`,T=[],d=o.map((c,N)=>{if(r[N]){const f=c.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:s},{rect:[]},{})):index.jsonParser(c.result);f[I].result.push(r[N]);const L=__spreadProps(__spreadValues({},c),{result:JSON.stringify(f)});return T.push({imgIndex:N,newInfo:L}),L}return c});return n==null||n(d,index$1.ESubmitType.BatchUpdateImgList,-1,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.CHANGE_PAGE_CHECK:{const{toolInstance:n,step:o,stepList:s}=e;if(!n)return e;const[i]=(Z=n==null?void 0:n.exportData())!=null?Z:[],a=getStepConfig(s,o),r=ConfigUtils.ConfigUtils.jsonParser(a.config),I=i.some(T=>(T==null?void 0:T.result)&&Object.keys(T.result).length>0);return __spreadProps(__spreadValues({},e),{confirmPageTurning:r.showConfirm&&!I})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
@@ -1 +1 @@
1
- "use strict";const pointCloudToolStateCreator=(e,o)=>({selectBoxVisibleSwitch:!1,setSelectBoxVisibleSwitch:t=>e(()=>({selectBoxVisibleSwitch:t}))});module.exports=pointCloudToolStateCreator;
1
+ "use strict";const pointCloudToolStateCreator=(t,i)=>({selectBoxVisibleSwitch:!1,setSelectBoxVisibleSwitch:e=>t(()=>({selectBoxVisibleSwitch:e})),attrChangeTrigger:0,setAttrChangeTrigger:e=>t(()=>({attrChangeTrigger:e}))});module.exports=pointCloudToolStateCreator;
@@ -1,5 +1,5 @@
1
- import { FC } from 'react';
2
- import './DynamicResizer.scss';
1
+ import React from 'react';
3
2
  import { DynamicResizerProps } from './types/interface';
4
- declare const DynamicResizer: FC<DynamicResizerProps>;
3
+ import './styles.scss';
4
+ declare const DynamicResizer: React.FC<DynamicResizerProps>;
5
5
  export default DynamicResizer;
@@ -1,12 +1,29 @@
1
- import React from 'react';
2
1
  import { DragProps } from '../types/interface';
3
- declare const useDrag: ({ containerRef, minTopHeight, minBottomHeight, defaultHeight, axis, localKey, isShortcutButton, }: DragProps) => {
4
- rendered: React.JSX.Element;
5
- topStyle: {
6
- height: string;
2
+ declare const useDrag: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, enableEdges, onResizeStart, onResize, onResizeStop, }: DragProps) => {
3
+ size: {
4
+ width: string | number;
5
+ height: string | number;
7
6
  };
8
- bottomStyle: {
9
- height: string;
7
+ onResizeStart: () => void;
8
+ onResize: () => void;
9
+ onResizeStop: (e: any, direction: any, ref: HTMLElement) => void;
10
+ enable: {
11
+ top: boolean | undefined;
12
+ bottom: boolean | undefined;
13
+ left: boolean | undefined;
14
+ right: boolean | undefined;
15
+ topLeft: boolean;
16
+ ropRight: boolean;
17
+ bottomLeft: boolean;
18
+ bottomRight: boolean;
10
19
  };
20
+ handleClasses: {
21
+ right: string;
22
+ bottom: string;
23
+ };
24
+ minWidth: string | number | undefined;
25
+ maxWidth: string | number | undefined;
26
+ minHeight: string | number | undefined;
27
+ maxHeight: string | number | undefined;
11
28
  };
12
29
  export default useDrag;
@@ -0,0 +1,12 @@
1
+ import { EdgeDirection, ResizableDirection } from '../types/interface';
2
+ declare const useDraggingAllowed: (direction?: ResizableDirection, enableEdges?: EdgeDirection[]) => {
3
+ top: boolean | undefined;
4
+ bottom: boolean | undefined;
5
+ left: boolean | undefined;
6
+ right: boolean | undefined;
7
+ topLeft: boolean;
8
+ ropRight: boolean;
9
+ bottomLeft: boolean;
10
+ bottomRight: boolean;
11
+ };
12
+ export default useDraggingAllowed;
@@ -1,23 +1,12 @@
1
- import { RefObject } from 'react';
2
- declare const useUpdateHeight: (containerRef: RefObject<HTMLDivElement>, minTopHeight: number, minBottomHeight: number, defaultHeight: number, cacheKey: string) => {
3
- topHeight: number;
4
- bottomHeight: number;
5
- position: {
6
- x: number;
7
- y: number;
8
- };
9
- bounds: {
10
- top: number;
11
- bottom: number;
12
- };
13
- topStyle: {
14
- height: string;
15
- };
16
- bottomStyle: {
17
- height: string;
18
- };
19
- updateELHeight: (newTopHeight: number) => void;
20
- setBottomHeightToZero: () => void;
21
- setTopHeightToZero: () => void;
1
+ import { DragProps } from '../types/interface';
2
+ declare const useUpdateHeight: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, }: DragProps) => {
3
+ width: string | number;
4
+ height: string | number;
5
+ minWidth: string | number | undefined;
6
+ minHeight: string | number | undefined;
7
+ maxWidth: string | number | undefined;
8
+ maxHeight: string | number | undefined;
9
+ updateWidth: (width: number) => void;
10
+ updateHeight: (height: number) => void;
22
11
  };
23
12
  export default useUpdateHeight;
@@ -1,15 +1,23 @@
1
1
  import { ReactElement, RefObject } from 'react';
2
+ export type ResizableDirection = 'horizontal' | 'vertical';
3
+ export type EdgeDirection = 'top' | 'bottom' | 'left' | 'right';
2
4
  interface Common {
5
+ direction?: ResizableDirection;
6
+ defaultWidth?: number;
3
7
  defaultHeight?: number;
4
- minTopHeight?: number;
5
- minBottomHeight?: number;
6
- axis?: 'x' | 'y';
8
+ minTopHeight?: number | string;
9
+ minBottomHeight?: number | string;
10
+ minLeftWidth?: number | string;
11
+ minRightWidth?: number | string;
7
12
  localKey?: string;
8
- customDivider?: ReactElement;
9
- isShortcutButton?: boolean;
13
+ enableEdges?: EdgeDirection[];
14
+ disabled?: boolean;
15
+ onResizeStart?: () => void;
16
+ onResize?: () => void;
17
+ onResizeStop?: () => void;
10
18
  }
11
19
  export interface DynamicResizerProps extends Common {
12
- children: ReactElement[] | Element[] | Boolean[];
20
+ children: ReactElement[];
13
21
  }
14
22
  export interface DragProps extends Common {
15
23
  containerRef: RefObject<HTMLDivElement>;
@@ -0,0 +1,4 @@
1
+ export declare const isValidSize: (value: any) => boolean;
2
+ export declare const calcMaxSize: (curSize: number | string, limitSize: number) => number;
3
+ export declare const calcMinSize: (curSize: number | string, totalSize: number) => number;
4
+ export declare const adjustDefaultSize: (curSize: number | string | undefined, minPrimarySize: number | string, minSecondarySize: number | string, containerSize: number | undefined, defaultSize: number) => number;
@@ -10,6 +10,8 @@ interface IDialogViewProps {
10
10
  answerIsImg: boolean;
11
11
  questionIsImg: boolean;
12
12
  LLMConfig?: ILLMMultiWheelToolConfig;
13
+ answerIsAudio?: boolean;
14
+ questionIsAudio?: boolean;
13
15
  }
14
16
  declare const DialogView: (props: IDialogViewProps) => React.JSX.Element;
15
17
  export default DialogView;
@@ -13,6 +13,8 @@ interface ILLMMultiWheelSourceViewProps {
13
13
  LLMConfig?: ILLMMultiWheelToolConfig;
14
14
  dialogList: any[];
15
15
  lang?: string;
16
+ questionIsAudio?: boolean;
17
+ answerIsAudio?: boolean;
16
18
  }
17
19
  export declare const LLMMultiWheelSourceView: React.FC<ILLMMultiWheelSourceViewProps>;
18
20
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IAnswerList } from '@/components/LLMToolView/types';
3
+ interface IProps {
4
+ hoverKey?: number;
5
+ answerList: IAnswerList[];
6
+ }
7
+ declare const AudioView: (props: IProps) => React.JSX.Element;
8
+ export default AudioView;
@@ -11,8 +11,9 @@ interface IProps {
11
11
  dataFormatType: EDataFormatType;
12
12
  setDataFormatType: (v: EDataFormatType) => void;
13
13
  isImg?: boolean;
14
+ isAudio?: boolean;
14
15
  }
15
- export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
16
+ export declare const RenderQuestion: ({ question, dataFormatType, isImg, isAudio, }: {
16
17
  question: string | {
17
18
  id: number;
18
19
  path: string;
@@ -22,6 +23,7 @@ export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
22
23
  };
23
24
  dataFormatType: EDataFormatType;
24
25
  isImg?: boolean | undefined;
26
+ isAudio?: boolean | undefined;
25
27
  }) => React.JSX.Element;
26
28
  declare const Header: (props: IProps) => React.JSX.Element;
27
29
  export declare const ToggleDataFormatType: (props: {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface IAttributeInputEditorProps {
4
+ selectedAttribute?: string;
5
+ attributeChanged: (v: string) => void;
6
+ }
7
+ declare const AttributeInputEditor: React.FC<IAttributeInputEditorProps>;
8
+ export default AttributeInputEditor;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { ILimit, IDefaultSize } from '@labelbee/lb-utils';
2
+ import { IDefaultSize, IPointCloudLimit } from '@labelbee/lb-utils';
3
3
  declare const LimitPopover: ({ limit, updateSize, }: {
4
- limit: ILimit;
4
+ limit: IPointCloudLimit;
5
5
  updateSize?: ((size: IDefaultSize) => void) | undefined;
6
6
  }) => React.JSX.Element;
7
7
  export default LimitPopover;
@@ -12,7 +12,7 @@ interface IProps {
12
12
  openByText?: boolean;
13
13
  style?: CSSProperties;
14
14
  isToolTips?: boolean;
15
- wordCount?: number;
15
+ maxWordCount?: number;
16
16
  overflowMaxLines?: number;
17
17
  }
18
18
  declare const LongText: (props: IProps) => React.JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="lodash" />
2
1
  export declare const useUpdateRectList: (fn: () => void) => import("lodash").DebouncedFunc<() => void>;
@@ -40,10 +40,12 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
40
40
  selectedIDs: string[];
41
41
  setSelectedIDs: (ids?: string[] | string) => void;
42
42
  valid: boolean;
43
+ visibleBatchSetValid: boolean;
43
44
  setPointCloudResult: (resultList: IPointCloudBoxList) => void;
44
45
  setPointCloudSphereList: (sphereList: IPointCloudSphereList) => void;
45
46
  selectedPointCloudBox?: IPointCloudBox;
46
47
  setPointCloudValid: (valid?: boolean) => void;
48
+ setBatchSetValidModal: (visible: boolean) => void;
47
49
  addSelectedID: (selectedID: string) => void;
48
50
  addHighlightID: (highlightID: number) => void;
49
51
  selectedAllBoxes: () => void;
@@ -102,6 +104,8 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
102
104
  linkageImageNameRectMap: MapIndirectWeakSet<IPointCloudBoxRect>;
103
105
  updateRectListByReducer: UpdateRectListByReducer;
104
106
  windowKeydownListenerHook: WindowKeydownListenerHooker;
107
+ isLargeStatus: boolean;
108
+ setIsLargeStatus: (isLargeStatus: boolean) => void;
105
109
  }
106
110
  export declare const PointCloudContext: React.Context<IPointCloudContext>;
107
111
  export declare const PointCloudProvider: React.FC<PropsWithChildren<{}>>;
@@ -5,6 +5,7 @@ interface IProps extends IA2MapStateProps {
5
5
  checkMode?: boolean;
6
6
  toolInstanceRef: React.MutableRefObject<ICustomToolInstance>;
7
7
  setResourceLoading?: (loading: boolean) => void;
8
+ isBatchSetValid?: boolean;
8
9
  }
9
10
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
10
11
  children?: React.ReactNode;
@@ -1,5 +1,6 @@
1
- import { IPointCloudConfig } from '@labelbee/lb-utils';
1
+ import { IPointCloudConfig, ITipScopeParams } from '@labelbee/lb-utils';
2
2
  export declare const useConfig: () => {
3
3
  syncAllViewsConfig: (config: IPointCloudConfig) => void;
4
4
  reRenderTopViewRange: (radius: number) => void;
5
+ reRenderTopViewTipScopeList: (tipScopeList?: ITipScopeParams[]) => void;
5
6
  };
@@ -0,0 +1,3 @@
1
+ export declare const usePointCloudAttribute: (setResourceLoading: any, config: any) => {
2
+ updatePointCloudAttribute: (newAttribute: string) => void;
3
+ };
@@ -1,9 +1,8 @@
1
- /// <reference types="lodash" />
2
1
  import { IAnnotationStateProps } from '@/store/annotation/map';
3
2
  /**
4
3
  * PointCloud Rotate Hook
5
4
  * @returns
6
5
  */
7
6
  export declare const useRotate: ({ currentData }: IAnnotationStateProps) => {
8
- updateRotate: import("lodash").DebouncedFunc<(angle: number) => void>;
7
+ updateRotate: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
9
8
  };
@@ -1,9 +1,8 @@
1
- /// <reference types="lodash" />
2
1
  import { IAnnotationStateProps } from '@/store/annotation/map';
3
2
  /**
4
3
  * PointCloud Rotate Hook
5
4
  * @returns
6
5
  */
7
6
  export declare const useRotateEdge: ({ currentData }: IAnnotationStateProps) => {
8
- updateRotateEdge: import("lodash").DebouncedFunc<(angle: number) => void>;
7
+ updateRotateEdge: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
9
8
  };
@@ -7,12 +7,14 @@
7
7
  import React from 'react';
8
8
  import { DrawLayerSlot } from '@/types/main';
9
9
  import { IA2MapStateProps } from '@/store/annotation/map';
10
+ import { IBatchSetValid } from '@/views/MainView/sidebar/GeneralOperation';
10
11
  interface IProps extends IA2MapStateProps {
11
12
  drawLayerSlot?: DrawLayerSlot;
12
13
  checkMode?: boolean;
13
14
  intelligentFit?: boolean;
14
15
  measureVisible?: boolean;
15
16
  setResourceLoading?: (loading: boolean) => void;
17
+ setBatchSetValid?: (values: IBatchSetValid) => void;
16
18
  }
17
19
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
18
20
  children?: React.ReactNode;
@@ -14,6 +14,7 @@ interface IVideoClipToolContext {
14
14
  clipStatus: EClipStatus;
15
15
  selectedAttribute?: string;
16
16
  contextToCancel?: (e: any) => void;
17
+ selectTimeSliceByTime?: (time: number) => void;
17
18
  }
18
19
  export declare const VideoClipToolContext: React.Context<IVideoClipToolContext>;
19
20
  export declare const VideoClipToolContextProvider: React.Provider<IVideoClipToolContext>;
@@ -9,7 +9,10 @@ interface IVideoClipProps extends IVideoAnnotateProps {
9
9
  pageBackward: () => void;
10
10
  onMounted: (instance: any) => void;
11
11
  onUnmounted: () => void;
12
- onVideoLoaded: () => void;
12
+ onVideoLoaded: (isError?: boolean) => void;
13
+ }
14
+ interface IExtraResult {
15
+ globalTag?: Record<string, string>;
13
16
  }
14
17
  interface IState {
15
18
  result: IVideoTimeSlice[];
@@ -23,6 +26,7 @@ interface IState {
23
26
  currentTime: number;
24
27
  configLoading: boolean;
25
28
  valid: boolean;
29
+ extraResult: IExtraResult;
26
30
  }
27
31
  declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
28
32
  get videoUrl(): string;
@@ -44,6 +48,7 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
44
48
  onSelectedTimeSlice: (i: IVideoTimeSlice) => void;
45
49
  removeTimeSlice: (item: IVideoTimeSlice) => void;
46
50
  updateSelectedSliceTimeProperty: (val: number, key: "end" | "start") => void;
51
+ extraResult: IExtraResult;
47
52
  };
48
53
  fns: Map<string, any[]>;
49
54
  videoPlayer?: any;
@@ -69,6 +74,9 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
69
74
  valid: boolean;
70
75
  duration: number;
71
76
  })[];
77
+ exportCustomData: () => {
78
+ extraResult: IExtraResult;
79
+ };
72
80
  /**
73
81
  * 微调选中截取片段的开始时间(start)
74
82
  * @param changeTime
@@ -96,6 +104,10 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
96
104
  addTime: () => void;
97
105
  /** 更新当前时间 */
98
106
  updateCurrentTime: (time: number) => void;
107
+ /** 根据时间查找片段 */
108
+ findTimeSliceByTime: (time: number) => IVideoTimeSlice | undefined;
109
+ /** 根据时间选中片段(不 seek、不 pause) */
110
+ selectTimeSliceByTime: (time: number) => void;
99
111
  /**
100
112
  * 视频右键操作
101
113
  * @param e
@@ -127,11 +139,30 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
127
139
  * @param attribute
128
140
  */
129
141
  setDefaultAttribute: (attribute: string) => void;
142
+ /**
143
+ * Set the sub attributes of the currently selected segment
144
+ * @param key subAttribute key
145
+ * @param value subAttribute value
146
+ */
147
+ setSubAttribute: (key: string, value: string) => void;
130
148
  /**
131
149
  * 设置当前选中片段的文本
132
150
  * @param textValue
133
151
  */
134
152
  textChange: (textValue: string) => void;
153
+ /**
154
+ * Set global tags
155
+ * @param key tag key
156
+ * @param value tag value
157
+ */
158
+ setGlobalTag: (key: string, value: string) => void;
159
+ /**
160
+ * Splicing sub attributes into the format required for display
161
+ * @param subAttribute Sub attribute object
162
+ * @param subAttributeList Secondary attribute configuration list
163
+ * @returns The formatted text string
164
+ */
165
+ getSubAttributeShowText: (subAttribute: Record<string, string> | undefined, subAttributeList: any[]) => string;
135
166
  render(): React.JSX.Element;
136
167
  }
137
168
  export default VideoClipTool;
@@ -14,7 +14,7 @@ export interface IVideoTagInstanceAdaptorProps extends IVideoAnnotateProps {
14
14
  pageBackward: () => void;
15
15
  onMounted: (instance: any) => void;
16
16
  onUnmounted: () => void;
17
- onVideoLoaded: () => void;
17
+ onVideoLoaded: (isError?: boolean) => void;
18
18
  }
19
19
  interface IVideoTagInstanceAdaptorState {
20
20
  tagResult: any[];
@@ -6,7 +6,7 @@ export interface IVideoTextInstanceAdaptorProps extends IVideoAnnotateProps {
6
6
  pageBackward: () => void;
7
7
  onMounted: (instance: any) => void;
8
8
  onUnmounted: () => void;
9
- onVideoLoaded: () => void;
9
+ onVideoLoaded: (isError?: boolean) => void;
10
10
  }
11
11
  interface IVideoTextInstanceAdaptorState {
12
12
  result: any;
@@ -35,7 +35,7 @@ interface IVideoPlayerProps {
35
35
  showVideoTrack?: boolean;
36
36
  onTrackResize?: any;
37
37
  footer?: any;
38
- dataLoaded?: () => void;
38
+ dataLoaded?: (isError?: boolean) => void;
39
39
  addTime?: () => void;
40
40
  toggleClipStatus?: () => void;
41
41
  drawLayerSlot?: any;
@@ -22,10 +22,12 @@ export declare const prefix = "bee";
22
22
  export declare const componentCls: string;
23
23
  export declare enum EDataFormatType {
24
24
  Default = "default",
25
- Markdown = "markdown"
25
+ Markdown = "markdown",
26
+ Latex = "latex"
26
27
  }
27
28
  export declare enum ELLMDataType {
28
29
  Picture = "picture",
29
30
  Text = "text",
30
- None = "none"
31
+ None = "none",
32
+ Audio = "audio"
31
33
  }
@@ -41,6 +41,7 @@ export declare const ANNOTATION_ACTIONS: {
41
41
  SET_HIGHLIGHT_ATTRIBUTE: string;
42
42
  UPDATE_PRE_DATA_PROCESS: string;
43
43
  UPDATE_IMG_INDEX_BY_EXTERNAL: string;
44
+ CHANGE_PAGE_CHECK: string;
44
45
  };
45
46
  export declare const IMAGE_ATTRIBUTE_ACTIONS: {
46
47
  UPDATE_IMG_ATTRIBUTE: string;