funda-ui 4.7.620 → 4.7.624

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 (562) hide show
  1. package/.gitattributes +2 -0
  2. package/README.md +116 -2
  3. package/README_PUBLISH.md +328 -0
  4. package/lib/cjs/DynamicFields/index.js +11 -3
  5. package/lib/esm/DynamicFields/index.tsx +9 -4
  6. package/logo.png +0 -0
  7. package/package.json +591 -1
  8. package/preview.png +0 -0
  9. package/{DynamicFields → publish/DynamicFields}/index.js +11 -3
  10. package/publish/LICENSE +21 -0
  11. package/publish/README.md +328 -0
  12. package/publish/lib/cjs/Accordion/index.d.ts +2 -0
  13. package/publish/lib/cjs/Accordion/index.js +667 -0
  14. package/publish/lib/cjs/BackToTop/index.d.ts +17 -0
  15. package/publish/lib/cjs/BackToTop/index.js +904 -0
  16. package/publish/lib/cjs/CascadingSelect/index.d.ts +80 -0
  17. package/publish/lib/cjs/CascadingSelect/index.js +3383 -0
  18. package/publish/lib/cjs/CascadingSelectE2E/index.d.ts +91 -0
  19. package/publish/lib/cjs/CascadingSelectE2E/index.js +3988 -0
  20. package/publish/lib/cjs/Chatbox/index.d.ts +101 -0
  21. package/publish/lib/cjs/Chatbox/index.js +7037 -0
  22. package/publish/lib/cjs/Checkbox/index.d.ts +28 -0
  23. package/publish/lib/cjs/Checkbox/index.js +673 -0
  24. package/publish/lib/cjs/ColorPicker/index.d.ts +27 -0
  25. package/publish/lib/cjs/ColorPicker/index.js +662 -0
  26. package/publish/lib/cjs/Date/index.d.ts +70 -0
  27. package/publish/lib/cjs/Date/index.js +6368 -0
  28. package/publish/lib/cjs/DigitalClock/index.d.ts +7 -0
  29. package/publish/lib/cjs/DigitalClock/index.js +402 -0
  30. package/publish/lib/cjs/DragDropList/index.d.ts +45 -0
  31. package/publish/lib/cjs/DragDropList/index.js +1586 -0
  32. package/publish/lib/cjs/DropdownMenu/index.d.ts +38 -0
  33. package/publish/lib/cjs/DropdownMenu/index.js +1507 -0
  34. package/publish/lib/cjs/DynamicFields/index.d.ts +40 -0
  35. package/publish/lib/cjs/DynamicFields/index.js +818 -0
  36. package/publish/lib/cjs/EventCalendar/index.d.ts +61 -0
  37. package/publish/lib/cjs/EventCalendar/index.js +3789 -0
  38. package/publish/lib/cjs/EventCalendarTimeline/index.d.ts +100 -0
  39. package/publish/lib/cjs/EventCalendarTimeline/index.js +6141 -0
  40. package/publish/lib/cjs/File/index.d.ts +40 -0
  41. package/publish/lib/cjs/File/index.js +1751 -0
  42. package/publish/lib/cjs/HorizontalScrollContent/index.d.ts +14 -0
  43. package/publish/lib/cjs/HorizontalScrollContent/index.js +426 -0
  44. package/publish/lib/cjs/Input/index.d.ts +59 -0
  45. package/publish/lib/cjs/Input/index.js +1486 -0
  46. package/publish/lib/cjs/LiveSearch/index.d.ts +70 -0
  47. package/publish/lib/cjs/LiveSearch/index.js +4180 -0
  48. package/publish/lib/cjs/MasonryLayout/index.d.ts +14 -0
  49. package/publish/lib/cjs/MasonryLayout/index.js +689 -0
  50. package/publish/lib/cjs/ModalDialog/index.d.ts +83 -0
  51. package/publish/lib/cjs/ModalDialog/index.js +1719 -0
  52. package/publish/lib/cjs/ModeSwitch/index.d.ts +17 -0
  53. package/publish/lib/cjs/ModeSwitch/index.js +202 -0
  54. package/publish/lib/cjs/MultilevelDropdownMenu/index.d.ts +20 -0
  55. package/publish/lib/cjs/MultilevelDropdownMenu/index.js +930 -0
  56. package/publish/lib/cjs/MultipleCheckboxes/index.d.ts +66 -0
  57. package/publish/lib/cjs/MultipleCheckboxes/index.js +2337 -0
  58. package/publish/lib/cjs/MultipleSelect/index.d.ts +65 -0
  59. package/publish/lib/cjs/MultipleSelect/index.js +4197 -0
  60. package/publish/lib/cjs/NativeSelect/index.d.ts +37 -0
  61. package/publish/lib/cjs/NativeSelect/index.js +2052 -0
  62. package/publish/lib/cjs/NumberInput/index.d.ts +40 -0
  63. package/publish/lib/cjs/NumberInput/index.js +1191 -0
  64. package/publish/lib/cjs/Pagination/index.d.ts +51 -0
  65. package/publish/lib/cjs/Pagination/index.js +612 -0
  66. package/publish/lib/cjs/Radio/index.d.ts +45 -0
  67. package/publish/lib/cjs/Radio/index.js +1838 -0
  68. package/publish/lib/cjs/RangeSlider/index.d.ts +22 -0
  69. package/publish/lib/cjs/RangeSlider/index.js +2696 -0
  70. package/publish/lib/cjs/Refresher/index.d.ts +22 -0
  71. package/publish/lib/cjs/Refresher/index.js +564 -0
  72. package/publish/lib/cjs/RootPortal/index.d.ts +9 -0
  73. package/publish/lib/cjs/RootPortal/index.js +148 -0
  74. package/publish/lib/cjs/ScrollReveal/index.d.ts +21 -0
  75. package/publish/lib/cjs/ScrollReveal/index.js +401 -0
  76. package/publish/lib/cjs/Scrollbar/index.d.ts +17 -0
  77. package/publish/lib/cjs/Scrollbar/index.js +1107 -0
  78. package/publish/lib/cjs/SearchBar/index.d.ts +41 -0
  79. package/publish/lib/cjs/SearchBar/index.js +701 -0
  80. package/publish/lib/cjs/Select/index.d.ts +107 -0
  81. package/publish/lib/cjs/Select/index.js +6540 -0
  82. package/publish/lib/cjs/ShowMoreLess/index.d.ts +36 -0
  83. package/publish/lib/cjs/ShowMoreLess/index.js +387 -0
  84. package/publish/lib/cjs/SplitterPanel/index.d.ts +20 -0
  85. package/publish/lib/cjs/SplitterPanel/index.js +800 -0
  86. package/publish/lib/cjs/Stepper/index.d.ts +26 -0
  87. package/publish/lib/cjs/Stepper/index.js +568 -0
  88. package/publish/lib/cjs/Switch/index.d.ts +25 -0
  89. package/publish/lib/cjs/Switch/index.js +630 -0
  90. package/publish/lib/cjs/Table/index.d.ts +12 -0
  91. package/publish/lib/cjs/Table/index.js +2311 -0
  92. package/publish/lib/cjs/Tabs/index.d.ts +3 -0
  93. package/publish/lib/cjs/Tabs/index.js +771 -0
  94. package/publish/lib/cjs/TagInput/index.d.ts +37 -0
  95. package/publish/lib/cjs/TagInput/index.js +1227 -0
  96. package/publish/lib/cjs/Textarea/index.d.ts +50 -0
  97. package/publish/lib/cjs/Textarea/index.js +1795 -0
  98. package/publish/lib/cjs/Toast/index.d.ts +3 -0
  99. package/publish/lib/cjs/Toast/index.js +1345 -0
  100. package/publish/lib/cjs/Tooltip/index.d.ts +38 -0
  101. package/publish/lib/cjs/Tooltip/index.js +1778 -0
  102. package/publish/lib/cjs/Tree/index.d.ts +78 -0
  103. package/publish/lib/cjs/Tree/index.js +2330 -0
  104. package/publish/lib/cjs/Utils/anim.d.ts +11 -0
  105. package/publish/lib/cjs/Utils/anim.js +846 -0
  106. package/publish/lib/cjs/Utils/bodyScrollLock.d.ts +8 -0
  107. package/publish/lib/cjs/Utils/bodyScrollLock.js +311 -0
  108. package/publish/lib/cjs/Utils/buffer.d.ts +67 -0
  109. package/publish/lib/cjs/Utils/buffer.js +343 -0
  110. package/publish/lib/cjs/Utils/cls.d.ts +15 -0
  111. package/publish/lib/cjs/Utils/cls.js +124 -0
  112. package/publish/lib/cjs/Utils/convert.d.ts +25 -0
  113. package/publish/lib/cjs/Utils/convert.js +109 -0
  114. package/publish/lib/cjs/Utils/date.d.ts +227 -0
  115. package/publish/lib/cjs/Utils/date.js +587 -0
  116. package/publish/lib/cjs/Utils/dom.d.ts +13 -0
  117. package/publish/lib/cjs/Utils/dom.js +215 -0
  118. package/publish/lib/cjs/Utils/easing.d.ts +29 -0
  119. package/publish/lib/cjs/Utils/easing.js +221 -0
  120. package/publish/lib/cjs/Utils/extract.d.ts +66 -0
  121. package/publish/lib/cjs/Utils/extract.js +195 -0
  122. package/publish/lib/cjs/Utils/format-string.d.ts +65 -0
  123. package/publish/lib/cjs/Utils/format-string.js +167 -0
  124. package/publish/lib/cjs/Utils/formdata.d.ts +13 -0
  125. package/publish/lib/cjs/Utils/formdata.js +131 -0
  126. package/publish/lib/cjs/Utils/getElementProperty.d.ts +52 -0
  127. package/publish/lib/cjs/Utils/getElementProperty.js +189 -0
  128. package/publish/lib/cjs/Utils/guid.d.ts +7 -0
  129. package/publish/lib/cjs/Utils/guid.js +67 -0
  130. package/publish/lib/cjs/Utils/initDefaultOptions.d.ts +10 -0
  131. package/publish/lib/cjs/Utils/initDefaultOptions.js +607 -0
  132. package/publish/lib/cjs/Utils/inputsCalculation.d.ts +28 -0
  133. package/publish/lib/cjs/Utils/inputsCalculation.js +188 -0
  134. package/publish/lib/cjs/Utils/math.d.ts +77 -0
  135. package/publish/lib/cjs/Utils/math.js +305 -0
  136. package/publish/lib/cjs/Utils/object.d.ts +18 -0
  137. package/publish/lib/cjs/Utils/object.js +120 -0
  138. package/publish/lib/cjs/Utils/os.d.ts +2 -0
  139. package/publish/lib/cjs/Utils/os.js +104 -0
  140. package/publish/lib/cjs/Utils/performance.d.ts +3 -0
  141. package/publish/lib/cjs/Utils/performance.js +94 -0
  142. package/publish/lib/cjs/Utils/sanitize.d.ts +14 -0
  143. package/publish/lib/cjs/Utils/sanitize.js +87 -0
  144. package/publish/lib/cjs/Utils/time.d.ts +40 -0
  145. package/publish/lib/cjs/Utils/time.js +177 -0
  146. package/publish/lib/cjs/Utils/tree.d.ts +40 -0
  147. package/publish/lib/cjs/Utils/tree.js +195 -0
  148. package/publish/lib/cjs/Utils/useAutosizeTextArea.d.ts +10 -0
  149. package/publish/lib/cjs/Utils/useAutosizeTextArea.js +231 -0
  150. package/publish/lib/cjs/Utils/useBoundedDrag.d.ts +125 -0
  151. package/publish/lib/cjs/Utils/useBoundedDrag.js +380 -0
  152. package/publish/lib/cjs/Utils/useClickOutside.d.ts +33 -0
  153. package/publish/lib/cjs/Utils/useClickOutside.js +166 -0
  154. package/publish/lib/cjs/Utils/useComId.d.ts +6 -0
  155. package/publish/lib/cjs/Utils/useComId.js +114 -0
  156. package/publish/lib/cjs/Utils/useDebounce.d.ts +20 -0
  157. package/publish/lib/cjs/Utils/useDebounce.js +138 -0
  158. package/publish/lib/cjs/Utils/useDragDropPosition.d.ts +166 -0
  159. package/publish/lib/cjs/Utils/useDragDropPosition.js +453 -0
  160. package/publish/lib/cjs/Utils/useDraggable.d.ts +62 -0
  161. package/publish/lib/cjs/Utils/useDraggable.js +348 -0
  162. package/publish/lib/cjs/Utils/useHistoryTracker.d.ts +166 -0
  163. package/publish/lib/cjs/Utils/useHistoryTracker.js +649 -0
  164. package/publish/lib/cjs/Utils/useInterval.d.ts +5 -0
  165. package/publish/lib/cjs/Utils/useInterval.js +168 -0
  166. package/publish/lib/cjs/Utils/useIsMobile.d.ts +2 -0
  167. package/publish/lib/cjs/Utils/useIsMobile.js +232 -0
  168. package/publish/lib/cjs/Utils/useKeyPress.d.ts +44 -0
  169. package/publish/lib/cjs/Utils/useKeyPress.js +200 -0
  170. package/publish/lib/cjs/Utils/useSessionStorageListener.d.ts +2 -0
  171. package/publish/lib/cjs/Utils/useSessionStorageListener.js +157 -0
  172. package/publish/lib/cjs/Utils/useStreamController.d.ts +71 -0
  173. package/publish/lib/cjs/Utils/useStreamController.js +494 -0
  174. package/publish/lib/cjs/Utils/useThrottle.d.ts +2 -0
  175. package/publish/lib/cjs/Utils/useThrottle.js +136 -0
  176. package/publish/lib/cjs/Utils/useWindowScroll.d.ts +12 -0
  177. package/publish/lib/cjs/Utils/useWindowScroll.js +217 -0
  178. package/publish/lib/cjs/Utils/validate.d.ts +53 -0
  179. package/publish/lib/cjs/Utils/validate.js +536 -0
  180. package/publish/lib/cjs/Utils/viewport.d.ts +7 -0
  181. package/publish/lib/cjs/Utils/viewport.js +64 -0
  182. package/publish/lib/cjs/index.d.ts +49 -0
  183. package/publish/lib/cjs/index.js +50 -0
  184. package/publish/lib/css/BackToTop/index.css +34 -0
  185. package/publish/lib/css/CascadingSelect/index.css +245 -0
  186. package/publish/lib/css/CascadingSelectE2E/index.css +245 -0
  187. package/publish/lib/css/Chatbox/index.css +774 -0
  188. package/publish/lib/css/ColorPicker/index.css +58 -0
  189. package/publish/lib/css/Date/index.css +434 -0
  190. package/publish/lib/css/DragDropList/index.css +188 -0
  191. package/publish/lib/css/DropdownMenu/index.css +151 -0
  192. package/publish/lib/css/EventCalendar/index.css +300 -0
  193. package/publish/lib/css/EventCalendarTimeline/index.css +694 -0
  194. package/publish/lib/css/HorizontalScrollContent/index.css +70 -0
  195. package/publish/lib/css/LiveSearch/index.css +88 -0
  196. package/publish/lib/css/MultilevelDropdownMenu/index.css +38 -0
  197. package/publish/lib/css/MultipleSelect/index.css +313 -0
  198. package/publish/lib/css/RangeSlider/index.css +150 -0
  199. package/publish/lib/css/Scrollbar/index.css +176 -0
  200. package/publish/lib/css/Select/index.css +434 -0
  201. package/publish/lib/css/ShowMoreLess/index.css +23 -0
  202. package/publish/lib/css/SplitterPanel/index.css +63 -0
  203. package/publish/lib/css/Stepper/index.css +250 -0
  204. package/publish/lib/css/Table/index.css +584 -0
  205. package/publish/lib/css/TagInput/index.css +91 -0
  206. package/publish/lib/css/Toast/index.css +149 -0
  207. package/publish/lib/css/Tooltip/index.css +198 -0
  208. package/publish/lib/css/Tree/index.css +237 -0
  209. package/publish/lib/esm/Accordion/Accordion.tsx +185 -0
  210. package/publish/lib/esm/Accordion/AccordionItem.tsx +248 -0
  211. package/publish/lib/esm/Accordion/index.tsx +2 -0
  212. package/publish/lib/esm/BackToTop/index.scss +47 -0
  213. package/publish/lib/esm/BackToTop/index.tsx +177 -0
  214. package/publish/lib/esm/CascadingSelect/Group.tsx +83 -0
  215. package/publish/lib/esm/CascadingSelect/index.scss +330 -0
  216. package/publish/lib/esm/CascadingSelect/index.tsx +1397 -0
  217. package/publish/lib/esm/CascadingSelectE2E/Group.tsx +87 -0
  218. package/publish/lib/esm/CascadingSelectE2E/index.scss +333 -0
  219. package/publish/lib/esm/CascadingSelectE2E/index.tsx +1684 -0
  220. package/publish/lib/esm/Chatbox/PureLoader.tsx +47 -0
  221. package/publish/lib/esm/Chatbox/TypingEffect.tsx +56 -0
  222. package/publish/lib/esm/Chatbox/index.scss +966 -0
  223. package/publish/lib/esm/Chatbox/index.tsx +1742 -0
  224. package/publish/lib/esm/Chatbox/utils/func.ts +180 -0
  225. package/publish/lib/esm/Checkbox/index.tsx +206 -0
  226. package/publish/lib/esm/ColorPicker/index.scss +91 -0
  227. package/publish/lib/esm/ColorPicker/index.tsx +204 -0
  228. package/publish/lib/esm/Date/Calendar.tsx +723 -0
  229. package/publish/lib/esm/Date/index.scss +567 -0
  230. package/publish/lib/esm/Date/index.tsx +1797 -0
  231. package/publish/lib/esm/Date/localization/en_US.js +13 -0
  232. package/publish/lib/esm/Date/localization/zh_CN.js +12 -0
  233. package/publish/lib/esm/DigitalClock/index.tsx +74 -0
  234. package/publish/lib/esm/DragDropList/index.scss +245 -0
  235. package/publish/lib/esm/DragDropList/index.tsx +504 -0
  236. package/publish/lib/esm/DropdownMenu/Option.tsx +55 -0
  237. package/publish/lib/esm/DropdownMenu/index.scss +205 -0
  238. package/publish/lib/esm/DropdownMenu/index.tsx +378 -0
  239. package/publish/lib/esm/DynamicFields/index.tsx +409 -0
  240. package/publish/lib/esm/EventCalendar/index.scss +407 -0
  241. package/publish/lib/esm/EventCalendar/index.tsx +1005 -0
  242. package/publish/lib/esm/EventCalendarTimeline/index.scss +926 -0
  243. package/publish/lib/esm/EventCalendarTimeline/index.tsx +2686 -0
  244. package/publish/lib/esm/File/index.tsx +477 -0
  245. package/publish/lib/esm/HorizontalScrollContent/index.scss +87 -0
  246. package/publish/lib/esm/HorizontalScrollContent/index.tsx +171 -0
  247. package/publish/lib/esm/Input/index.tsx +641 -0
  248. package/publish/lib/esm/LiveSearch/index.scss +129 -0
  249. package/publish/lib/esm/LiveSearch/index.tsx +1058 -0
  250. package/publish/lib/esm/MasonryLayout/index.tsx +326 -0
  251. package/publish/lib/esm/ModalDialog/index.tsx +572 -0
  252. package/publish/lib/esm/ModeSwitch/index.tsx +82 -0
  253. package/publish/lib/esm/MultilevelDropdownMenu/ItemList.tsx +265 -0
  254. package/publish/lib/esm/MultilevelDropdownMenu/index.scss +79 -0
  255. package/publish/lib/esm/MultilevelDropdownMenu/index.tsx +77 -0
  256. package/publish/lib/esm/MultipleCheckboxes/index.tsx +849 -0
  257. package/publish/lib/esm/MultipleSelect/index.scss +398 -0
  258. package/publish/lib/esm/MultipleSelect/index.tsx +769 -0
  259. package/publish/lib/esm/MultipleSelect/utils/func.ts +63 -0
  260. package/publish/lib/esm/NativeSelect/index.tsx +396 -0
  261. package/publish/lib/esm/NativeSelect/utils/func.ts +51 -0
  262. package/publish/lib/esm/NumberInput/index.tsx +425 -0
  263. package/publish/lib/esm/Pagination/index.tsx +286 -0
  264. package/publish/lib/esm/Pagination/pagination-navigators.tsx +60 -0
  265. package/publish/lib/esm/Radio/index.tsx +694 -0
  266. package/publish/lib/esm/RangeSlider/index.scss +186 -0
  267. package/publish/lib/esm/RangeSlider/index.tsx +241 -0
  268. package/publish/lib/esm/Refresher/index.tsx +121 -0
  269. package/publish/lib/esm/RootPortal/index.tsx +59 -0
  270. package/publish/lib/esm/ScrollReveal/index.tsx +148 -0
  271. package/publish/lib/esm/Scrollbar/index.scss +221 -0
  272. package/publish/lib/esm/Scrollbar/index.tsx +561 -0
  273. package/publish/lib/esm/SearchBar/index.tsx +252 -0
  274. package/publish/lib/esm/Select/index.scss +639 -0
  275. package/publish/lib/esm/Select/index.tsx +3104 -0
  276. package/publish/lib/esm/Select/utils/func.ts +98 -0
  277. package/publish/lib/esm/ShowMoreLess/index.scss +27 -0
  278. package/publish/lib/esm/ShowMoreLess/index.tsx +145 -0
  279. package/publish/lib/esm/SplitterPanel/index.scss +82 -0
  280. package/publish/lib/esm/SplitterPanel/index.tsx +174 -0
  281. package/publish/lib/esm/Stepper/index.scss +315 -0
  282. package/publish/lib/esm/Stepper/index.tsx +325 -0
  283. package/publish/lib/esm/Switch/index.tsx +149 -0
  284. package/publish/lib/esm/Table/Table.tsx +351 -0
  285. package/publish/lib/esm/Table/TableBody.tsx +41 -0
  286. package/publish/lib/esm/Table/TableCaption.tsx +34 -0
  287. package/publish/lib/esm/Table/TableCell.tsx +126 -0
  288. package/publish/lib/esm/Table/TableColgroup.tsx +38 -0
  289. package/publish/lib/esm/Table/TableContext.tsx +26 -0
  290. package/publish/lib/esm/Table/TableFoot.tsx +28 -0
  291. package/publish/lib/esm/Table/TableHead.tsx +28 -0
  292. package/publish/lib/esm/Table/TableRow.tsx +76 -0
  293. package/publish/lib/esm/Table/index.scss +418 -0
  294. package/publish/lib/esm/Table/index.tsx +14 -0
  295. package/publish/lib/esm/Table/utils/DragHandleSprite.tsx +46 -0
  296. package/publish/lib/esm/Table/utils/SortSprite.tsx +63 -0
  297. package/publish/lib/esm/Table/utils/TableFilter.tsx +56 -0
  298. package/publish/lib/esm/Table/utils/ToggleSelection.tsx +255 -0
  299. package/publish/lib/esm/Table/utils/func.ts +182 -0
  300. package/publish/lib/esm/Table/utils/hooks/useTableDraggable.tsx +342 -0
  301. package/publish/lib/esm/Table/utils/hooks/useTableKeyPress.tsx +255 -0
  302. package/publish/lib/esm/Table/utils/hooks/useTableResponsive.tsx +92 -0
  303. package/publish/lib/esm/Table/utils/hooks/useTableSort.tsx +187 -0
  304. package/publish/lib/esm/Tabs/TabList.tsx +50 -0
  305. package/publish/lib/esm/Tabs/TabPanel.tsx +44 -0
  306. package/publish/lib/esm/Tabs/Tabs.tsx +282 -0
  307. package/publish/lib/esm/Tabs/index.tsx +3 -0
  308. package/publish/lib/esm/TagInput/index.scss +126 -0
  309. package/publish/lib/esm/TagInput/index.tsx +379 -0
  310. package/publish/lib/esm/Textarea/index.tsx +621 -0
  311. package/publish/lib/esm/Toast/Item.tsx +165 -0
  312. package/publish/lib/esm/Toast/Toast.tsx +391 -0
  313. package/publish/lib/esm/Toast/ToastContext.tsx +104 -0
  314. package/publish/lib/esm/Toast/__toast.vanilla.js +422 -0
  315. package/publish/lib/esm/Toast/index.scss +197 -0
  316. package/publish/lib/esm/Toast/index.tsx +3 -0
  317. package/publish/lib/esm/Toast/types.ts +60 -0
  318. package/publish/lib/esm/Toast/useToast.tsx +72 -0
  319. package/publish/lib/esm/Tooltip/index.scss +272 -0
  320. package/publish/lib/esm/Tooltip/index.tsx +416 -0
  321. package/publish/lib/esm/Tree/TreeList.tsx +600 -0
  322. package/publish/lib/esm/Tree/index.scss +384 -0
  323. package/publish/lib/esm/Tree/index.tsx +661 -0
  324. package/publish/lib/esm/Tree/init-height.tsx +40 -0
  325. package/publish/lib/esm/Tree/utils/func.ts +15 -0
  326. package/publish/lib/esm/Utils/hooks/useAutosizeTextArea.tsx +131 -0
  327. package/publish/lib/esm/Utils/hooks/useBoundedDrag.tsx +301 -0
  328. package/publish/lib/esm/Utils/hooks/useClickOutside.tsx +69 -0
  329. package/publish/lib/esm/Utils/hooks/useComId.tsx +13 -0
  330. package/publish/lib/esm/Utils/hooks/useDebounce.tsx +40 -0
  331. package/publish/lib/esm/Utils/hooks/useDragDropPosition.tsx +417 -0
  332. package/publish/lib/esm/Utils/hooks/useDraggable.tsx +265 -0
  333. package/publish/lib/esm/Utils/hooks/useHistoryTracker.tsx +554 -0
  334. package/publish/lib/esm/Utils/hooks/useInterval.tsx +74 -0
  335. package/publish/lib/esm/Utils/hooks/useIsMobile.tsx +139 -0
  336. package/publish/lib/esm/Utils/hooks/useKeyPress.tsx +104 -0
  337. package/publish/lib/esm/Utils/hooks/useSessionStorageListener.tsx +45 -0
  338. package/publish/lib/esm/Utils/hooks/useStreamController.tsx +277 -0
  339. package/publish/lib/esm/Utils/hooks/useThrottle.tsx +39 -0
  340. package/publish/lib/esm/Utils/hooks/useWindowScroll.tsx +83 -0
  341. package/publish/lib/esm/Utils/libs/anim.ts +96 -0
  342. package/publish/lib/esm/Utils/libs/buffer.ts +262 -0
  343. package/publish/lib/esm/Utils/libs/cls.ts +64 -0
  344. package/publish/lib/esm/Utils/libs/convert.ts +59 -0
  345. package/publish/lib/esm/Utils/libs/date.ts +598 -0
  346. package/publish/lib/esm/Utils/libs/dom.ts +150 -0
  347. package/publish/lib/esm/Utils/libs/easing.ts +201 -0
  348. package/publish/lib/esm/Utils/libs/extract.ts +160 -0
  349. package/publish/lib/esm/Utils/libs/format-string.ts +116 -0
  350. package/publish/lib/esm/Utils/libs/formdata.ts +93 -0
  351. package/publish/lib/esm/Utils/libs/getElementProperty.ts +150 -0
  352. package/publish/lib/esm/Utils/libs/guid.ts +16 -0
  353. package/publish/lib/esm/Utils/libs/initDefaultOptions.ts +43 -0
  354. package/publish/lib/esm/Utils/libs/inputsCalculation.ts +160 -0
  355. package/publish/lib/esm/Utils/libs/math.ts +276 -0
  356. package/publish/lib/esm/Utils/libs/object.ts +68 -0
  357. package/publish/lib/esm/Utils/libs/os.ts +63 -0
  358. package/publish/lib/esm/Utils/libs/performance.ts +47 -0
  359. package/publish/lib/esm/Utils/libs/sanitize.ts +55 -0
  360. package/publish/lib/esm/Utils/libs/time.ts +139 -0
  361. package/publish/lib/esm/Utils/libs/tree.ts +119 -0
  362. package/publish/lib/esm/Utils/libs/validate.ts +434 -0
  363. package/publish/lib/esm/Utils/libs/viewport.ts +20 -0
  364. package/publish/lib/esm/Utils/plugins/bodyScrollLock.ts +286 -0
  365. package/publish/lib/esm/index.js +47 -0
  366. package/publish/package.json +1 -0
  367. /package/{Accordion → publish/Accordion}/index.d.ts +0 -0
  368. /package/{Accordion → publish/Accordion}/index.js +0 -0
  369. /package/{BackToTop → publish/BackToTop}/index.css +0 -0
  370. /package/{BackToTop → publish/BackToTop}/index.d.ts +0 -0
  371. /package/{BackToTop → publish/BackToTop}/index.js +0 -0
  372. /package/{CascadingSelect → publish/CascadingSelect}/index.css +0 -0
  373. /package/{CascadingSelect → publish/CascadingSelect}/index.d.ts +0 -0
  374. /package/{CascadingSelect → publish/CascadingSelect}/index.js +0 -0
  375. /package/{CascadingSelectE2E → publish/CascadingSelectE2E}/index.css +0 -0
  376. /package/{CascadingSelectE2E → publish/CascadingSelectE2E}/index.d.ts +0 -0
  377. /package/{CascadingSelectE2E → publish/CascadingSelectE2E}/index.js +0 -0
  378. /package/{Chatbox → publish/Chatbox}/index.css +0 -0
  379. /package/{Chatbox → publish/Chatbox}/index.d.ts +0 -0
  380. /package/{Chatbox → publish/Chatbox}/index.js +0 -0
  381. /package/{Checkbox → publish/Checkbox}/index.d.ts +0 -0
  382. /package/{Checkbox → publish/Checkbox}/index.js +0 -0
  383. /package/{ColorPicker → publish/ColorPicker}/index.css +0 -0
  384. /package/{ColorPicker → publish/ColorPicker}/index.d.ts +0 -0
  385. /package/{ColorPicker → publish/ColorPicker}/index.js +0 -0
  386. /package/{Date → publish/Date}/index.css +0 -0
  387. /package/{Date → publish/Date}/index.d.ts +0 -0
  388. /package/{Date → publish/Date}/index.js +0 -0
  389. /package/{DigitalClock → publish/DigitalClock}/index.d.ts +0 -0
  390. /package/{DigitalClock → publish/DigitalClock}/index.js +0 -0
  391. /package/{DragDropList → publish/DragDropList}/index.css +0 -0
  392. /package/{DragDropList → publish/DragDropList}/index.d.ts +0 -0
  393. /package/{DragDropList → publish/DragDropList}/index.js +0 -0
  394. /package/{DropdownMenu → publish/DropdownMenu}/index.css +0 -0
  395. /package/{DropdownMenu → publish/DropdownMenu}/index.d.ts +0 -0
  396. /package/{DropdownMenu → publish/DropdownMenu}/index.js +0 -0
  397. /package/{DynamicFields → publish/DynamicFields}/index.d.ts +0 -0
  398. /package/{EventCalendar → publish/EventCalendar}/index.css +0 -0
  399. /package/{EventCalendar → publish/EventCalendar}/index.d.ts +0 -0
  400. /package/{EventCalendar → publish/EventCalendar}/index.js +0 -0
  401. /package/{EventCalendarTimeline → publish/EventCalendarTimeline}/index.css +0 -0
  402. /package/{EventCalendarTimeline → publish/EventCalendarTimeline}/index.d.ts +0 -0
  403. /package/{EventCalendarTimeline → publish/EventCalendarTimeline}/index.js +0 -0
  404. /package/{File → publish/File}/index.d.ts +0 -0
  405. /package/{File → publish/File}/index.js +0 -0
  406. /package/{HorizontalScrollContent → publish/HorizontalScrollContent}/index.css +0 -0
  407. /package/{HorizontalScrollContent → publish/HorizontalScrollContent}/index.d.ts +0 -0
  408. /package/{HorizontalScrollContent → publish/HorizontalScrollContent}/index.js +0 -0
  409. /package/{Input → publish/Input}/index.d.ts +0 -0
  410. /package/{Input → publish/Input}/index.js +0 -0
  411. /package/{LiveSearch → publish/LiveSearch}/index.css +0 -0
  412. /package/{LiveSearch → publish/LiveSearch}/index.d.ts +0 -0
  413. /package/{LiveSearch → publish/LiveSearch}/index.js +0 -0
  414. /package/{MasonryLayout → publish/MasonryLayout}/index.d.ts +0 -0
  415. /package/{MasonryLayout → publish/MasonryLayout}/index.js +0 -0
  416. /package/{ModalDialog → publish/ModalDialog}/index.d.ts +0 -0
  417. /package/{ModalDialog → publish/ModalDialog}/index.js +0 -0
  418. /package/{ModeSwitch → publish/ModeSwitch}/index.d.ts +0 -0
  419. /package/{ModeSwitch → publish/ModeSwitch}/index.js +0 -0
  420. /package/{MultilevelDropdownMenu → publish/MultilevelDropdownMenu}/index.css +0 -0
  421. /package/{MultilevelDropdownMenu → publish/MultilevelDropdownMenu}/index.d.ts +0 -0
  422. /package/{MultilevelDropdownMenu → publish/MultilevelDropdownMenu}/index.js +0 -0
  423. /package/{MultipleCheckboxes → publish/MultipleCheckboxes}/index.d.ts +0 -0
  424. /package/{MultipleCheckboxes → publish/MultipleCheckboxes}/index.js +0 -0
  425. /package/{MultipleSelect → publish/MultipleSelect}/index.css +0 -0
  426. /package/{MultipleSelect → publish/MultipleSelect}/index.d.ts +0 -0
  427. /package/{MultipleSelect → publish/MultipleSelect}/index.js +0 -0
  428. /package/{NativeSelect → publish/NativeSelect}/index.d.ts +0 -0
  429. /package/{NativeSelect → publish/NativeSelect}/index.js +0 -0
  430. /package/{NumberInput → publish/NumberInput}/index.d.ts +0 -0
  431. /package/{NumberInput → publish/NumberInput}/index.js +0 -0
  432. /package/{Pagination → publish/Pagination}/index.d.ts +0 -0
  433. /package/{Pagination → publish/Pagination}/index.js +0 -0
  434. /package/{Radio → publish/Radio}/index.d.ts +0 -0
  435. /package/{Radio → publish/Radio}/index.js +0 -0
  436. /package/{RangeSlider → publish/RangeSlider}/index.css +0 -0
  437. /package/{RangeSlider → publish/RangeSlider}/index.d.ts +0 -0
  438. /package/{RangeSlider → publish/RangeSlider}/index.js +0 -0
  439. /package/{Refresher → publish/Refresher}/index.d.ts +0 -0
  440. /package/{Refresher → publish/Refresher}/index.js +0 -0
  441. /package/{RootPortal → publish/RootPortal}/index.d.ts +0 -0
  442. /package/{RootPortal → publish/RootPortal}/index.js +0 -0
  443. /package/{ScrollReveal → publish/ScrollReveal}/index.d.ts +0 -0
  444. /package/{ScrollReveal → publish/ScrollReveal}/index.js +0 -0
  445. /package/{Scrollbar → publish/Scrollbar}/index.css +0 -0
  446. /package/{Scrollbar → publish/Scrollbar}/index.d.ts +0 -0
  447. /package/{Scrollbar → publish/Scrollbar}/index.js +0 -0
  448. /package/{SearchBar → publish/SearchBar}/index.d.ts +0 -0
  449. /package/{SearchBar → publish/SearchBar}/index.js +0 -0
  450. /package/{Select → publish/Select}/index.css +0 -0
  451. /package/{Select → publish/Select}/index.d.ts +0 -0
  452. /package/{Select → publish/Select}/index.js +0 -0
  453. /package/{ShowMoreLess → publish/ShowMoreLess}/index.css +0 -0
  454. /package/{ShowMoreLess → publish/ShowMoreLess}/index.d.ts +0 -0
  455. /package/{ShowMoreLess → publish/ShowMoreLess}/index.js +0 -0
  456. /package/{SplitterPanel → publish/SplitterPanel}/index.css +0 -0
  457. /package/{SplitterPanel → publish/SplitterPanel}/index.d.ts +0 -0
  458. /package/{SplitterPanel → publish/SplitterPanel}/index.js +0 -0
  459. /package/{Stepper → publish/Stepper}/index.css +0 -0
  460. /package/{Stepper → publish/Stepper}/index.d.ts +0 -0
  461. /package/{Stepper → publish/Stepper}/index.js +0 -0
  462. /package/{Switch → publish/Switch}/index.d.ts +0 -0
  463. /package/{Switch → publish/Switch}/index.js +0 -0
  464. /package/{Table → publish/Table}/index.css +0 -0
  465. /package/{Table → publish/Table}/index.d.ts +0 -0
  466. /package/{Table → publish/Table}/index.js +0 -0
  467. /package/{Tabs → publish/Tabs}/index.d.ts +0 -0
  468. /package/{Tabs → publish/Tabs}/index.js +0 -0
  469. /package/{TagInput → publish/TagInput}/index.css +0 -0
  470. /package/{TagInput → publish/TagInput}/index.d.ts +0 -0
  471. /package/{TagInput → publish/TagInput}/index.js +0 -0
  472. /package/{Textarea → publish/Textarea}/index.d.ts +0 -0
  473. /package/{Textarea → publish/Textarea}/index.js +0 -0
  474. /package/{Toast → publish/Toast}/index.css +0 -0
  475. /package/{Toast → publish/Toast}/index.d.ts +0 -0
  476. /package/{Toast → publish/Toast}/index.js +0 -0
  477. /package/{Tooltip → publish/Tooltip}/index.css +0 -0
  478. /package/{Tooltip → publish/Tooltip}/index.d.ts +0 -0
  479. /package/{Tooltip → publish/Tooltip}/index.js +0 -0
  480. /package/{Tree → publish/Tree}/index.css +0 -0
  481. /package/{Tree → publish/Tree}/index.d.ts +0 -0
  482. /package/{Tree → publish/Tree}/index.js +0 -0
  483. /package/{Utils → publish/Utils}/anim.d.ts +0 -0
  484. /package/{Utils → publish/Utils}/anim.js +0 -0
  485. /package/{Utils → publish/Utils}/bodyScrollLock.d.ts +0 -0
  486. /package/{Utils → publish/Utils}/bodyScrollLock.js +0 -0
  487. /package/{Utils → publish/Utils}/buffer.d.ts +0 -0
  488. /package/{Utils → publish/Utils}/buffer.js +0 -0
  489. /package/{Utils → publish/Utils}/cls.d.ts +0 -0
  490. /package/{Utils → publish/Utils}/cls.js +0 -0
  491. /package/{Utils → publish/Utils}/convert.d.ts +0 -0
  492. /package/{Utils → publish/Utils}/convert.js +0 -0
  493. /package/{Utils → publish/Utils}/date.d.ts +0 -0
  494. /package/{Utils → publish/Utils}/date.js +0 -0
  495. /package/{Utils → publish/Utils}/dom.d.ts +0 -0
  496. /package/{Utils → publish/Utils}/dom.js +0 -0
  497. /package/{Utils → publish/Utils}/easing.d.ts +0 -0
  498. /package/{Utils → publish/Utils}/easing.js +0 -0
  499. /package/{Utils → publish/Utils}/extract.d.ts +0 -0
  500. /package/{Utils → publish/Utils}/extract.js +0 -0
  501. /package/{Utils → publish/Utils}/format-string.d.ts +0 -0
  502. /package/{Utils → publish/Utils}/format-string.js +0 -0
  503. /package/{Utils → publish/Utils}/formdata.d.ts +0 -0
  504. /package/{Utils → publish/Utils}/formdata.js +0 -0
  505. /package/{Utils → publish/Utils}/getElementProperty.d.ts +0 -0
  506. /package/{Utils → publish/Utils}/getElementProperty.js +0 -0
  507. /package/{Utils → publish/Utils}/guid.d.ts +0 -0
  508. /package/{Utils → publish/Utils}/guid.js +0 -0
  509. /package/{Utils → publish/Utils}/initDefaultOptions.d.ts +0 -0
  510. /package/{Utils → publish/Utils}/initDefaultOptions.js +0 -0
  511. /package/{Utils → publish/Utils}/inputsCalculation.d.ts +0 -0
  512. /package/{Utils → publish/Utils}/inputsCalculation.js +0 -0
  513. /package/{Utils → publish/Utils}/math.d.ts +0 -0
  514. /package/{Utils → publish/Utils}/math.js +0 -0
  515. /package/{Utils → publish/Utils}/object.d.ts +0 -0
  516. /package/{Utils → publish/Utils}/object.js +0 -0
  517. /package/{Utils → publish/Utils}/os.d.ts +0 -0
  518. /package/{Utils → publish/Utils}/os.js +0 -0
  519. /package/{Utils → publish/Utils}/performance.d.ts +0 -0
  520. /package/{Utils → publish/Utils}/performance.js +0 -0
  521. /package/{Utils → publish/Utils}/sanitize.d.ts +0 -0
  522. /package/{Utils → publish/Utils}/sanitize.js +0 -0
  523. /package/{Utils → publish/Utils}/time.d.ts +0 -0
  524. /package/{Utils → publish/Utils}/time.js +0 -0
  525. /package/{Utils → publish/Utils}/tree.d.ts +0 -0
  526. /package/{Utils → publish/Utils}/tree.js +0 -0
  527. /package/{Utils → publish/Utils}/useAutosizeTextArea.d.ts +0 -0
  528. /package/{Utils → publish/Utils}/useAutosizeTextArea.js +0 -0
  529. /package/{Utils → publish/Utils}/useBoundedDrag.d.ts +0 -0
  530. /package/{Utils → publish/Utils}/useBoundedDrag.js +0 -0
  531. /package/{Utils → publish/Utils}/useClickOutside.d.ts +0 -0
  532. /package/{Utils → publish/Utils}/useClickOutside.js +0 -0
  533. /package/{Utils → publish/Utils}/useComId.d.ts +0 -0
  534. /package/{Utils → publish/Utils}/useComId.js +0 -0
  535. /package/{Utils → publish/Utils}/useDebounce.d.ts +0 -0
  536. /package/{Utils → publish/Utils}/useDebounce.js +0 -0
  537. /package/{Utils → publish/Utils}/useDragDropPosition.d.ts +0 -0
  538. /package/{Utils → publish/Utils}/useDragDropPosition.js +0 -0
  539. /package/{Utils → publish/Utils}/useDraggable.d.ts +0 -0
  540. /package/{Utils → publish/Utils}/useDraggable.js +0 -0
  541. /package/{Utils → publish/Utils}/useHistoryTracker.d.ts +0 -0
  542. /package/{Utils → publish/Utils}/useHistoryTracker.js +0 -0
  543. /package/{Utils → publish/Utils}/useInterval.d.ts +0 -0
  544. /package/{Utils → publish/Utils}/useInterval.js +0 -0
  545. /package/{Utils → publish/Utils}/useIsMobile.d.ts +0 -0
  546. /package/{Utils → publish/Utils}/useIsMobile.js +0 -0
  547. /package/{Utils → publish/Utils}/useKeyPress.d.ts +0 -0
  548. /package/{Utils → publish/Utils}/useKeyPress.js +0 -0
  549. /package/{Utils → publish/Utils}/useSessionStorageListener.d.ts +0 -0
  550. /package/{Utils → publish/Utils}/useSessionStorageListener.js +0 -0
  551. /package/{Utils → publish/Utils}/useStreamController.d.ts +0 -0
  552. /package/{Utils → publish/Utils}/useStreamController.js +0 -0
  553. /package/{Utils → publish/Utils}/useThrottle.d.ts +0 -0
  554. /package/{Utils → publish/Utils}/useThrottle.js +0 -0
  555. /package/{Utils → publish/Utils}/useWindowScroll.d.ts +0 -0
  556. /package/{Utils → publish/Utils}/useWindowScroll.js +0 -0
  557. /package/{Utils → publish/Utils}/validate.d.ts +0 -0
  558. /package/{Utils → publish/Utils}/validate.js +0 -0
  559. /package/{Utils → publish/Utils}/viewport.d.ts +0 -0
  560. /package/{Utils → publish/Utils}/viewport.js +0 -0
  561. /package/{all.d.ts → publish/all.d.ts} +0 -0
  562. /package/{all.js → publish/all.js} +0 -0
@@ -0,0 +1,4197 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory(require("react"));
8
+ else
9
+ root["RPB"] = factory(root["React"]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 954:
15
+ /***/ (function(module, exports, __webpack_require__) {
16
+
17
+ /* module decorator */ module = __webpack_require__.nmd(module);
18
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof3(obj) { "@babel/helpers - typeof"; return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof3(obj); }
19
+ (function webpackUniversalModuleDefinition(root, factory) {
20
+ if (( false ? 0 : _typeof3(exports)) === 'object' && ( false ? 0 : _typeof3(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
21
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
22
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
23
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
24
+ })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
25
+ return (/******/function () {
26
+ // webpackBootstrap
27
+ /******/
28
+ var __webpack_modules__ = {
29
+ /***/188: /***/function _(module, exports, __nested_webpack_require_1080__) {
30
+ /* module decorator */module = __nested_webpack_require_1080__.nmd(module);
31
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
32
+ function _typeof2(obj) {
33
+ "@babel/helpers - typeof";
34
+
35
+ return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
36
+ return typeof obj;
37
+ } : function (obj) {
38
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
39
+ }, _typeof2(obj);
40
+ }
41
+ (function webpackUniversalModuleDefinition(root, factory) {
42
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
43
+ })(this, function () {
44
+ return (/******/function () {
45
+ // webpackBootstrap
46
+ /******/
47
+ "use strict";
48
+
49
+ /******/ // The require scope
50
+ /******/
51
+ var __nested_webpack_require_993__ = {};
52
+ /******/
53
+ /************************************************************************/
54
+ /******/ /* webpack/runtime/define property getters */
55
+ /******/
56
+ (function () {
57
+ /******/ // define getter functions for harmony exports
58
+ /******/__nested_webpack_require_993__.d = function (exports, definition) {
59
+ /******/for (var key in definition) {
60
+ /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
61
+ /******/Object.defineProperty(exports, key, {
62
+ enumerable: true,
63
+ get: definition[key]
64
+ });
65
+ /******/
66
+ }
67
+ /******/
68
+ }
69
+ /******/
70
+ };
71
+ /******/
72
+ })();
73
+ /******/
74
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
75
+ /******/
76
+ (function () {
77
+ /******/__nested_webpack_require_993__.o = function (obj, prop) {
78
+ return Object.prototype.hasOwnProperty.call(obj, prop);
79
+ };
80
+ /******/
81
+ })();
82
+ /******/
83
+ /******/ /* webpack/runtime/make namespace object */
84
+ /******/
85
+ (function () {
86
+ /******/ // define __esModule on exports
87
+ /******/__nested_webpack_require_993__.r = function (exports) {
88
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
89
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
90
+ value: 'Module'
91
+ });
92
+ /******/
93
+ }
94
+ /******/
95
+ Object.defineProperty(exports, '__esModule', {
96
+ value: true
97
+ });
98
+ /******/
99
+ };
100
+ /******/
101
+ })();
102
+ /******/
103
+ /************************************************************************/
104
+ var __webpack_exports__ = {};
105
+ __nested_webpack_require_993__.r(__webpack_exports__);
106
+ /* harmony export */
107
+ __nested_webpack_require_993__.d(__webpack_exports__, {
108
+ /* harmony export */"clsWrite": function clsWrite() {
109
+ return (/* binding */_clsWrite
110
+ );
111
+ },
112
+ /* harmony export */"combinedCls": function combinedCls() {
113
+ return (/* binding */_combinedCls
114
+ );
115
+ }
116
+ /* harmony export */
117
+ });
118
+
119
+ function _slicedToArray(arr, i) {
120
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
121
+ }
122
+ function _nonIterableRest() {
123
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
124
+ }
125
+ function _unsupportedIterableToArray(o, minLen) {
126
+ if (!o) return;
127
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
128
+ var n = Object.prototype.toString.call(o).slice(8, -1);
129
+ if (n === "Object" && o.constructor) n = o.constructor.name;
130
+ if (n === "Map" || n === "Set") return Array.from(o);
131
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
132
+ }
133
+ function _arrayLikeToArray(arr, len) {
134
+ if (len == null || len > arr.length) len = arr.length;
135
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
136
+ return arr2;
137
+ }
138
+ function _iterableToArrayLimit(arr, i) {
139
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
140
+ if (null != _i) {
141
+ var _s,
142
+ _e,
143
+ _x,
144
+ _r,
145
+ _arr = [],
146
+ _n = !0,
147
+ _d = !1;
148
+ try {
149
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
150
+ if (Object(_i) !== _i) return;
151
+ _n = !1;
152
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
153
+ } catch (err) {
154
+ _d = !0, _e = err;
155
+ } finally {
156
+ try {
157
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
158
+ } finally {
159
+ if (_d) throw _e;
160
+ }
161
+ }
162
+ return _arr;
163
+ }
164
+ }
165
+ function _arrayWithHoles(arr) {
166
+ if (Array.isArray(arr)) return arr;
167
+ }
168
+ function _typeof(obj) {
169
+ "@babel/helpers - typeof";
170
+
171
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
172
+ return typeof obj;
173
+ } : function (obj) {
174
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
175
+ }, _typeof(obj);
176
+ }
177
+ /**
178
+ * Output of class name
179
+ * @param {*} s - Any
180
+ * @param {String} defaultCls - Default string
181
+ * @param {?*} targetCls - Any
182
+ * @returns {*}
183
+ */
184
+ function _clsWrite(s, defaultCls) {
185
+ var targetCls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
186
+ return s || s === '' ? typeof targetCls === 'undefined' ? s : targetCls : defaultCls;
187
+ }
188
+
189
+ /**
190
+ * Combined classnames
191
+ * @param {*} args
192
+ * @returns {String|undefined}
193
+ */
194
+ /* Usage:
195
+
196
+ console.log(combinedCls('a-1', 'a-2', 'a-3', {
197
+ 'p-1': null,
198
+ 'p-2': undefined,
199
+ 'p-3': true,
200
+ 'p-4': false,
201
+ 'p-5': 'kkk',
202
+ 'p-6': 0,
203
+ 'p-7': 1,
204
+ 'p-8': '',
205
+ undefined
206
+ })); // a-1 a-2 a-3 p-3 p-5 p-7
207
+ */
208
+ function _combinedCls() {
209
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
210
+ args[_key] = arguments[_key];
211
+ }
212
+ if (args) {
213
+ var classes = [];
214
+ for (var i = 0; i < args.length; i++) {
215
+ var className = args[i];
216
+ if (!className) {
217
+ continue;
218
+ }
219
+ var type = _typeof(className);
220
+ if (type === 'string' || type === 'number') {
221
+ classes.push(className);
222
+ } else if (type === 'object') {
223
+ var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
224
+ var _ref2 = _slicedToArray(_ref, 2),
225
+ key = _ref2[0],
226
+ value = _ref2[1];
227
+ return value ? key : null;
228
+ });
229
+ classes = _classes.length ? classes.concat(_classes.filter(function (c) {
230
+ return !!c;
231
+ })) : classes;
232
+ }
233
+ }
234
+ return classes.join(' ').trim();
235
+ }
236
+ return undefined;
237
+ }
238
+
239
+ /******/
240
+ return __webpack_exports__;
241
+ /******/
242
+ }()
243
+ );
244
+ });
245
+
246
+ /***/
247
+ },
248
+
249
+ /***/438: /***/function _(module, exports, __nested_webpack_require_11464__) {
250
+ /* module decorator */module = __nested_webpack_require_11464__.nmd(module);
251
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
252
+ function _typeof2(obj) {
253
+ "@babel/helpers - typeof";
254
+
255
+ return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
256
+ return typeof obj;
257
+ } : function (obj) {
258
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
259
+ }, _typeof2(obj);
260
+ }
261
+ (function webpackUniversalModuleDefinition(root, factory) {
262
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
263
+ })(this, function () {
264
+ return (/******/function () {
265
+ // webpackBootstrap
266
+ /******/
267
+ "use strict";
268
+
269
+ /******/ // The require scope
270
+ /******/
271
+ var __nested_webpack_require_993__ = {};
272
+ /******/
273
+ /************************************************************************/
274
+ /******/ /* webpack/runtime/define property getters */
275
+ /******/
276
+ (function () {
277
+ /******/ // define getter functions for harmony exports
278
+ /******/__nested_webpack_require_993__.d = function (exports, definition) {
279
+ /******/for (var key in definition) {
280
+ /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
281
+ /******/Object.defineProperty(exports, key, {
282
+ enumerable: true,
283
+ get: definition[key]
284
+ });
285
+ /******/
286
+ }
287
+ /******/
288
+ }
289
+ /******/
290
+ };
291
+ /******/
292
+ })();
293
+ /******/
294
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
295
+ /******/
296
+ (function () {
297
+ /******/__nested_webpack_require_993__.o = function (obj, prop) {
298
+ return Object.prototype.hasOwnProperty.call(obj, prop);
299
+ };
300
+ /******/
301
+ })();
302
+ /******/
303
+ /******/ /* webpack/runtime/make namespace object */
304
+ /******/
305
+ (function () {
306
+ /******/ // define __esModule on exports
307
+ /******/__nested_webpack_require_993__.r = function (exports) {
308
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
309
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
310
+ value: 'Module'
311
+ });
312
+ /******/
313
+ }
314
+ /******/
315
+ Object.defineProperty(exports, '__esModule', {
316
+ value: true
317
+ });
318
+ /******/
319
+ };
320
+ /******/
321
+ })();
322
+ /******/
323
+ /************************************************************************/
324
+ var __webpack_exports__ = {};
325
+ __nested_webpack_require_993__.r(__webpack_exports__);
326
+ /* harmony export */
327
+ __nested_webpack_require_993__.d(__webpack_exports__, {
328
+ /* harmony export */"addTreeDepth": function addTreeDepth() {
329
+ return (/* binding */_addTreeDepth
330
+ );
331
+ },
332
+ /* harmony export */"addTreeIndent": function addTreeIndent() {
333
+ return (/* binding */_addTreeIndent
334
+ );
335
+ },
336
+ /* harmony export */"convertTree": function convertTree() {
337
+ return (/* binding */_convertTree
338
+ );
339
+ },
340
+ /* harmony export */"flatTree": function flatTree() {
341
+ return (/* binding */_flatTree
342
+ );
343
+ },
344
+ /* harmony export */"getAllDepth": function getAllDepth() {
345
+ return (/* binding */_getAllDepth
346
+ );
347
+ }
348
+ /* harmony export */
349
+ });
350
+
351
+ function _typeof(obj) {
352
+ "@babel/helpers - typeof";
353
+
354
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
355
+ return typeof obj;
356
+ } : function (obj) {
357
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
358
+ }, _typeof(obj);
359
+ }
360
+ var _excluded = ["children"];
361
+ function _objectWithoutProperties(source, excluded) {
362
+ if (source == null) return {};
363
+ var target = _objectWithoutPropertiesLoose(source, excluded);
364
+ var key, i;
365
+ if (Object.getOwnPropertySymbols) {
366
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
367
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
368
+ key = sourceSymbolKeys[i];
369
+ if (excluded.indexOf(key) >= 0) continue;
370
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
371
+ target[key] = source[key];
372
+ }
373
+ }
374
+ return target;
375
+ }
376
+ function _objectWithoutPropertiesLoose(source, excluded) {
377
+ if (source == null) return {};
378
+ var target = {};
379
+ var sourceKeys = Object.keys(source);
380
+ var key, i;
381
+ for (i = 0; i < sourceKeys.length; i++) {
382
+ key = sourceKeys[i];
383
+ if (excluded.indexOf(key) >= 0) continue;
384
+ target[key] = source[key];
385
+ }
386
+ return target;
387
+ }
388
+ function ownKeys(object, enumerableOnly) {
389
+ var keys = Object.keys(object);
390
+ if (Object.getOwnPropertySymbols) {
391
+ var symbols = Object.getOwnPropertySymbols(object);
392
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
393
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
394
+ })), keys.push.apply(keys, symbols);
395
+ }
396
+ return keys;
397
+ }
398
+ function _objectSpread(target) {
399
+ for (var i = 1; i < arguments.length; i++) {
400
+ var source = null != arguments[i] ? arguments[i] : {};
401
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
402
+ _defineProperty(target, key, source[key]);
403
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
404
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
405
+ });
406
+ }
407
+ return target;
408
+ }
409
+ function _defineProperty(obj, key, value) {
410
+ key = _toPropertyKey(key);
411
+ if (key in obj) {
412
+ Object.defineProperty(obj, key, {
413
+ value: value,
414
+ enumerable: true,
415
+ configurable: true,
416
+ writable: true
417
+ });
418
+ } else {
419
+ obj[key] = value;
420
+ }
421
+ return obj;
422
+ }
423
+ function _toPropertyKey(arg) {
424
+ var key = _toPrimitive(arg, "string");
425
+ return _typeof(key) === "symbol" ? key : String(key);
426
+ }
427
+ function _toPrimitive(input, hint) {
428
+ if (_typeof(input) !== "object" || input === null) return input;
429
+ var prim = input[Symbol.toPrimitive];
430
+ if (prim !== undefined) {
431
+ var res = prim.call(input, hint || "default");
432
+ if (_typeof(res) !== "object") return res;
433
+ throw new TypeError("@@toPrimitive must return a primitive value.");
434
+ }
435
+ return (hint === "string" ? String : Number)(input);
436
+ }
437
+ function _toConsumableArray(arr) {
438
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
439
+ }
440
+ function _nonIterableSpread() {
441
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
442
+ }
443
+ function _unsupportedIterableToArray(o, minLen) {
444
+ if (!o) return;
445
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
446
+ var n = Object.prototype.toString.call(o).slice(8, -1);
447
+ if (n === "Object" && o.constructor) n = o.constructor.name;
448
+ if (n === "Map" || n === "Set") return Array.from(o);
449
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
450
+ }
451
+ function _iterableToArray(iter) {
452
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
453
+ }
454
+ function _arrayWithoutHoles(arr) {
455
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
456
+ }
457
+ function _arrayLikeToArray(arr, len) {
458
+ if (len == null || len > arr.length) len = arr.length;
459
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
460
+ return arr2;
461
+ }
462
+ function _objectDestructuringEmpty(obj) {
463
+ if (obj == null) throw new TypeError("Cannot destructure " + obj);
464
+ }
465
+ function _extends() {
466
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
467
+ for (var i = 1; i < arguments.length; i++) {
468
+ var source = arguments[i];
469
+ for (var key in source) {
470
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
471
+ target[key] = source[key];
472
+ }
473
+ }
474
+ }
475
+ return target;
476
+ };
477
+ return _extends.apply(this, arguments);
478
+ }
479
+ /**
480
+ * Convert Tree
481
+ * @param {Array} arr - Flat array
482
+ * @param {?string | ?number} parentId - Parent id
483
+ * @param {?string} keyId - Key value of id.
484
+ * @param {?string} keyParentId - Key value of parent id.
485
+ * @returns Array
486
+ */
487
+ function _convertTree(arr) {
488
+ var parentId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
489
+ var keyId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
490
+ var keyParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'parent_id';
491
+ if (!parentId) {
492
+ // If there is no parent id (when recursing for the first time), all parents will be queried
493
+ return arr.filter(function (item) {
494
+ return !item[keyParentId];
495
+ }).map(function (item) {
496
+ // Query all child nodes by parent node ID
497
+ item.children = _convertTree(arr, item[keyId], keyId, keyParentId);
498
+ return item;
499
+ });
500
+ } else {
501
+ return arr.filter(function (item) {
502
+ return item[keyParentId] === parentId;
503
+ }).map(function (item) {
504
+ // Query all child nodes by parent node ID
505
+ item.children = _convertTree(arr, item[keyId], keyId, keyParentId);
506
+ return item;
507
+ });
508
+ }
509
+ }
510
+
511
+ /**
512
+ * Flat tree
513
+ * @param {Array} arr - Hierarchical array
514
+ * @returns Array
515
+ */
516
+ function _flatTree(arr) {
517
+ var flatData = function flatData(_ref) {
518
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
519
+ var _rest$children = rest.children,
520
+ children = _rest$children === void 0 ? [] : _rest$children;
521
+ return [_objectSpread({}, rest)].concat(_toConsumableArray(children.flatMap(flatData)));
522
+ };
523
+ var result = arr.flatMap(flatData);
524
+
525
+ //remove children from item
526
+ result = result.map(function (item) {
527
+ delete item.children;
528
+ return item;
529
+ });
530
+ return result;
531
+ }
532
+
533
+ /**
534
+ * Get all depth
535
+ * @param {Object} node
536
+ * @returns Number
537
+ */
538
+ function _getAllDepth(arr) {
539
+ var count = function count(children) {
540
+ return children.reduce(function (depth, child) {
541
+ return Math.max(depth, 1 + count(child.children)); // increment depth of children by 1, and compare it with accumulated depth of other children within the same element
542
+ }, 0); //default value 0 that's returned if there are no children
543
+ };
544
+
545
+ return count(arr);
546
+ }
547
+
548
+ /**
549
+ * Add depth to each item in the tree
550
+ * @param {Array} arr - Hierarchical array
551
+ * @param {?string} keyId - Key value of id.
552
+ * @param {?string} keyParentId - Key value of parent id.
553
+ * @param {?number} depth - Depth of the item.
554
+ * @returns Number
555
+ */
556
+ function _addTreeDepth(arr) {
557
+ var keyId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
558
+ var parentItem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
559
+ var depth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
560
+ return arr.reduce(function (acc, el) {
561
+ var children = el.children,
562
+ otherProps = _objectWithoutProperties(el, _excluded);
563
+ acc.push(_objectSpread(_objectSpread({}, otherProps), {}, {
564
+ parentItem: parentItem,
565
+ depth: depth
566
+ }));
567
+ if (children) {
568
+ return acc.concat(_addTreeDepth(children, keyId, el[keyId], depth + 1));
569
+ }
570
+ return acc;
571
+ }, []);
572
+ }
573
+
574
+ /**
575
+ * Add indent placeholder
576
+ * @param {Array} arr - Flat array
577
+ * @param {?string} placeholder - String of placeholder
578
+ * @param {?string} lastPlaceholder - Last String of placeholder
579
+ * @param {?string} keyName - Key value of name.
580
+ * @returns Array
581
+ */
582
+ function _addTreeIndent(arr) {
583
+ var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '&nbsp;&nbsp;&nbsp;&nbsp;';
584
+ var lastPlaceholder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
585
+ var keyName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'label';
586
+ arr.forEach(function (item) {
587
+ var indent = '';
588
+ if (item.depth) {
589
+ Array(item.depth).fill(0).forEach(function (k, i) {
590
+ indent += placeholder;
591
+ if (i === item.depth - 1) {
592
+ item[keyName] = indent + lastPlaceholder + item[keyName];
593
+ }
594
+ });
595
+ }
596
+ });
597
+ }
598
+
599
+ /******/
600
+ return __webpack_exports__;
601
+ /******/
602
+ }()
603
+ );
604
+ });
605
+
606
+ /***/
607
+ },
608
+
609
+ /***/759: /***/function _(module, exports, __nested_webpack_require_29526__) {
610
+ /* module decorator */module = __nested_webpack_require_29526__.nmd(module);
611
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
612
+ function _typeof(obj) {
613
+ "@babel/helpers - typeof";
614
+
615
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
616
+ return typeof obj;
617
+ } : function (obj) {
618
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
619
+ }, _typeof(obj);
620
+ }
621
+ (function webpackUniversalModuleDefinition(root, factory) {
622
+ if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__nested_webpack_require_29526__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__nested_webpack_require_29526__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
623
+ })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
624
+ return (/******/function () {
625
+ // webpackBootstrap
626
+ /******/
627
+ "use strict";
628
+
629
+ /******/
630
+ var __webpack_modules__ = {
631
+ /***/787: /***/function _(module) {
632
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
633
+
634
+ /***/
635
+ }
636
+
637
+ /******/
638
+ };
639
+ /************************************************************************/
640
+ /******/ // The module cache
641
+ /******/
642
+ var __webpack_module_cache__ = {};
643
+ /******/
644
+ /******/ // The require function
645
+ /******/
646
+ function __nested_webpack_require_1465__(moduleId) {
647
+ /******/ // Check if module is in cache
648
+ /******/var cachedModule = __webpack_module_cache__[moduleId];
649
+ /******/
650
+ if (cachedModule !== undefined) {
651
+ /******/return cachedModule.exports;
652
+ /******/
653
+ }
654
+ /******/ // Create a new module (and put it into the cache)
655
+ /******/
656
+ var module = __webpack_module_cache__[moduleId] = {
657
+ /******/ // no module.id needed
658
+ /******/ // no module.loaded needed
659
+ /******/exports: {}
660
+ /******/
661
+ };
662
+ /******/
663
+ /******/ // Execute the module function
664
+ /******/
665
+ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
666
+ /******/
667
+ /******/ // Return the exports of the module
668
+ /******/
669
+ return module.exports;
670
+ /******/
671
+ }
672
+ /******/
673
+ /************************************************************************/
674
+ /******/ /* webpack/runtime/compat get default export */
675
+ /******/
676
+ (function () {
677
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
678
+ /******/__nested_webpack_require_1465__.n = function (module) {
679
+ /******/var getter = module && module.__esModule ? /******/function () {
680
+ return module['default'];
681
+ } : /******/function () {
682
+ return module;
683
+ };
684
+ /******/
685
+ __nested_webpack_require_1465__.d(getter, {
686
+ a: getter
687
+ });
688
+ /******/
689
+ return getter;
690
+ /******/
691
+ };
692
+ /******/
693
+ })();
694
+ /******/
695
+ /******/ /* webpack/runtime/define property getters */
696
+ /******/
697
+ (function () {
698
+ /******/ // define getter functions for harmony exports
699
+ /******/__nested_webpack_require_1465__.d = function (exports, definition) {
700
+ /******/for (var key in definition) {
701
+ /******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
702
+ /******/Object.defineProperty(exports, key, {
703
+ enumerable: true,
704
+ get: definition[key]
705
+ });
706
+ /******/
707
+ }
708
+ /******/
709
+ }
710
+ /******/
711
+ };
712
+ /******/
713
+ })();
714
+ /******/
715
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
716
+ /******/
717
+ (function () {
718
+ /******/__nested_webpack_require_1465__.o = function (obj, prop) {
719
+ return Object.prototype.hasOwnProperty.call(obj, prop);
720
+ };
721
+ /******/
722
+ })();
723
+ /******/
724
+ /******/ /* webpack/runtime/make namespace object */
725
+ /******/
726
+ (function () {
727
+ /******/ // define __esModule on exports
728
+ /******/__nested_webpack_require_1465__.r = function (exports) {
729
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
730
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
731
+ value: 'Module'
732
+ });
733
+ /******/
734
+ }
735
+ /******/
736
+ Object.defineProperty(exports, '__esModule', {
737
+ value: true
738
+ });
739
+ /******/
740
+ };
741
+ /******/
742
+ })();
743
+ /******/
744
+ /************************************************************************/
745
+ var __webpack_exports__ = {};
746
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
747
+ (function () {
748
+ __nested_webpack_require_1465__.r(__webpack_exports__);
749
+ /* harmony export */
750
+ __nested_webpack_require_1465__.d(__webpack_exports__, {
751
+ /* harmony export */"default": function _default() {
752
+ return __WEBPACK_DEFAULT_EXPORT__;
753
+ },
754
+ /* harmony export */"useBoundedDrag": function useBoundedDrag() {
755
+ return (/* binding */_useBoundedDrag
756
+ );
757
+ }
758
+ /* harmony export */
759
+ });
760
+ /* harmony import */
761
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
762
+ /* harmony import */
763
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
764
+ function _slicedToArray(arr, i) {
765
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
766
+ }
767
+ function _nonIterableRest() {
768
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
769
+ }
770
+ function _unsupportedIterableToArray(o, minLen) {
771
+ if (!o) return;
772
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
773
+ var n = Object.prototype.toString.call(o).slice(8, -1);
774
+ if (n === "Object" && o.constructor) n = o.constructor.name;
775
+ if (n === "Map" || n === "Set") return Array.from(o);
776
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
777
+ }
778
+ function _arrayLikeToArray(arr, len) {
779
+ if (len == null || len > arr.length) len = arr.length;
780
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
781
+ return arr2;
782
+ }
783
+ function _iterableToArrayLimit(arr, i) {
784
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
785
+ if (null != _i) {
786
+ var _s,
787
+ _e,
788
+ _x,
789
+ _r,
790
+ _arr = [],
791
+ _n = !0,
792
+ _d = !1;
793
+ try {
794
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
795
+ if (Object(_i) !== _i) return;
796
+ _n = !1;
797
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
798
+ } catch (err) {
799
+ _d = !0, _e = err;
800
+ } finally {
801
+ try {
802
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
803
+ } finally {
804
+ if (_d) throw _e;
805
+ }
806
+ }
807
+ return _arr;
808
+ }
809
+ }
810
+ function _arrayWithHoles(arr) {
811
+ if (Array.isArray(arr)) return arr;
812
+ }
813
+ /**
814
+ * Bounded Drag
815
+ *
816
+ * @usage:
817
+
818
+
819
+ const App = () => {
820
+ const [items, setItems] = useState<ListItem[]>([]);
821
+ // ... other states and refs
822
+
823
+ const deepCloneWithReactNode = (obj: any): any => {
824
+ if (obj === null || typeof obj !== 'object') {
825
+ return obj;
826
+ }
827
+
828
+ // Handle array
829
+ if (Array.isArray(obj)) {
830
+ return obj.map(item => deepCloneWithReactNode(item));
831
+ }
832
+
833
+ // Handle object
834
+ const clonedObj: any = {};
835
+ for (const key in obj) {
836
+ if (key === 'appendControl') {
837
+ clonedObj[key] = obj[key];
838
+ } else {
839
+ clonedObj[key] = deepCloneWithReactNode(obj[key]);
840
+ }
841
+ }
842
+ return clonedObj;
843
+ };
844
+
845
+
846
+ const getItemWithChildrenIndices = (items: ListItem[], startIndex: number): number[] => {
847
+ const indices = [startIndex];
848
+ const startItem = items[startIndex];
849
+ const startDepth = startItem.depth || 0;
850
+
851
+ // Check if subsequent items are child items
852
+ for (let i = startIndex + 1; i < items.length; i++) {
853
+ const currentItem = items[i];
854
+ const currentDepth = currentItem.depth || 0;
855
+ if (currentDepth > startDepth) {
856
+ indices.push(i);
857
+ } else {
858
+ break;
859
+ }
860
+ }
861
+
862
+ return indices;
863
+ };
864
+
865
+
866
+ const { isDragging, dragHandlers } = useBoundedDrag({
867
+ dragMode,
868
+ boundarySelector: '.custom-draggable-list',
869
+ itemSelector:'.custom-draggable-list__item',
870
+ dragHandleSelector: '.custom-draggable-list__handle',
871
+ onDragStart: (index: number) => {
872
+ // Additional drag start logic if needed
873
+ },
874
+ onDragOver: (dragIndex: number | null, dropIndex: number | null) => {
875
+ // Additional drag over logic if needed
876
+ },
877
+ onDragEnd: (dragIndex: number | null, dropIndex: number | null) => {
878
+ if (dragIndex !== null && dropIndex !== null && dragIndex !== dropIndex) {
879
+ // Handle item movement
880
+ const newItems = deepCloneWithReactNode(items);
881
+ const itemsToMove = getItemWithChildrenIndices(newItems, dragIndex);
882
+ const itemsBeingMoved = itemsToMove.map(index => newItems[index]);
883
+
884
+ // ... rest of your existing drag end logic ...
885
+
886
+ setItems(updatedItems);
887
+
888
+ }
889
+ }
890
+ });
891
+
892
+ // Update your JSX to use the new handlers
893
+ return (
894
+ <ul className="custom-draggable-list">
895
+ {items.map((item: any, index: number) => (
896
+ <li
897
+ // ... other props
898
+ draggable={!draggable ? undefined : editingItem !== item.id && "true"}
899
+ onDragStart={!draggable ? undefined : (e) => dragHandlers.handleDragStart(e, index)}
900
+ onDragOver={!draggable ? undefined : dragHandlers.handleDragOver}
901
+ onDragEnd={!draggable ? undefined : dragHandlers.handleDragEnd}
902
+ onTouchStart={!draggable ? undefined : (e) => dragHandlers.handleDragStart(e, index)}
903
+ onTouchMove={!draggable ? undefined : dragHandlers.handleDragOver}
904
+ onTouchEnd={!draggable ? undefined : dragHandlers.handleDragEnd}
905
+ >
906
+ <li className="custom-draggable-list__item">
907
+ <span className="custom-draggable-list__handle">☰</span>
908
+ <i>content {indec}<i>
909
+ </li>
910
+ </li>
911
+ ))}
912
+ </ul>
913
+ );
914
+
915
+ */
916
+
917
+ var _useBoundedDrag = function useBoundedDrag() {
918
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
919
+ var _options$dragMode = options.dragMode,
920
+ dragMode = _options$dragMode === void 0 ? 'handle' : _options$dragMode,
921
+ _options$boundarySele = options.boundarySelector,
922
+ boundarySelector = _options$boundarySele === void 0 ? '.custom-draggable-list' : _options$boundarySele,
923
+ _options$itemSelector = options.itemSelector,
924
+ itemSelector = _options$itemSelector === void 0 ? '.custom-draggable-list__item' : _options$itemSelector,
925
+ _options$dragHandleSe = options.dragHandleSelector,
926
+ dragHandleSelector = _options$dragHandleSe === void 0 ? '.custom-draggable-list__handle' : _options$dragHandleSe,
927
+ onDragStart = options.onDragStart,
928
+ onDragOver = options.onDragOver,
929
+ onDragEnd = options.onDragEnd;
930
+ var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
931
+ _useState2 = _slicedToArray(_useState, 2),
932
+ isDragging = _useState2[0],
933
+ setIsDragging = _useState2[1];
934
+ var dragItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
935
+ var dragOverItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
936
+ var dragNode = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
937
+ var touchOffset = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
938
+ x: 0,
939
+ y: 0
940
+ });
941
+ var currentHoverItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
942
+ var handleDragStart = function handleDragStart(e, position) {
943
+ var isTouch = ('touches' in e);
944
+ var target = e.target;
945
+
946
+ // For block mode or handle mode check
947
+ if (dragMode === 'handle') {
948
+ var handle = target.closest(dragHandleSelector);
949
+ if (!handle) {
950
+ if (!isTouch) e.preventDefault();
951
+ return false;
952
+ }
953
+ }
954
+
955
+ // Find the draggable item
956
+ var listItem = target.closest(itemSelector);
957
+ if (!listItem) return;
958
+
959
+ // Check boundary
960
+ var boundary = listItem.closest(boundarySelector);
961
+ if (!boundary) return;
962
+ dragItem.current = position;
963
+ onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(position);
964
+ if (isTouch) {
965
+ e.preventDefault(); // Prevent scrolling
966
+ var touch = e.touches[0];
967
+ var rect = listItem.getBoundingClientRect();
968
+ var boundaryRect = boundary.getBoundingClientRect();
969
+
970
+ // Calculate offset relative to the boundary
971
+ touchOffset.current = {
972
+ x: touch.clientX - rect.left,
973
+ y: touch.clientY - rect.top
974
+ };
975
+
976
+ // Clone the item for dragging
977
+ dragNode.current = listItem.cloneNode(true);
978
+ dragNode.current.classList.add('dragging');
979
+
980
+ // Style the clone
981
+ Object.assign(dragNode.current.style, {
982
+ position: 'fixed',
983
+ width: "".concat(rect.width, "px"),
984
+ height: "".concat(rect.height, "px"),
985
+ left: "".concat(rect.left, "px"),
986
+ top: "".concat(rect.top, "px"),
987
+ zIndex: '1000',
988
+ pointerEvents: 'none',
989
+ transform: 'scale(1.05)',
990
+ transition: 'transform 0.1s',
991
+ opacity: '0.9'
992
+ });
993
+ document.body.appendChild(dragNode.current);
994
+ setIsDragging(true);
995
+ listItem.classList.add('dragging-placeholder');
996
+ } else {
997
+ // ... desktop drag logic remains the same ...
998
+ }
999
+ };
1000
+ var handleDragOver = function handleDragOver(e) {
1001
+ e.preventDefault();
1002
+ var isTouch = ('touches' in e);
1003
+ if (!isTouch) {
1004
+ e.dataTransfer.dropEffect = 'move';
1005
+ }
1006
+
1007
+ // Get the current pointer/touch position
1008
+ var point = isTouch ? e.touches[0] : {
1009
+ clientX: e.clientX,
1010
+ clientY: e.clientY
1011
+ };
1012
+
1013
+ // Update dragged element position for touch events
1014
+ if (isTouch && isDragging && dragNode.current) {
1015
+ dragNode.current.style.left = "".concat(point.clientX - touchOffset.current.x, "px");
1016
+ dragNode.current.style.top = "".concat(point.clientY - touchOffset.current.y, "px");
1017
+ }
1018
+
1019
+ // Find the element below the pointer/touch
1020
+ var elemBelow = document.elementFromPoint(point.clientX, point.clientY);
1021
+ if (!elemBelow) return;
1022
+
1023
+ // Find the closest list item
1024
+ var listItem = elemBelow.closest(itemSelector);
1025
+ if (!listItem || listItem === currentHoverItem.current) return;
1026
+
1027
+ // Check boundary
1028
+ var boundary = listItem.closest(boundarySelector);
1029
+ if (!boundary) return;
1030
+
1031
+ // Update hover states
1032
+ if (currentHoverItem.current) {
1033
+ currentHoverItem.current.classList.remove('drag-over', 'drag-over-top', 'drag-over-bottom');
1034
+ }
1035
+ currentHoverItem.current = listItem;
1036
+ listItem.classList.add('drag-over');
1037
+
1038
+ // Calculate position in list
1039
+ var position = Array.from(listItem.parentNode.children).indexOf(listItem);
1040
+ dragOverItem.current = position;
1041
+
1042
+ // Determine drop position (top/bottom)
1043
+ var rect = listItem.getBoundingClientRect();
1044
+ var middleY = rect.top + rect.height / 2;
1045
+ if (point.clientY < middleY) {
1046
+ listItem.classList.add('drag-over-top');
1047
+ } else {
1048
+ listItem.classList.add('drag-over-bottom');
1049
+ }
1050
+ onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(dragItem.current, dragOverItem.current);
1051
+ };
1052
+ var handleDragEnd = function handleDragEnd(e) {
1053
+ var isTouch = ('touches' in e);
1054
+ if (isTouch && !isDragging) return;
1055
+ onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(dragItem.current, dragOverItem.current);
1056
+
1057
+ // Cleanup
1058
+ if (dragNode.current) {
1059
+ dragNode.current.remove();
1060
+ dragNode.current = null;
1061
+ }
1062
+ document.querySelectorAll(itemSelector).forEach(function (item) {
1063
+ item.style.opacity = '1';
1064
+ item.classList.remove('dragging', 'dragging-placeholder', 'drag-over', 'drag-over-top', 'drag-over-bottom');
1065
+ });
1066
+ setIsDragging(false);
1067
+ currentHoverItem.current = null;
1068
+ dragItem.current = null;
1069
+ dragOverItem.current = null;
1070
+ };
1071
+ return {
1072
+ isDragging: isDragging,
1073
+ dragHandlers: {
1074
+ handleDragStart: handleDragStart,
1075
+ handleDragOver: handleDragOver,
1076
+ handleDragEnd: handleDragEnd
1077
+ }
1078
+ };
1079
+ };
1080
+ /* harmony default export */
1081
+ var __WEBPACK_DEFAULT_EXPORT__ = _useBoundedDrag;
1082
+ })();
1083
+
1084
+ /******/
1085
+ return __webpack_exports__;
1086
+ /******/
1087
+ }()
1088
+ );
1089
+ });
1090
+
1091
+ /***/
1092
+ },
1093
+
1094
+ /***/787: /***/function _(module) {
1095
+ "use strict";
1096
+
1097
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
1098
+
1099
+ /***/
1100
+ }
1101
+
1102
+ /******/
1103
+ };
1104
+ /************************************************************************/
1105
+ /******/ // The module cache
1106
+ /******/
1107
+ var __webpack_module_cache__ = {};
1108
+ /******/
1109
+ /******/ // The require function
1110
+ /******/
1111
+ function __nested_webpack_require_54634__(moduleId) {
1112
+ /******/ // Check if module is in cache
1113
+ /******/var cachedModule = __webpack_module_cache__[moduleId];
1114
+ /******/
1115
+ if (cachedModule !== undefined) {
1116
+ /******/return cachedModule.exports;
1117
+ /******/
1118
+ }
1119
+ /******/ // Create a new module (and put it into the cache)
1120
+ /******/
1121
+ var module = __webpack_module_cache__[moduleId] = {
1122
+ /******/id: moduleId,
1123
+ /******/loaded: false,
1124
+ /******/exports: {}
1125
+ /******/
1126
+ };
1127
+ /******/
1128
+ /******/ // Execute the module function
1129
+ /******/
1130
+ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_54634__);
1131
+ /******/
1132
+ /******/ // Flag the module as loaded
1133
+ /******/
1134
+ module.loaded = true;
1135
+ /******/
1136
+ /******/ // Return the exports of the module
1137
+ /******/
1138
+ return module.exports;
1139
+ /******/
1140
+ }
1141
+ /******/
1142
+ /************************************************************************/
1143
+ /******/ /* webpack/runtime/compat get default export */
1144
+ /******/
1145
+ (function () {
1146
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1147
+ /******/__nested_webpack_require_54634__.n = function (module) {
1148
+ /******/var getter = module && module.__esModule ? /******/function () {
1149
+ return module['default'];
1150
+ } : /******/function () {
1151
+ return module;
1152
+ };
1153
+ /******/
1154
+ __nested_webpack_require_54634__.d(getter, {
1155
+ a: getter
1156
+ });
1157
+ /******/
1158
+ return getter;
1159
+ /******/
1160
+ };
1161
+ /******/
1162
+ })();
1163
+ /******/
1164
+ /******/ /* webpack/runtime/define property getters */
1165
+ /******/
1166
+ (function () {
1167
+ /******/ // define getter functions for harmony exports
1168
+ /******/__nested_webpack_require_54634__.d = function (exports, definition) {
1169
+ /******/for (var key in definition) {
1170
+ /******/if (__nested_webpack_require_54634__.o(definition, key) && !__nested_webpack_require_54634__.o(exports, key)) {
1171
+ /******/Object.defineProperty(exports, key, {
1172
+ enumerable: true,
1173
+ get: definition[key]
1174
+ });
1175
+ /******/
1176
+ }
1177
+ /******/
1178
+ }
1179
+ /******/
1180
+ };
1181
+ /******/
1182
+ })();
1183
+ /******/
1184
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1185
+ /******/
1186
+ (function () {
1187
+ /******/__nested_webpack_require_54634__.o = function (obj, prop) {
1188
+ return Object.prototype.hasOwnProperty.call(obj, prop);
1189
+ };
1190
+ /******/
1191
+ })();
1192
+ /******/
1193
+ /******/ /* webpack/runtime/make namespace object */
1194
+ /******/
1195
+ (function () {
1196
+ /******/ // define __esModule on exports
1197
+ /******/__nested_webpack_require_54634__.r = function (exports) {
1198
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1199
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
1200
+ value: 'Module'
1201
+ });
1202
+ /******/
1203
+ }
1204
+ /******/
1205
+ Object.defineProperty(exports, '__esModule', {
1206
+ value: true
1207
+ });
1208
+ /******/
1209
+ };
1210
+ /******/
1211
+ })();
1212
+ /******/
1213
+ /******/ /* webpack/runtime/node module decorator */
1214
+ /******/
1215
+ (function () {
1216
+ /******/__nested_webpack_require_54634__.nmd = function (module) {
1217
+ /******/module.paths = [];
1218
+ /******/
1219
+ if (!module.children) module.children = [];
1220
+ /******/
1221
+ return module;
1222
+ /******/
1223
+ };
1224
+ /******/
1225
+ })();
1226
+ /******/
1227
+ /************************************************************************/
1228
+ var __webpack_exports__ = {};
1229
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1230
+ (function () {
1231
+ "use strict";
1232
+
1233
+ __nested_webpack_require_54634__.r(__webpack_exports__);
1234
+ /* harmony export */
1235
+ __nested_webpack_require_54634__.d(__webpack_exports__, {
1236
+ /* harmony export */"default": function _default() {
1237
+ return __WEBPACK_DEFAULT_EXPORT__;
1238
+ }
1239
+ /* harmony export */
1240
+ });
1241
+ /* harmony import */
1242
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_54634__(787);
1243
+ /* harmony import */
1244
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_54634__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1245
+ /* harmony import */
1246
+ var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_54634__(438);
1247
+ /* harmony import */
1248
+ var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__);
1249
+ /* harmony import */
1250
+ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_54634__(188);
1251
+ /* harmony import */
1252
+ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__);
1253
+ /* harmony import */
1254
+ var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_54634__(759);
1255
+ /* harmony import */
1256
+ var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__);
1257
+ var _excluded = ["wrapperClassName", "prefix", "data", "draggable", "handleHide", "handleIcon", "handlePos", "dragMode", "editable", "itemStyle", "hierarchical", "indentation", "doubleIndent", "alternateCollapse", "arrow", "renderOption", "onUpdate"];
1258
+ function _extends() {
1259
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
1260
+ for (var i = 1; i < arguments.length; i++) {
1261
+ var source = arguments[i];
1262
+ for (var key in source) {
1263
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1264
+ target[key] = source[key];
1265
+ }
1266
+ }
1267
+ }
1268
+ return target;
1269
+ };
1270
+ return _extends.apply(this, arguments);
1271
+ }
1272
+ function ownKeys(object, enumerableOnly) {
1273
+ var keys = Object.keys(object);
1274
+ if (Object.getOwnPropertySymbols) {
1275
+ var symbols = Object.getOwnPropertySymbols(object);
1276
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
1277
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1278
+ })), keys.push.apply(keys, symbols);
1279
+ }
1280
+ return keys;
1281
+ }
1282
+ function _objectSpread(target) {
1283
+ for (var i = 1; i < arguments.length; i++) {
1284
+ var source = null != arguments[i] ? arguments[i] : {};
1285
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
1286
+ _defineProperty(target, key, source[key]);
1287
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
1288
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1289
+ });
1290
+ }
1291
+ return target;
1292
+ }
1293
+ function _defineProperty(obj, key, value) {
1294
+ key = _toPropertyKey(key);
1295
+ if (key in obj) {
1296
+ Object.defineProperty(obj, key, {
1297
+ value: value,
1298
+ enumerable: true,
1299
+ configurable: true,
1300
+ writable: true
1301
+ });
1302
+ } else {
1303
+ obj[key] = value;
1304
+ }
1305
+ return obj;
1306
+ }
1307
+ function _toPropertyKey(arg) {
1308
+ var key = _toPrimitive(arg, "string");
1309
+ return _typeof(key) === "symbol" ? key : String(key);
1310
+ }
1311
+ function _toPrimitive(input, hint) {
1312
+ if (_typeof(input) !== "object" || input === null) return input;
1313
+ var prim = input[Symbol.toPrimitive];
1314
+ if (prim !== undefined) {
1315
+ var res = prim.call(input, hint || "default");
1316
+ if (_typeof(res) !== "object") return res;
1317
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1318
+ }
1319
+ return (hint === "string" ? String : Number)(input);
1320
+ }
1321
+ function _toConsumableArray(arr) {
1322
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1323
+ }
1324
+ function _nonIterableSpread() {
1325
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1326
+ }
1327
+ function _iterableToArray(iter) {
1328
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1329
+ }
1330
+ function _arrayWithoutHoles(arr) {
1331
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1332
+ }
1333
+ function _typeof(obj) {
1334
+ "@babel/helpers - typeof";
1335
+
1336
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1337
+ return typeof obj;
1338
+ } : function (obj) {
1339
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1340
+ }, _typeof(obj);
1341
+ }
1342
+ function _slicedToArray(arr, i) {
1343
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1344
+ }
1345
+ function _nonIterableRest() {
1346
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1347
+ }
1348
+ function _unsupportedIterableToArray(o, minLen) {
1349
+ if (!o) return;
1350
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1351
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1352
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1353
+ if (n === "Map" || n === "Set") return Array.from(o);
1354
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1355
+ }
1356
+ function _arrayLikeToArray(arr, len) {
1357
+ if (len == null || len > arr.length) len = arr.length;
1358
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1359
+ return arr2;
1360
+ }
1361
+ function _iterableToArrayLimit(arr, i) {
1362
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1363
+ if (null != _i) {
1364
+ var _s,
1365
+ _e,
1366
+ _x,
1367
+ _r,
1368
+ _arr = [],
1369
+ _n = !0,
1370
+ _d = !1;
1371
+ try {
1372
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
1373
+ if (Object(_i) !== _i) return;
1374
+ _n = !1;
1375
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
1376
+ } catch (err) {
1377
+ _d = !0, _e = err;
1378
+ } finally {
1379
+ try {
1380
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
1381
+ } finally {
1382
+ if (_d) throw _e;
1383
+ }
1384
+ }
1385
+ return _arr;
1386
+ }
1387
+ }
1388
+ function _arrayWithHoles(arr) {
1389
+ if (Array.isArray(arr)) return arr;
1390
+ }
1391
+ function _objectWithoutProperties(source, excluded) {
1392
+ if (source == null) return {};
1393
+ var target = _objectWithoutPropertiesLoose(source, excluded);
1394
+ var key, i;
1395
+ if (Object.getOwnPropertySymbols) {
1396
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1397
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1398
+ key = sourceSymbolKeys[i];
1399
+ if (excluded.indexOf(key) >= 0) continue;
1400
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1401
+ target[key] = source[key];
1402
+ }
1403
+ }
1404
+ return target;
1405
+ }
1406
+ function _objectWithoutPropertiesLoose(source, excluded) {
1407
+ if (source == null) return {};
1408
+ var target = {};
1409
+ var sourceKeys = Object.keys(source);
1410
+ var key, i;
1411
+ for (i = 0; i < sourceKeys.length; i++) {
1412
+ key = sourceKeys[i];
1413
+ if (excluded.indexOf(key) >= 0) continue;
1414
+ target[key] = source[key];
1415
+ }
1416
+ return target;
1417
+ }
1418
+ var DragDropList = /*#__PURE__*/(0, react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, externalRef) {
1419
+ var wrapperClassName = props.wrapperClassName,
1420
+ _props$prefix = props.prefix,
1421
+ prefix = _props$prefix === void 0 ? 'custom' : _props$prefix,
1422
+ data = props.data,
1423
+ _props$draggable = props.draggable,
1424
+ draggable = _props$draggable === void 0 ? true : _props$draggable,
1425
+ _props$handleHide = props.handleHide,
1426
+ handleHide = _props$handleHide === void 0 ? false : _props$handleHide,
1427
+ _props$handleIcon = props.handleIcon,
1428
+ handleIcon = _props$handleIcon === void 0 ? '☰' : _props$handleIcon,
1429
+ _props$handlePos = props.handlePos,
1430
+ handlePos = _props$handlePos === void 0 ? 'left' : _props$handlePos,
1431
+ _props$dragMode = props.dragMode,
1432
+ dragMode = _props$dragMode === void 0 ? 'handle' : _props$dragMode,
1433
+ _props$editable = props.editable,
1434
+ editable = _props$editable === void 0 ? false : _props$editable,
1435
+ itemStyle = props.itemStyle,
1436
+ _props$hierarchical = props.hierarchical,
1437
+ hierarchical = _props$hierarchical === void 0 ? true : _props$hierarchical,
1438
+ indentation = props.indentation,
1439
+ doubleIndent = props.doubleIndent,
1440
+ alternateCollapse = props.alternateCollapse,
1441
+ _props$arrow = props.arrow,
1442
+ arrow = _props$arrow === void 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
1443
+ viewBox: "0 0 22 22",
1444
+ width: "8px"
1445
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
1446
+ d: "m345.44 248.29l-194.29 194.28c-12.359 12.365-32.397 12.365-44.75 0-12.354-12.354-12.354-32.391 0-44.744l171.91-171.91-171.91-171.9c-12.354-12.359-12.354-32.394 0-44.748 12.354-12.359 32.391-12.359 44.75 0l194.29 194.28c6.177 6.18 9.262 14.271 9.262 22.366 0 8.099-3.091 16.196-9.267 22.373",
1447
+ transform: "matrix(.03541-.00013.00013.03541 2.98 3.02)",
1448
+ fill: "#a5a5a5"
1449
+ }))) : _props$arrow,
1450
+ renderOption = props.renderOption,
1451
+ onUpdate = props.onUpdate,
1452
+ attributes = _objectWithoutProperties(props, _excluded);
1453
+ var INDENT_PLACEHOLDER = doubleIndent ? "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" : "&nbsp;&nbsp;&nbsp;&nbsp;";
1454
+ var INDENT_LAST_PLACEHOLDER = "".concat(typeof indentation !== 'undefined' && indentation !== '' ? "".concat(indentation, "&nbsp;&nbsp;") : '');
1455
+ var rootRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1456
+ var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
1457
+ _useState2 = _slicedToArray(_useState, 2),
1458
+ items = _useState2[0],
1459
+ setItems = _useState2[1];
1460
+ var _useState3 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
1461
+ _useState4 = _slicedToArray(_useState3, 2),
1462
+ editingItem = _useState4[0],
1463
+ setEditingItem = _useState4[1];
1464
+
1465
+ // Edit
1466
+ var _useState5 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
1467
+ _useState6 = _slicedToArray(_useState5, 2),
1468
+ editValue = _useState6[0],
1469
+ setEditValue = _useState6[1];
1470
+
1471
+ // Collapse/Expand
1472
+ var _useState7 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(new Set()),
1473
+ _useState8 = _slicedToArray(_useState7, 2),
1474
+ collapsedItems = _useState8[0],
1475
+ setCollapsedItems = _useState8[1];
1476
+
1477
+ // Get editable field list
1478
+ var getEditableFields = function getEditableFields(item) {
1479
+ // Exclude fields that don't need to be edited
1480
+ var excludeFields = ['id', 'parentId', 'depth', 'children', 'disabled', 'appendControl', 'parentItem'];
1481
+ return Object.keys(item).filter(function (key) {
1482
+ return !excludeFields.includes(key);
1483
+ });
1484
+ };
1485
+
1486
+ // ================================================================
1487
+ // General
1488
+ // ================================================================
1489
+ var deepCloneWithReactNode = function deepCloneWithReactNode(obj) {
1490
+ if (obj === null || _typeof(obj) !== 'object') {
1491
+ return obj;
1492
+ }
1493
+
1494
+ // Handle array
1495
+ if (Array.isArray(obj)) {
1496
+ return obj.map(function (item) {
1497
+ return deepCloneWithReactNode(item);
1498
+ });
1499
+ }
1500
+
1501
+ // Handle object
1502
+ var clonedObj = {};
1503
+ for (var _key in obj) {
1504
+ if (_key === 'appendControl') {
1505
+ clonedObj[_key] = obj[_key];
1506
+ } else {
1507
+ clonedObj[_key] = deepCloneWithReactNode(obj[_key]);
1508
+ }
1509
+ }
1510
+ return clonedObj;
1511
+ };
1512
+ var getItemWithChildrenIndices = function getItemWithChildrenIndices(items, startIndex) {
1513
+ var indices = [startIndex];
1514
+ var startItem = items[startIndex];
1515
+ var startDepth = startItem.depth || 0;
1516
+
1517
+ // Check if subsequent items are child items
1518
+ for (var i = startIndex + 1; i < items.length; i++) {
1519
+ var currentItem = items[i];
1520
+ var currentDepth = currentItem.depth || 0;
1521
+ if (currentDepth > startDepth) {
1522
+ indices.push(i);
1523
+ } else {
1524
+ break;
1525
+ }
1526
+ }
1527
+ return indices;
1528
+ };
1529
+ var getIndentStr = function getIndentStr(item) {
1530
+ // Add indent placeholder
1531
+ var indent = '';
1532
+ var depthData = item.depth;
1533
+ if (depthData) {
1534
+ Array(depthData).fill(0).forEach(function (k, i) {
1535
+ indent += INDENT_PLACEHOLDER;
1536
+ if (i === depthData - 1) {
1537
+ indent += INDENT_LAST_PLACEHOLDER;
1538
+ }
1539
+ });
1540
+ }
1541
+ return indent;
1542
+ };
1543
+
1544
+ // ================================================================
1545
+ // Collapse/Expand
1546
+ // ================================================================
1547
+ // Add collapse/expand handler function
1548
+ var handleCollapse = function handleCollapse(itemId, e) {
1549
+ e.preventDefault();
1550
+ e.stopPropagation();
1551
+ setCollapsedItems(function (prev) {
1552
+ var newCollapsed = new Set(prev);
1553
+ if (newCollapsed.has(itemId)) {
1554
+ newCollapsed["delete"](itemId);
1555
+ } else {
1556
+ newCollapsed.add(itemId);
1557
+ }
1558
+ return newCollapsed;
1559
+ });
1560
+ };
1561
+
1562
+ // Helper function to determine if an item should be displayed
1563
+ var shouldShowItem = function shouldShowItem(item) {
1564
+ if (!alternateCollapse) return true;
1565
+ var currentId = item.parentId;
1566
+ while (currentId) {
1567
+ if (collapsedItems.has(currentId)) {
1568
+ return false;
1569
+ }
1570
+ var parentItem = items.find(function (i) {
1571
+ return i.id === currentId;
1572
+ });
1573
+ currentId = parentItem === null || parentItem === void 0 ? void 0 : parentItem.parentId;
1574
+ }
1575
+ return true;
1576
+ };
1577
+ var hasChildren = function hasChildren(itemId) {
1578
+ return items.some(function (item) {
1579
+ return item.parentId === itemId;
1580
+ });
1581
+ };
1582
+
1583
+ // ================================================================
1584
+ // Drag & Drop Handlers (Desktop & Touch)
1585
+ // ================================================================
1586
+ var _useBoundedDrag = funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3___default()({
1587
+ dragMode: dragMode,
1588
+ boundarySelector: ".".concat(prefix, "-draggable-list"),
1589
+ itemSelector: ".".concat(prefix, "-draggable-list__item"),
1590
+ dragHandleSelector: ".".concat(prefix, "-draggable-list__handle"),
1591
+ onDragStart: function onDragStart(index) {
1592
+ // Additional drag start logic if needed
1593
+ },
1594
+ onDragOver: function onDragOver(dragIndex, dropIndex) {
1595
+ // Additional drag over logic if needed
1596
+ },
1597
+ onDragEnd: function onDragEnd(dragIndex, dropIndex) {
1598
+ if (dragIndex !== null && dropIndex !== null && dragIndex !== dropIndex) {
1599
+ var _newItems$dragIndex, _newItems$dragIndex2, _newItems$dropIndex;
1600
+ // Handle item movement
1601
+ var newItems = deepCloneWithReactNode(items);
1602
+ var itemsToMove = getItemWithChildrenIndices(newItems, dragIndex);
1603
+ var itemsBeingMoved = itemsToMove.map(function (index) {
1604
+ return newItems[index];
1605
+ });
1606
+
1607
+ // ... rest of your existing drag end logic ...
1608
+
1609
+ var _targetId = (_newItems$dragIndex = newItems[dragIndex]) === null || _newItems$dragIndex === void 0 ? void 0 : _newItems$dragIndex.id;
1610
+
1611
+ // Calculate depth difference
1612
+ var draggedDepth = ((_newItems$dragIndex2 = newItems[dragIndex]) === null || _newItems$dragIndex2 === void 0 ? void 0 : _newItems$dragIndex2.depth) || 0;
1613
+ var dropDepth = ((_newItems$dropIndex = newItems[dropIndex]) === null || _newItems$dropIndex === void 0 ? void 0 : _newItems$dropIndex.depth) || 0;
1614
+ var depthDiff = dropDepth - draggedDepth;
1615
+
1616
+ // Adjust depth for all moving items
1617
+ itemsBeingMoved.forEach(function (item) {
1618
+ if (item.depth !== undefined) {
1619
+ item.depth += depthDiff;
1620
+ }
1621
+ });
1622
+
1623
+ // Remove all items from their original location (from back to front to keep indexing correct)
1624
+ itemsToMove.reverse().forEach(function (index) {
1625
+ newItems.splice(index, 1);
1626
+ });
1627
+
1628
+ // Calculate new insert position
1629
+ var insertIndex = dropIndex;
1630
+ if (dropIndex > dragIndex) {
1631
+ insertIndex -= itemsToMove.length;
1632
+ }
1633
+
1634
+ // Insert all items
1635
+ newItems.splice.apply(newItems, [insertIndex, 0].concat(_toConsumableArray(itemsBeingMoved)));
1636
+
1637
+ // Rebuild tree structure
1638
+ var tree = hierarchical ? (0, funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__.convertTree)(newItems, '', 'id', 'parentId') : newItems;
1639
+ var updatedItems = hierarchical ? (0, funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__.addTreeDepth)(tree) : tree;
1640
+ setItems(updatedItems);
1641
+ onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(updatedItems, _targetId);
1642
+ }
1643
+ }
1644
+ }),
1645
+ isDragging = _useBoundedDrag.isDragging,
1646
+ dragHandlers = _useBoundedDrag.dragHandlers;
1647
+
1648
+ // ================================================================
1649
+ // Editable
1650
+ // ================================================================
1651
+
1652
+ var handleDoubleClick = function handleDoubleClick(item) {
1653
+ if (!editable) return;
1654
+ setEditingItem(item.id);
1655
+ // Only editable fields are copied
1656
+ var editableFields = getEditableFields(item);
1657
+ var editableValues = editableFields.reduce(function (acc, field) {
1658
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, field, item[field]));
1659
+ }, {});
1660
+ setEditValue(editableValues);
1661
+ };
1662
+ var handleEditCancel = function handleEditCancel() {
1663
+ setEditingItem(null);
1664
+ setEditValue({});
1665
+ };
1666
+ var handleEditSave = function handleEditSave(itemId) {
1667
+ var newItems = items.map(function (item) {
1668
+ if (item.id === itemId) {
1669
+ return _objectSpread(_objectSpread({}, item), editValue);
1670
+ }
1671
+ return item;
1672
+ });
1673
+ setItems(newItems);
1674
+ onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(newItems, itemId);
1675
+ setEditingItem(null);
1676
+ setEditValue({});
1677
+ };
1678
+ var handleInputChange = function handleInputChange(field, value) {
1679
+ setEditValue(function (prev) {
1680
+ return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, field, value));
1681
+ });
1682
+ };
1683
+ var handleKeyDown = function handleKeyDown(e, itemId) {
1684
+ if (e.key === 'Enter' || e.key === 'NumpadEnter') {
1685
+ handleEditSave(itemId);
1686
+ } else if (e.key === 'Escape') {
1687
+ handleEditCancel();
1688
+ }
1689
+ };
1690
+ var renderEditForm = function renderEditForm(item) {
1691
+ var editableFields = getEditableFields(item);
1692
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1693
+ className: "".concat(prefix, "-draggable-list__edit-form")
1694
+ }, editableFields.map(function (field) {
1695
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1696
+ key: field,
1697
+ className: "".concat(prefix, "-draggable-list__edit-field")
1698
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", null, field, ":"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
1699
+ type: "text",
1700
+ value: editValue[field] || '',
1701
+ onChange: function onChange(e) {
1702
+ return handleInputChange(field, e.target.value);
1703
+ },
1704
+ onKeyDown: function onKeyDown(e) {
1705
+ return handleKeyDown(e, item.id);
1706
+ },
1707
+ placeholder: field,
1708
+ autoFocus: field === editableFields[0]
1709
+ }));
1710
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1711
+ className: "".concat(prefix, "-draggable-list__edit-buttons")
1712
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
1713
+ onClick: function onClick() {
1714
+ return handleEditSave(item.id);
1715
+ }
1716
+ }, "\u2713"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
1717
+ onClick: handleEditCancel
1718
+ }, "\u2715")));
1719
+ };
1720
+ (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1721
+ // data init
1722
+ //--------------
1723
+ if (typeof data !== 'undefined' && Array.isArray(data)) {
1724
+ var tree = hierarchical ? (0, funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__.convertTree)(data, '', 'id', 'parentId') : data;
1725
+ var _ORGIN_DATA = hierarchical ? (0, funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__.addTreeDepth)(tree) : tree;
1726
+ setItems(_ORGIN_DATA);
1727
+ }
1728
+ }, [data]);
1729
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", _extends({}, attributes, {
1730
+ ref: function ref(node) {
1731
+ rootRef.current = node;
1732
+ if (typeof externalRef === 'function') {
1733
+ externalRef(node);
1734
+ } else if (externalRef) {
1735
+ externalRef.current = node;
1736
+ }
1737
+ },
1738
+ className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)("".concat(prefix, "-draggable-list"), (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(wrapperClassName, 'mb-3'), (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(dragMode, 'handle'), "handle-pos-".concat(handlePos !== null && handlePos !== void 0 ? handlePos : 'left'), {
1739
+ 'draggable': draggable,
1740
+ 'icon-hide': handleHide,
1741
+ 'alternate-collapse': alternateCollapse
1742
+ })
1743
+ }), items.map(function (item, index) {
1744
+ // If the item should be hidden, the rendering is skipped
1745
+ if (!shouldShowItem(item)) return null;
1746
+
1747
+ // collapse
1748
+ var hasChildItems = hasChildren(item.id);
1749
+ var isCollapsed = collapsedItems.has(item.id);
1750
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
1751
+ key: item.id,
1752
+ "data-index": index,
1753
+ "data-id": item.id,
1754
+ "data-parent-id": item.parentId,
1755
+ "data-value": item.value,
1756
+ "data-label": item.label,
1757
+ "data-listitemlabel": item.listItemLabel,
1758
+ className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)("".concat(prefix, "-draggable-list__item"), (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(dragMode, 'handle'), {
1759
+ 'disabled': item.disabled,
1760
+ 'draggable': draggable,
1761
+ 'editing': editingItem === item.id,
1762
+ // collapse
1763
+ 'has-children': hasChildItems,
1764
+ 'collapsed': isCollapsed
1765
+ }),
1766
+ draggable: !draggable ? undefined : editingItem !== item.id && "true",
1767
+ onDragStart: !draggable ? undefined : function (e) {
1768
+ return dragHandlers.handleDragStart(e, index);
1769
+ },
1770
+ onDragOver: !draggable ? undefined : dragHandlers.handleDragOver,
1771
+ onDragEnd: !draggable ? undefined : dragHandlers.handleDragEnd,
1772
+ onTouchStart: !draggable ? undefined : function (e) {
1773
+ return dragHandlers.handleDragStart(e, index);
1774
+ },
1775
+ onTouchMove: !draggable ? undefined : dragHandlers.handleDragOver,
1776
+ onTouchEnd: !draggable ? undefined : dragHandlers.handleDragEnd,
1777
+ style: itemStyle,
1778
+ onDoubleClick: function onDoubleClick() {
1779
+ return handleDoubleClick(item);
1780
+ }
1781
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1782
+ className: "".concat(prefix, "-draggable-list__itemcontent")
1783
+ }, renderOption ? renderOption(item, "".concat(prefix, "-draggable-list__handle"), index) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, draggable && !handleHide ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
1784
+ className: "".concat(prefix, "-draggable-list__handle ").concat(handlePos !== null && handlePos !== void 0 ? handlePos : 'left'),
1785
+ draggable: dragMode === 'handle',
1786
+ dangerouslySetInnerHTML: {
1787
+ __html: "".concat(handleIcon)
1788
+ }
1789
+ }) : null, editingItem === item.id ? renderEditForm(item) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1790
+ className: "".concat(prefix, "-draggable-list__itemcontent-inner")
1791
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1792
+ className: "".concat(prefix, "-draggable-list__itemlabel")
1793
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
1794
+ dangerouslySetInnerHTML: {
1795
+ __html: "".concat(getIndentStr(item)).concat(typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel)
1796
+ }
1797
+ }), alternateCollapse && hasChildItems && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
1798
+ className: "".concat(prefix, "-draggable-list__collapse-arrow"),
1799
+ onClick: function onClick(e) {
1800
+ return handleCollapse(item.id, e);
1801
+ }
1802
+ }, arrow || (isCollapsed ? '▶' : '▼'))), item.appendControl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1803
+ className: "".concat(prefix, "-draggable-list__itemext"),
1804
+ id: "".concat(prefix, "-draggable-list__itemext-").concat(item.value)
1805
+ }, item.appendControl)) : null))));
1806
+ }));
1807
+ });
1808
+ /* harmony default export */
1809
+ var __WEBPACK_DEFAULT_EXPORT__ = DragDropList;
1810
+ })();
1811
+
1812
+ /******/
1813
+ return __webpack_exports__;
1814
+ /******/
1815
+ }()
1816
+ );
1817
+ });
1818
+
1819
+ /***/ }),
1820
+
1821
+ /***/ 188:
1822
+ /***/ (function(module, exports, __webpack_require__) {
1823
+
1824
+ /* module decorator */ module = __webpack_require__.nmd(module);
1825
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
1826
+ (function webpackUniversalModuleDefinition(root, factory) {
1827
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1828
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1829
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1830
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
1831
+ })(this, function () {
1832
+ return (/******/function () {
1833
+ // webpackBootstrap
1834
+ /******/
1835
+ "use strict";
1836
+
1837
+ /******/ // The require scope
1838
+ /******/
1839
+ var __nested_webpack_require_993__ = {};
1840
+ /******/
1841
+ /************************************************************************/
1842
+ /******/ /* webpack/runtime/define property getters */
1843
+ /******/
1844
+ (function () {
1845
+ /******/ // define getter functions for harmony exports
1846
+ /******/__nested_webpack_require_993__.d = function (exports, definition) {
1847
+ /******/for (var key in definition) {
1848
+ /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
1849
+ /******/Object.defineProperty(exports, key, {
1850
+ enumerable: true,
1851
+ get: definition[key]
1852
+ });
1853
+ /******/
1854
+ }
1855
+ /******/
1856
+ }
1857
+ /******/
1858
+ };
1859
+ /******/
1860
+ })();
1861
+ /******/
1862
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1863
+ /******/
1864
+ (function () {
1865
+ /******/__nested_webpack_require_993__.o = function (obj, prop) {
1866
+ return Object.prototype.hasOwnProperty.call(obj, prop);
1867
+ };
1868
+ /******/
1869
+ })();
1870
+ /******/
1871
+ /******/ /* webpack/runtime/make namespace object */
1872
+ /******/
1873
+ (function () {
1874
+ /******/ // define __esModule on exports
1875
+ /******/__nested_webpack_require_993__.r = function (exports) {
1876
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1877
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
1878
+ value: 'Module'
1879
+ });
1880
+ /******/
1881
+ }
1882
+ /******/
1883
+ Object.defineProperty(exports, '__esModule', {
1884
+ value: true
1885
+ });
1886
+ /******/
1887
+ };
1888
+ /******/
1889
+ })();
1890
+ /******/
1891
+ /************************************************************************/
1892
+ var __webpack_exports__ = {};
1893
+ __nested_webpack_require_993__.r(__webpack_exports__);
1894
+ /* harmony export */
1895
+ __nested_webpack_require_993__.d(__webpack_exports__, {
1896
+ /* harmony export */"clsWrite": function clsWrite() {
1897
+ return (/* binding */_clsWrite
1898
+ );
1899
+ },
1900
+ /* harmony export */"combinedCls": function combinedCls() {
1901
+ return (/* binding */_combinedCls
1902
+ );
1903
+ }
1904
+ /* harmony export */
1905
+ });
1906
+ function _slicedToArray(arr, i) {
1907
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1908
+ }
1909
+ function _nonIterableRest() {
1910
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1911
+ }
1912
+ function _unsupportedIterableToArray(o, minLen) {
1913
+ if (!o) return;
1914
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1915
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1916
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1917
+ if (n === "Map" || n === "Set") return Array.from(o);
1918
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1919
+ }
1920
+ function _arrayLikeToArray(arr, len) {
1921
+ if (len == null || len > arr.length) len = arr.length;
1922
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1923
+ return arr2;
1924
+ }
1925
+ function _iterableToArrayLimit(arr, i) {
1926
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1927
+ if (null != _i) {
1928
+ var _s,
1929
+ _e,
1930
+ _x,
1931
+ _r,
1932
+ _arr = [],
1933
+ _n = !0,
1934
+ _d = !1;
1935
+ try {
1936
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
1937
+ if (Object(_i) !== _i) return;
1938
+ _n = !1;
1939
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
1940
+ } catch (err) {
1941
+ _d = !0, _e = err;
1942
+ } finally {
1943
+ try {
1944
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
1945
+ } finally {
1946
+ if (_d) throw _e;
1947
+ }
1948
+ }
1949
+ return _arr;
1950
+ }
1951
+ }
1952
+ function _arrayWithHoles(arr) {
1953
+ if (Array.isArray(arr)) return arr;
1954
+ }
1955
+ function _typeof(obj) {
1956
+ "@babel/helpers - typeof";
1957
+
1958
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1959
+ return typeof obj;
1960
+ } : function (obj) {
1961
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1962
+ }, _typeof(obj);
1963
+ }
1964
+ /**
1965
+ * Output of class name
1966
+ * @param {*} s - Any
1967
+ * @param {String} defaultCls - Default string
1968
+ * @param {?*} targetCls - Any
1969
+ * @returns {*}
1970
+ */
1971
+ function _clsWrite(s, defaultCls) {
1972
+ var targetCls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
1973
+ return s || s === '' ? typeof targetCls === 'undefined' ? s : targetCls : defaultCls;
1974
+ }
1975
+
1976
+ /**
1977
+ * Combined classnames
1978
+ * @param {*} args
1979
+ * @returns {String|undefined}
1980
+ */
1981
+ /* Usage:
1982
+
1983
+ console.log(combinedCls('a-1', 'a-2', 'a-3', {
1984
+ 'p-1': null,
1985
+ 'p-2': undefined,
1986
+ 'p-3': true,
1987
+ 'p-4': false,
1988
+ 'p-5': 'kkk',
1989
+ 'p-6': 0,
1990
+ 'p-7': 1,
1991
+ 'p-8': '',
1992
+ undefined
1993
+ })); // a-1 a-2 a-3 p-3 p-5 p-7
1994
+ */
1995
+ function _combinedCls() {
1996
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1997
+ args[_key] = arguments[_key];
1998
+ }
1999
+ if (args) {
2000
+ var classes = [];
2001
+ for (var i = 0; i < args.length; i++) {
2002
+ var className = args[i];
2003
+ if (!className) {
2004
+ continue;
2005
+ }
2006
+ var type = _typeof(className);
2007
+ if (type === 'string' || type === 'number') {
2008
+ classes.push(className);
2009
+ } else if (type === 'object') {
2010
+ var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
2011
+ var _ref2 = _slicedToArray(_ref, 2),
2012
+ key = _ref2[0],
2013
+ value = _ref2[1];
2014
+ return value ? key : null;
2015
+ });
2016
+ classes = _classes.length ? classes.concat(_classes.filter(function (c) {
2017
+ return !!c;
2018
+ })) : classes;
2019
+ }
2020
+ }
2021
+ return classes.join(' ').trim();
2022
+ }
2023
+ return undefined;
2024
+ }
2025
+
2026
+ /******/
2027
+ return __webpack_exports__;
2028
+ /******/
2029
+ }()
2030
+ );
2031
+ });
2032
+
2033
+ /***/ }),
2034
+
2035
+ /***/ 79:
2036
+ /***/ (function(module, exports, __webpack_require__) {
2037
+
2038
+ /* module decorator */ module = __webpack_require__.nmd(module);
2039
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2040
+ (function webpackUniversalModuleDefinition(root, factory) {
2041
+ if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2042
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2043
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2044
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2045
+ })(this, function () {
2046
+ return (/******/function () {
2047
+ // webpackBootstrap
2048
+ /******/
2049
+ "use strict";
2050
+
2051
+ /******/ // The require scope
2052
+ /******/
2053
+ var __nested_webpack_require_987__ = {};
2054
+ /******/
2055
+ /************************************************************************/
2056
+ /******/ /* webpack/runtime/define property getters */
2057
+ /******/
2058
+ (function () {
2059
+ /******/ // define getter functions for harmony exports
2060
+ /******/__nested_webpack_require_987__.d = function (exports, definition) {
2061
+ /******/for (var key in definition) {
2062
+ /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
2063
+ /******/Object.defineProperty(exports, key, {
2064
+ enumerable: true,
2065
+ get: definition[key]
2066
+ });
2067
+ /******/
2068
+ }
2069
+ /******/
2070
+ }
2071
+ /******/
2072
+ };
2073
+ /******/
2074
+ })();
2075
+ /******/
2076
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2077
+ /******/
2078
+ (function () {
2079
+ /******/__nested_webpack_require_987__.o = function (obj, prop) {
2080
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2081
+ };
2082
+ /******/
2083
+ })();
2084
+ /******/
2085
+ /******/ /* webpack/runtime/make namespace object */
2086
+ /******/
2087
+ (function () {
2088
+ /******/ // define __esModule on exports
2089
+ /******/__nested_webpack_require_987__.r = function (exports) {
2090
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2091
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2092
+ value: 'Module'
2093
+ });
2094
+ /******/
2095
+ }
2096
+ /******/
2097
+ Object.defineProperty(exports, '__esModule', {
2098
+ value: true
2099
+ });
2100
+ /******/
2101
+ };
2102
+ /******/
2103
+ })();
2104
+ /******/
2105
+ /************************************************************************/
2106
+ var __webpack_exports__ = {};
2107
+ __nested_webpack_require_987__.r(__webpack_exports__);
2108
+ /* harmony export */
2109
+ __nested_webpack_require_987__.d(__webpack_exports__, {
2110
+ /* harmony export */"convertArrToValByBraces": function convertArrToValByBraces() {
2111
+ return (/* binding */_convertArrToValByBraces
2112
+ );
2113
+ },
2114
+ /* harmony export */"convertArrToValByBrackets": function convertArrToValByBrackets() {
2115
+ return (/* binding */_convertArrToValByBrackets
2116
+ );
2117
+ },
2118
+ /* harmony export */"convertStringByCommaToValByBraces": function convertStringByCommaToValByBraces() {
2119
+ return (/* binding */_convertStringByCommaToValByBraces
2120
+ );
2121
+ },
2122
+ /* harmony export */"convertStringByCommaToValByBrackets": function convertStringByCommaToValByBrackets() {
2123
+ return (/* binding */_convertStringByCommaToValByBrackets
2124
+ );
2125
+ }
2126
+ /* harmony export */
2127
+ });
2128
+ /**
2129
+ * Convert value to string separated by square brackets
2130
+ * @param {String} str such as: 1,2,3
2131
+ * @returns {String} such as: [1][2][3]
2132
+ */
2133
+ function _convertStringByCommaToValByBrackets(str) {
2134
+ if (typeof str === 'undefined' || str === null || str === '') {
2135
+ return '';
2136
+ }
2137
+ return str.split(',').map(function (v) {
2138
+ return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]");
2139
+ }).join('');
2140
+ }
2141
+
2142
+ /**
2143
+ * Convert array value to string separated by square brackets
2144
+ * @param {String[]} arr such as: ['1','2','3']
2145
+ * @returns {String} such as: [1][2][3]
2146
+ */
2147
+ function _convertArrToValByBrackets(arr) {
2148
+ if (!Array.isArray(arr)) return '';
2149
+ return arr.map(function (v) {
2150
+ return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]");
2151
+ }).join('');
2152
+ }
2153
+
2154
+ /**
2155
+ * Convert value to string separated by curly braces
2156
+ * @param {String} str such as: 1,2,3
2157
+ * @returns {String} such as: {1}{2}{3}
2158
+ */
2159
+ function _convertStringByCommaToValByBraces(str) {
2160
+ if (typeof str === 'undefined' || str === null || str === '') {
2161
+ return '';
2162
+ }
2163
+ return str.split(',').map(function (v) {
2164
+ return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}");
2165
+ }).join('');
2166
+ }
2167
+
2168
+ /**
2169
+ * Convert array value to string separated by curly braces
2170
+ * @param {String[]} arr such as: ['1','2','3']
2171
+ * @returns {String} such as: {1}{2}{3}
2172
+ */
2173
+ function _convertArrToValByBraces(arr) {
2174
+ if (!Array.isArray(arr)) return '';
2175
+ return arr.map(function (v) {
2176
+ return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}");
2177
+ }).join('');
2178
+ }
2179
+
2180
+ /******/
2181
+ return __webpack_exports__;
2182
+ /******/
2183
+ }()
2184
+ );
2185
+ });
2186
+
2187
+ /***/ }),
2188
+
2189
+ /***/ 135:
2190
+ /***/ (function(module, exports, __webpack_require__) {
2191
+
2192
+ /* module decorator */ module = __webpack_require__.nmd(module);
2193
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2194
+ (function webpackUniversalModuleDefinition(root, factory) {
2195
+ if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2196
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2197
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2198
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2199
+ })(this, function () {
2200
+ return (/******/function () {
2201
+ // webpackBootstrap
2202
+ /******/
2203
+ "use strict";
2204
+
2205
+ /******/ // The require scope
2206
+ /******/
2207
+ var __nested_webpack_require_987__ = {};
2208
+ /******/
2209
+ /************************************************************************/
2210
+ /******/ /* webpack/runtime/define property getters */
2211
+ /******/
2212
+ (function () {
2213
+ /******/ // define getter functions for harmony exports
2214
+ /******/__nested_webpack_require_987__.d = function (exports, definition) {
2215
+ /******/for (var key in definition) {
2216
+ /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
2217
+ /******/Object.defineProperty(exports, key, {
2218
+ enumerable: true,
2219
+ get: definition[key]
2220
+ });
2221
+ /******/
2222
+ }
2223
+ /******/
2224
+ }
2225
+ /******/
2226
+ };
2227
+ /******/
2228
+ })();
2229
+ /******/
2230
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2231
+ /******/
2232
+ (function () {
2233
+ /******/__nested_webpack_require_987__.o = function (obj, prop) {
2234
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2235
+ };
2236
+ /******/
2237
+ })();
2238
+ /******/
2239
+ /******/ /* webpack/runtime/make namespace object */
2240
+ /******/
2241
+ (function () {
2242
+ /******/ // define __esModule on exports
2243
+ /******/__nested_webpack_require_987__.r = function (exports) {
2244
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2245
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2246
+ value: 'Module'
2247
+ });
2248
+ /******/
2249
+ }
2250
+ /******/
2251
+ Object.defineProperty(exports, '__esModule', {
2252
+ value: true
2253
+ });
2254
+ /******/
2255
+ };
2256
+ /******/
2257
+ })();
2258
+ /******/
2259
+ /************************************************************************/
2260
+ var __webpack_exports__ = {};
2261
+ __nested_webpack_require_987__.r(__webpack_exports__);
2262
+ /* harmony export */
2263
+ __nested_webpack_require_987__.d(__webpack_exports__, {
2264
+ /* harmony export */"extractContentsOfBraces": function extractContentsOfBraces() {
2265
+ return (/* binding */_extractContentsOfBraces
2266
+ );
2267
+ },
2268
+ /* harmony export */"extractContentsOfBrackets": function extractContentsOfBrackets() {
2269
+ return (/* binding */_extractContentsOfBrackets
2270
+ );
2271
+ },
2272
+ /* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
2273
+ return (/* binding */_extractContentsOfMixedCharactersWithBraces
2274
+ );
2275
+ },
2276
+ /* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
2277
+ return (/* binding */_extractContentsOfMixedCharactersWithComma
2278
+ );
2279
+ },
2280
+ /* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
2281
+ return (/* binding */_extractContentsOfParentheses
2282
+ );
2283
+ },
2284
+ /* harmony export */"extractorExist": function extractorExist() {
2285
+ return (/* binding */_extractorExist
2286
+ );
2287
+ }
2288
+ /* harmony export */
2289
+ });
2290
+ /**
2291
+ * Determine whether an extractor is included
2292
+ * @param {String} str => input string. such as 'a[1], b[2]', '{a[1]}'
2293
+ * @returns {Boolean}
2294
+ */
2295
+ function _extractorExist(str) {
2296
+ if (typeof str === 'undefined' || str === null || str === '') {
2297
+ return false;
2298
+ }
2299
+ var res = false;
2300
+ if (str !== null && str !== void 0 && str.match(/(\[.*?\])/gi)) {
2301
+ res = true;
2302
+ }
2303
+ return res;
2304
+ }
2305
+
2306
+ /**
2307
+ * Extract the contents of square brackets
2308
+ * @param {String} str => input string. such as '[1,2] [f][c]'
2309
+ * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
2310
+ * @returns {Array<string>|string} such as: ['1,2','f','c']
2311
+ */
2312
+ function _extractContentsOfBrackets(str) {
2313
+ var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2314
+ if (typeof str === 'undefined' || str === null || str === '') {
2315
+ return !commaSeparated ? [] : '';
2316
+ }
2317
+ var res = str.match(/[^\[]+(?=(\[ \])|\])/g);
2318
+ if (commaSeparated) {
2319
+ return res === null ? '' : res.join(',').replace(/\,+$/, '');
2320
+ } else {
2321
+ return res === null ? '' : res;
2322
+ }
2323
+ }
2324
+
2325
+ /**
2326
+ * Extract the contents of curly braces
2327
+ * @param {String} str => input string. such as '{1,2} {f}{c}'
2328
+ * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
2329
+ * @returns {Array<string>|string} such as: ['1,2','f','c']
2330
+ */
2331
+ function _extractContentsOfBraces(str) {
2332
+ var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2333
+ if (typeof str === 'undefined' || str === null || str === '') {
2334
+ return !commaSeparated ? [] : '';
2335
+ }
2336
+ var res = str.match(/[^\{]+(?=(\{ \})|\})/g);
2337
+ if (commaSeparated) {
2338
+ return res === null ? '' : res.join(',').replace(/\,+$/, '');
2339
+ } else {
2340
+ return res === null ? '' : res;
2341
+ }
2342
+ }
2343
+
2344
+ /**
2345
+ * Extract the contents of parentheses
2346
+ * @param {String} str => input string. such as '(1,2) (f)(c)'
2347
+ * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
2348
+ * @returns {Array<string>|string} such as: ['1,2','f','c']
2349
+ */
2350
+ function _extractContentsOfParentheses(str) {
2351
+ var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2352
+ if (typeof str === 'undefined' || str === null || str === '') {
2353
+ return !commaSeparated ? [] : '';
2354
+ }
2355
+ var res = str.match(/[^\(]+(?=(\( \))|\))/g);
2356
+ if (commaSeparated) {
2357
+ return res === null ? '' : res.join(',').replace(/\,+$/, '');
2358
+ } else {
2359
+ return res === null ? '' : res;
2360
+ }
2361
+ }
2362
+
2363
+ /**
2364
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
2365
+ *
2366
+ * Example:
2367
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
2368
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
2369
+ *
2370
+ * Output: [
2371
+ * { label: "Poor", value: "c" },
2372
+ * { label: "Sub-option 4", value: "c-2" },
2373
+ * { label: "Empty", value: "" }
2374
+ * ]
2375
+ *
2376
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
2377
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
2378
+ */
2379
+ function _extractContentsOfMixedCharactersWithBraces(str) {
2380
+ // Fix the extra '{' at the beginning
2381
+ var cleaned = str.replace(/^{{/, '{');
2382
+
2383
+ // Remove empty {} or {[]} tail
2384
+ var trimmed = cleaned.replace(/\{\[\]\}$/, '');
2385
+
2386
+ // The match is like {label[value]}
2387
+ var pattern = /\{(.*?)\[(.*?)\]\}/g;
2388
+ var matches = Array.from(trimmed.matchAll(pattern));
2389
+ return matches.map(function (match) {
2390
+ return {
2391
+ label: match[1],
2392
+ value: match[2]
2393
+ };
2394
+ });
2395
+ }
2396
+
2397
+ /**
2398
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
2399
+ *
2400
+ * Example:
2401
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
2402
+ * Output: [
2403
+ * { label: "Poor", value: "c" },
2404
+ * { label: "Sub-option 4", value: "c-2" },
2405
+ * { label: "Empty", value: "" }
2406
+ * ]
2407
+ *
2408
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
2409
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
2410
+ */
2411
+ function _extractContentsOfMixedCharactersWithComma(str) {
2412
+ return str.split(",").map(function (item) {
2413
+ return item.trim();
2414
+ }).map(function (item) {
2415
+ var match = item.match(/^(.*?)\[(.*?)\]$/);
2416
+ if (match) {
2417
+ return {
2418
+ label: match[1],
2419
+ value: match[2]
2420
+ };
2421
+ }
2422
+ return null;
2423
+ }).filter(Boolean);
2424
+ }
2425
+
2426
+ /******/
2427
+ return __webpack_exports__;
2428
+ /******/
2429
+ }()
2430
+ );
2431
+ });
2432
+
2433
+ /***/ }),
2434
+
2435
+ /***/ 575:
2436
+ /***/ (function(module, exports, __webpack_require__) {
2437
+
2438
+ /* module decorator */ module = __webpack_require__.nmd(module);
2439
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
2440
+ (function webpackUniversalModuleDefinition(root, factory) {
2441
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2442
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2443
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2444
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2445
+ })(this, function () {
2446
+ return (/******/function () {
2447
+ // webpackBootstrap
2448
+ /******/
2449
+ "use strict";
2450
+
2451
+ /******/ // The require scope
2452
+ /******/
2453
+ var __nested_webpack_require_993__ = {};
2454
+ /******/
2455
+ /************************************************************************/
2456
+ /******/ /* webpack/runtime/define property getters */
2457
+ /******/
2458
+ (function () {
2459
+ /******/ // define getter functions for harmony exports
2460
+ /******/__nested_webpack_require_993__.d = function (exports, definition) {
2461
+ /******/for (var key in definition) {
2462
+ /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
2463
+ /******/Object.defineProperty(exports, key, {
2464
+ enumerable: true,
2465
+ get: definition[key]
2466
+ });
2467
+ /******/
2468
+ }
2469
+ /******/
2470
+ }
2471
+ /******/
2472
+ };
2473
+ /******/
2474
+ })();
2475
+ /******/
2476
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2477
+ /******/
2478
+ (function () {
2479
+ /******/__nested_webpack_require_993__.o = function (obj, prop) {
2480
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2481
+ };
2482
+ /******/
2483
+ })();
2484
+ /******/
2485
+ /******/ /* webpack/runtime/make namespace object */
2486
+ /******/
2487
+ (function () {
2488
+ /******/ // define __esModule on exports
2489
+ /******/__nested_webpack_require_993__.r = function (exports) {
2490
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2491
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2492
+ value: 'Module'
2493
+ });
2494
+ /******/
2495
+ }
2496
+ /******/
2497
+ Object.defineProperty(exports, '__esModule', {
2498
+ value: true
2499
+ });
2500
+ /******/
2501
+ };
2502
+ /******/
2503
+ })();
2504
+ /******/
2505
+ /************************************************************************/
2506
+ var __webpack_exports__ = {};
2507
+ __nested_webpack_require_993__.r(__webpack_exports__);
2508
+ /* harmony export */
2509
+ __nested_webpack_require_993__.d(__webpack_exports__, {
2510
+ /* harmony export */"deepClone": function deepClone() {
2511
+ return (/* binding */_deepClone
2512
+ );
2513
+ },
2514
+ /* harmony export */"flatData": function flatData() {
2515
+ return (/* binding */_flatData
2516
+ );
2517
+ },
2518
+ /* harmony export */"removeArrDuplicateItems": function removeArrDuplicateItems() {
2519
+ return (/* binding */_removeArrDuplicateItems
2520
+ );
2521
+ }
2522
+ /* harmony export */
2523
+ });
2524
+ function _typeof(obj) {
2525
+ "@babel/helpers - typeof";
2526
+
2527
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2528
+ return typeof obj;
2529
+ } : function (obj) {
2530
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2531
+ }, _typeof(obj);
2532
+ }
2533
+ /**
2534
+ * Remove Duplicate objects from JSON Array
2535
+ * @param {Array} obj
2536
+ * @param {String} fieldName
2537
+ */
2538
+ function _removeArrDuplicateItems(obj, fieldName) {
2539
+ if (!Array.isArray(obj)) return [];
2540
+ var clean = obj.filter(function (item, index, self) {
2541
+ return index === self.findIndex(function (t) {
2542
+ return t[fieldName] === item[fieldName];
2543
+ });
2544
+ });
2545
+ return clean;
2546
+ }
2547
+ ;
2548
+
2549
+ /**
2550
+ * Deep clone
2551
+ * @param {*} obj
2552
+ */
2553
+ function _deepClone(obj) {
2554
+ if (Array.isArray(obj)) {
2555
+ return obj.map(function (item) {
2556
+ return _deepClone(item);
2557
+ });
2558
+ } else if (_typeof(obj) === 'object' && obj !== null) {
2559
+ var clone = {};
2560
+ for (var key in obj) {
2561
+ if (obj.hasOwnProperty(key)) {
2562
+ clone[key] = _deepClone(obj[key]);
2563
+ }
2564
+ }
2565
+ return clone;
2566
+ } else {
2567
+ return obj;
2568
+ }
2569
+ }
2570
+
2571
+ /**
2572
+ * Flat Data
2573
+ * @param {*} data
2574
+ * @returns
2575
+ */
2576
+ function _flatData(data) {
2577
+ var result = [];
2578
+ var iterate = function iterate(obj) {
2579
+ if (!obj) {
2580
+ return;
2581
+ }
2582
+ obj.forEach(function (item) {
2583
+ result.push(item);
2584
+ if (item.children) {
2585
+ iterate(item.children);
2586
+ }
2587
+
2588
+ // delete current item children
2589
+ delete item.children;
2590
+ });
2591
+ };
2592
+ iterate(data);
2593
+ return result;
2594
+ }
2595
+
2596
+ /******/
2597
+ return __webpack_exports__;
2598
+ /******/
2599
+ }()
2600
+ );
2601
+ });
2602
+
2603
+ /***/ }),
2604
+
2605
+ /***/ 85:
2606
+ /***/ (function(module, exports, __webpack_require__) {
2607
+
2608
+ /* module decorator */ module = __webpack_require__.nmd(module);
2609
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2610
+ (function webpackUniversalModuleDefinition(root, factory) {
2611
+ if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2612
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2613
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2614
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2615
+ })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
2616
+ return (/******/function () {
2617
+ // webpackBootstrap
2618
+ /******/
2619
+ "use strict";
2620
+
2621
+ /******/
2622
+ var __webpack_modules__ = {
2623
+ /***/787: /***/function _(module) {
2624
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
2625
+
2626
+ /***/
2627
+ }
2628
+
2629
+ /******/
2630
+ };
2631
+ /************************************************************************/
2632
+ /******/ // The module cache
2633
+ /******/
2634
+ var __webpack_module_cache__ = {};
2635
+ /******/
2636
+ /******/ // The require function
2637
+ /******/
2638
+ function __nested_webpack_require_1465__(moduleId) {
2639
+ /******/ // Check if module is in cache
2640
+ /******/var cachedModule = __webpack_module_cache__[moduleId];
2641
+ /******/
2642
+ if (cachedModule !== undefined) {
2643
+ /******/return cachedModule.exports;
2644
+ /******/
2645
+ }
2646
+ /******/ // Create a new module (and put it into the cache)
2647
+ /******/
2648
+ var module = __webpack_module_cache__[moduleId] = {
2649
+ /******/ // no module.id needed
2650
+ /******/ // no module.loaded needed
2651
+ /******/exports: {}
2652
+ /******/
2653
+ };
2654
+ /******/
2655
+ /******/ // Execute the module function
2656
+ /******/
2657
+ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
2658
+ /******/
2659
+ /******/ // Return the exports of the module
2660
+ /******/
2661
+ return module.exports;
2662
+ /******/
2663
+ }
2664
+ /******/
2665
+ /************************************************************************/
2666
+ /******/ /* webpack/runtime/compat get default export */
2667
+ /******/
2668
+ (function () {
2669
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
2670
+ /******/__nested_webpack_require_1465__.n = function (module) {
2671
+ /******/var getter = module && module.__esModule ? /******/function () {
2672
+ return module['default'];
2673
+ } : /******/function () {
2674
+ return module;
2675
+ };
2676
+ /******/
2677
+ __nested_webpack_require_1465__.d(getter, {
2678
+ a: getter
2679
+ });
2680
+ /******/
2681
+ return getter;
2682
+ /******/
2683
+ };
2684
+ /******/
2685
+ })();
2686
+ /******/
2687
+ /******/ /* webpack/runtime/define property getters */
2688
+ /******/
2689
+ (function () {
2690
+ /******/ // define getter functions for harmony exports
2691
+ /******/__nested_webpack_require_1465__.d = function (exports, definition) {
2692
+ /******/for (var key in definition) {
2693
+ /******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
2694
+ /******/Object.defineProperty(exports, key, {
2695
+ enumerable: true,
2696
+ get: definition[key]
2697
+ });
2698
+ /******/
2699
+ }
2700
+ /******/
2701
+ }
2702
+ /******/
2703
+ };
2704
+ /******/
2705
+ })();
2706
+ /******/
2707
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2708
+ /******/
2709
+ (function () {
2710
+ /******/__nested_webpack_require_1465__.o = function (obj, prop) {
2711
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2712
+ };
2713
+ /******/
2714
+ })();
2715
+ /******/
2716
+ /******/ /* webpack/runtime/make namespace object */
2717
+ /******/
2718
+ (function () {
2719
+ /******/ // define __esModule on exports
2720
+ /******/__nested_webpack_require_1465__.r = function (exports) {
2721
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2722
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2723
+ value: 'Module'
2724
+ });
2725
+ /******/
2726
+ }
2727
+ /******/
2728
+ Object.defineProperty(exports, '__esModule', {
2729
+ value: true
2730
+ });
2731
+ /******/
2732
+ };
2733
+ /******/
2734
+ })();
2735
+ /******/
2736
+ /************************************************************************/
2737
+ var __webpack_exports__ = {};
2738
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
2739
+ (function () {
2740
+ __nested_webpack_require_1465__.r(__webpack_exports__);
2741
+ /* harmony export */
2742
+ __nested_webpack_require_1465__.d(__webpack_exports__, {
2743
+ /* harmony export */"default": function _default() {
2744
+ return __WEBPACK_DEFAULT_EXPORT__;
2745
+ }
2746
+ /* harmony export */
2747
+ });
2748
+ /* harmony import */
2749
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
2750
+ /* harmony import */
2751
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2752
+ /**
2753
+ * Create an available ID
2754
+ *
2755
+ */
2756
+
2757
+ var useComId = function useComId() {
2758
+ return "ID-".concat((0, react__WEBPACK_IMPORTED_MODULE_0__.useId)().replace(/\:/g, "-"));
2759
+ };
2760
+ /* harmony default export */
2761
+ var __WEBPACK_DEFAULT_EXPORT__ = useComId;
2762
+ })();
2763
+
2764
+ /******/
2765
+ return __webpack_exports__;
2766
+ /******/
2767
+ }()
2768
+ );
2769
+ });
2770
+
2771
+ /***/ }),
2772
+
2773
+ /***/ 455:
2774
+ /***/ (function(module, exports, __webpack_require__) {
2775
+
2776
+ /* module decorator */ module = __webpack_require__.nmd(module);
2777
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
2778
+ (function webpackUniversalModuleDefinition(root, factory) {
2779
+ if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2780
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2781
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2782
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2783
+ })(this, function () {
2784
+ return (/******/function () {
2785
+ // webpackBootstrap
2786
+ /******/
2787
+ "use strict";
2788
+
2789
+ /******/ // The require scope
2790
+ /******/
2791
+ var __nested_webpack_require_993__ = {};
2792
+ /******/
2793
+ /************************************************************************/
2794
+ /******/ /* webpack/runtime/define property getters */
2795
+ /******/
2796
+ (function () {
2797
+ /******/ // define getter functions for harmony exports
2798
+ /******/__nested_webpack_require_993__.d = function (exports, definition) {
2799
+ /******/for (var key in definition) {
2800
+ /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
2801
+ /******/Object.defineProperty(exports, key, {
2802
+ enumerable: true,
2803
+ get: definition[key]
2804
+ });
2805
+ /******/
2806
+ }
2807
+ /******/
2808
+ }
2809
+ /******/
2810
+ };
2811
+ /******/
2812
+ })();
2813
+ /******/
2814
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2815
+ /******/
2816
+ (function () {
2817
+ /******/__nested_webpack_require_993__.o = function (obj, prop) {
2818
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2819
+ };
2820
+ /******/
2821
+ })();
2822
+ /******/
2823
+ /******/ /* webpack/runtime/make namespace object */
2824
+ /******/
2825
+ (function () {
2826
+ /******/ // define __esModule on exports
2827
+ /******/__nested_webpack_require_993__.r = function (exports) {
2828
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2829
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2830
+ value: 'Module'
2831
+ });
2832
+ /******/
2833
+ }
2834
+ /******/
2835
+ Object.defineProperty(exports, '__esModule', {
2836
+ value: true
2837
+ });
2838
+ /******/
2839
+ };
2840
+ /******/
2841
+ })();
2842
+ /******/
2843
+ /************************************************************************/
2844
+ var __webpack_exports__ = {};
2845
+ __nested_webpack_require_993__.r(__webpack_exports__);
2846
+ /* harmony export */
2847
+ __nested_webpack_require_993__.d(__webpack_exports__, {
2848
+ /* harmony export */"isEmail": function isEmail() {
2849
+ return (/* binding */_isEmail
2850
+ );
2851
+ },
2852
+ /* harmony export */"isEmpty": function isEmpty() {
2853
+ return (/* binding */_isEmpty
2854
+ );
2855
+ },
2856
+ /* harmony export */"isInt": function isInt() {
2857
+ return (/* binding */_isInt
2858
+ );
2859
+ },
2860
+ /* harmony export */"isJSON": function isJSON() {
2861
+ return (/* binding */_isJSON
2862
+ );
2863
+ },
2864
+ /* harmony export */"isMobile": function isMobile() {
2865
+ return (/* binding */_isMobile
2866
+ );
2867
+ },
2868
+ /* harmony export */"isNumber": function isNumber() {
2869
+ return (/* binding */_isNumber
2870
+ );
2871
+ },
2872
+ /* harmony export */"isTel": function isTel() {
2873
+ return (/* binding */_isTel
2874
+ );
2875
+ },
2876
+ /* harmony export */"isValidNumeric": function isValidNumeric() {
2877
+ return (/* binding */_isValidNumeric
2878
+ );
2879
+ }
2880
+ /* harmony export */
2881
+ });
2882
+ function _typeof(obj) {
2883
+ "@babel/helpers - typeof";
2884
+
2885
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2886
+ return typeof obj;
2887
+ } : function (obj) {
2888
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2889
+ }, _typeof(obj);
2890
+ }
2891
+ /**
2892
+ * Fix And Parse JSON (Support for handling complex escape JSON strings)
2893
+ * @desc recursively fix top-level key/value (recursively handles when encountering top-level values that are objects/arrays)
2894
+ * @private
2895
+ */
2896
+ /*
2897
+ - Still prioritize JSON.parse first;
2898
+ - After parse fails, do unescaping (\\" → ");
2899
+ - Then process the outermost layer (object or array) key by key, value by value;
2900
+ - If a top-level value is an unquoted object or array (e.g., messages: [ {...} ]), recursively treat that value as a new outermost layer for fixing;
2901
+ - For strings wrapped in quotes ('...' or "..."), only extract the outer layer and re-encode with JSON.stringify (ensuring internal single/double quotes won't be mistakenly changed);
2902
+ - Set MAX_DEPTH to prevent infinite recursion.
2903
+ */
2904
+ /*
2905
+ @Examples:
2906
+
2907
+ // ✅ Valid JSON (contains svg and single quote content)
2908
+ const okJson = `{
2909
+ "label":"<svg width='16' height='16'><path fill='currentColor' d='M19 13h-6'/></svg> 新建会话",
2910
+ "value":"new",
2911
+ "onClick":"method.setVal(''); method.clearData();"
2912
+ }`;
2913
+
2914
+ const okJson2 = `{
2915
+ label:"<svg width='16' height='16'><path fill='currentColor' d='M19 13h-6'/></svg> 新建会话",
2916
+ value:"new",
2917
+ onClick:"method.setVal(''); method.clearData();"
2918
+ }`;
2919
+
2920
+ // ⚠️ Single quote JSON
2921
+ const badJson = "{'model':'{model}','messages':[{'role':'user','content':'{message}'}],'stream': true}";
2922
+
2923
+ // ⚠️ Escaped JSON
2924
+ const badJson2 = "{\\\"label\\\":\\\"<svg width='16' height='16' viewBox='0 0 24 24'><path fill='currentColor' d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/></svg> 新建会话\\\",\\\"value\\\":\\\"new\\\",\\\"onClick\\\":\\\"method.setVal(''); method.clearData();\\\"}";
2925
+
2926
+ const badJson3 = "{\"label\":\"<svg width='16' height='16' viewBox='0 0 24 24'><path fill='currentColor' d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/></svg> 新建会话\",\"value\":\"new\",\"onClick\":\"method.setVal(''); method.clearData();\"}";
2927
+
2928
+ const badJson4 = "[{\"label\":\"<svg fill='currentColor' width='12' height='12' viewBox='0 0 24 24'><path d='M20.5 9a3.49 3.49 0 0 0-3.45 3h-1.1a2.49 2.49 0 0 0-4.396-1.052L8.878 9.731l3.143-4.225a2.458 2.458 0 0 0 2.98-.019L17.339 8H16v1h3V6h-1v1.243l-2.336-2.512A2.473 2.473 0 0 0 16 3.5a2.5 2.5 0 0 0-5 0 2.474 2.474 0 0 0 .343 1.243L7.947 9.308 4.955 7.947a2.404 2.404 0 0 0-.161-1.438l3.704-1.385-.44 1.371.942.333L10 4 7.172 3l-.334.943 1.01.357-3.659 1.368a2.498 2.498 0 1 0-.682 4.117l2.085 2.688-2.053 2.76a2.5 2.5 0 1 0 .87 3.864l3.484 1.587-1.055.373.334.943L10 21l-1-2.828-.943.333.435 1.354-3.608-1.645A2.471 2.471 0 0 0 5 17.5a2.5 2.5 0 0 0-.058-.527l3.053-1.405 3.476 4.48a2.498 2.498 0 1 0 4.113.075L18 17.707V19h1v-3h-3v1h1.293l-2.416 2.416a2.466 2.466 0 0 0-2.667-.047l-3.283-4.23 2.554-1.176A2.494 2.494 0 0 0 15.95 13h1.1a3.493 3.493 0 1 0 3.45-4zm-7-7A1.5 1.5 0 1 1 12 3.5 1.502 1.502 0 0 1 13.5 2zm0 18a1.5 1.5 0 1 1-1.5 1.5 1.502 1.502 0 0 1 1.5-1.5zM1 7.5a1.5 1.5 0 1 1 2.457 1.145l-.144.112A1.496 1.496 0 0 1 1 7.5zm3.32 1.703a2.507 2.507 0 0 0 .264-.326l2.752 1.251-1.124 1.512zM2.5 19A1.5 1.5 0 1 1 4 17.5 1.502 1.502 0 0 1 2.5 19zm2.037-2.941a2.518 2.518 0 0 0-.193-.234l1.885-2.532 1.136 1.464zm3.76-1.731L6.849 12.46l1.42-1.908L11.1 11.84a2.29 2.29 0 0 0-.033 1.213zM13.5 14a1.5 1.5 0 1 1 1.5-1.5 1.502 1.502 0 0 1-1.5 1.5zm7 1a2.5 2.5 0 1 1 2.5-2.5 2.502 2.502 0 0 1-2.5 2.5zm1.5-2.5a1.5 1.5 0 1 1-1.5-1.5 1.502 1.502 0 0 1 1.5 1.5z'/><path fill='none' d='M0 0h24v24H0z'/></svg> 深度思考\",\"value\":\"brief\",\"onClick\":\"if(isActive){method.executeCustomMethod('changeModel', true)}else{method.executeCustomMethod('changeModel', false)}\"},{\"label\":\"<svg fill='currentColor' width='12' height='12' viewBox='0 0 24 24'><path d='M19 2H5c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h3.586L12 21.414 15.414 18H19c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zm0 14h-4.414L12 18.586 9.414 16H5V4h14v12z'/></svg> 精简回答\",\"value\":\"brief\",\"onClick\":\"if(isActive){method.setContextData({systemPrompt:'请精简回答,字数控制在150个字左右, 思考过程请简洁简短',mergedText:method.getContextData().mergedText,analyzeMetrics:method.getContextData().analyzeMetrics});}else{method.setContextData({mergedText:method.getContextData().mergedText,analyzeMetrics:method.getContextData().analyzeMetrics});}\"},{\"label\":\"<svg fill='none' width='12' height='12' viewBox='0 0 16 16'><path d='M7 0.0618896V9H15.9381C15.446 12.9463 12.0796 16 8 16C3.58172 16 0 12.4183 0 8C0 3.92038 3.05369 0.553988 7 0.0618896Z' fill='currentColor'/><path d='M9 0.0618897V7H15.9381C15.4869 3.38128 12.6187 0.513137 9 0.0618897Z' fill='currentColor'/></svg> 指标分析\",\"value\":\"lab\",\"onClick\":\"return method.executeCustomMethod('getLibList')\",\"isSelect\":true,\"dynamicOptions\":true}]";
2929
+
2930
+
2931
+ // ❌ Invalid JSON with missing } or ]
2932
+ const errorJson001 = "{'model':'qwen-plus','base_url':'https://dashscope.aliyuncs.com/compatible-mode/v1/','api_key':'sk-0989fb9baab8450682af4d000f5b7cba','message':'{message}','stream':'true','chatId': '{chatId}', 'token': '{token}'";
2933
+
2934
+ const errorJson002 = "[{'model':'qwen-plus','base_url':'https://dashscope.aliyuncs.com/compatible-mode/v1/','api_key':'sk-0989fb9baab8450682af4d000f5b7cba','message':'{message}','stream':'true','chatId': '{chatId}', 'token': '{token}'}";
2935
+
2936
+ // ❌ Invalid JSON with missing quotes
2937
+ const errorJson003 = "{'model':'qwen-plus','base_url':'https://dashscope.aliyuncs.com/compatible-mode/v1/','api_key':'sk-0989fb9baab8450682af4d000f5b7cba','message':'{message}','stream':'true','chatId': {chatId}', 'token': '{token}'}";
2938
+
2939
+
2940
+
2941
+ console.log('okJson =>', fixAndParseJSON(okJson)); // Can parse normally success = true
2942
+ console.log('okJson =>', fixAndParseJSON(okJson2)); // Can parse normally success = true
2943
+ console.log('badJson =>', fixAndParseJSON(badJson)); // Can parse after fixing success = true
2944
+ console.log('badJson =>', fixAndParseJSON(badJson2)); // Can parse after fixing success = true
2945
+ console.log('badJson =>', fixAndParseJSON(badJson3)); // Can parse after fixing success = true
2946
+ console.log('badJson =>', fixAndParseJSON(badJson4)); // Can parse after fixing success = true
2947
+ console.log('errorJson =>', fixAndParseJSON(errorJson001)); // {success: false, error: 'Invalid JSON format', details: 'Invalid object: mismatched braces'}
2948
+ console.log('errorJson =>', fixAndParseJSON(errorJson002)); // {success: false, error: 'Invalid JSON format', details: "Expected property name or '}' in JSON at position 2 (line 1 column 3)"}
2949
+ console.log('errorJson =>', fixAndParseJSON(errorJson003)); // {success: false, error: 'Invalid JSON format', details: 'Invalid object: mismatched braces'}
2950
+
2951
+ */
2952
+
2953
+ // Type definitions
2954
+
2955
+ function fixAndParseJSON(input) {
2956
+ var MAX_DEPTH = 6;
2957
+
2958
+ // 1. Quick attempt
2959
+ try {
2960
+ return {
2961
+ success: true,
2962
+ data: JSON.parse(input)
2963
+ };
2964
+ } catch (e) {
2965
+ // Continue with fixing
2966
+ }
2967
+
2968
+ // 2. Simple unescaping of escaped \" (common case from pasted JS literals)
2969
+ var s = input;
2970
+ if (s.includes('\\"')) s = s.replace(/\\"/g, '"');
2971
+ s = s.trim();
2972
+ try {
2973
+ if (s.startsWith('{')) {
2974
+ s = processTopObject(s, 0, MAX_DEPTH);
2975
+ } else if (s.startsWith('[')) {
2976
+ s = processTopArray(s, 0, MAX_DEPTH);
2977
+ } else {
2978
+ throw new Error('Input is not an object or array');
2979
+ }
2980
+ return {
2981
+ success: true,
2982
+ data: JSON.parse(s)
2983
+ };
2984
+ } catch (err) {
2985
+ var error = err instanceof Error ? err : new Error('Unknown error');
2986
+ return {
2987
+ success: false,
2988
+ error: 'Invalid JSON format',
2989
+ details: error.message
2990
+ };
2991
+ }
2992
+ }
2993
+
2994
+ /* ---------- Helper (Recursive) Functions ---------- */
2995
+
2996
+ function processTopObject(str, depth, MAX_DEPTH) {
2997
+ if (depth > MAX_DEPTH) return str;
2998
+ str = str.trim();
2999
+
3000
+ // First check if braces match
3001
+ var braceCount = 0;
3002
+ var inString = false;
3003
+ var escapeNext = false;
3004
+ for (var i = 0; i < str.length; i++) {
3005
+ var ch = str[i];
3006
+ if (escapeNext) {
3007
+ escapeNext = false;
3008
+ continue;
3009
+ }
3010
+ if (ch === '\\') {
3011
+ escapeNext = true;
3012
+ continue;
3013
+ }
3014
+ if ((ch === '"' || ch === "'") && !escapeNext) {
3015
+ inString = !inString;
3016
+ continue;
3017
+ }
3018
+ if (!inString) {
3019
+ if (ch === '{') braceCount++;else if (ch === '}') braceCount--;
3020
+ }
3021
+ }
3022
+ if (braceCount !== 0) {
3023
+ throw new Error('Invalid object: mismatched braces');
3024
+ }
3025
+
3026
+ // Ensure both ends are { ... }
3027
+ if (!(str.startsWith('{') && str.endsWith('}'))) {
3028
+ var f = str.indexOf('{'),
3029
+ l = str.lastIndexOf('}');
3030
+ if (f === -1 || l === -1 || l <= f) {
3031
+ throw new Error('Invalid object format: missing or mismatched braces');
3032
+ }
3033
+ str = str.slice(f, l + 1);
3034
+ }
3035
+ var inner = str.slice(1, -1);
3036
+ var pairs = splitTopLevel(inner);
3037
+ var repairedPairs = pairs.map(function (pair) {
3038
+ if (!pair || pair.trim() === '') return '';
3039
+ var idx = findTopLevelColon(pair);
3040
+ if (idx === -1) {
3041
+ return pair; // Non key:value fragment, keep as is (rare case)
3042
+ }
3043
+
3044
+ var rawKey = pair.slice(0, idx).trim();
3045
+ var rawVal = pair.slice(idx + 1);
3046
+ var keyContent = extractKeyContent(rawKey);
3047
+ var keyJson = JSON.stringify(keyContent);
3048
+ var repairedValue = repairPossiblyQuotedValue(rawVal, depth + 1, MAX_DEPTH);
3049
+ return keyJson + ':' + repairedValue;
3050
+ });
3051
+ return '{' + repairedPairs.join(',') + '}';
3052
+ }
3053
+ function processTopArray(str, depth, MAX_DEPTH) {
3054
+ if (depth > MAX_DEPTH) return str;
3055
+ str = str.trim();
3056
+ if (!(str.startsWith('[') && str.endsWith(']'))) {
3057
+ var f = str.indexOf('['),
3058
+ l = str.lastIndexOf(']');
3059
+ if (f === -1 || l === -1 || l <= f) return str;
3060
+ str = str.slice(f, l + 1);
3061
+ }
3062
+ var inner = str.slice(1, -1);
3063
+ var elements = splitTopLevel(inner);
3064
+ var processed = elements.map(function (el) {
3065
+ var t = el.trim();
3066
+ if (t === '') return '';
3067
+ if (t.startsWith('{')) return processTopObject(t, depth + 1, MAX_DEPTH);
3068
+ if (t.startsWith('[')) return processTopArray(t, depth + 1, MAX_DEPTH);
3069
+ return repairPossiblyQuotedValue(t, depth + 1, MAX_DEPTH);
3070
+ });
3071
+ return '[' + processed.join(',') + ']';
3072
+ }
3073
+
3074
+ // If it's a string wrapped in quotes, extract the inner content and JSON.stringify (safe escaping)
3075
+ // If it's an object/array literal (not wrapped in quotes), recursively process (treat as new outermost layer)
3076
+ // Otherwise return the original fragment directly (numbers/true/false/null or JS expressions)
3077
+ function repairPossiblyQuotedValue(rawVal, depth, MAX_DEPTH) {
3078
+ var v = rawVal.trim();
3079
+ if (v === '') return v;
3080
+ if (v[0] === '"' || v[0] === "'") {
3081
+ var quote = v[0];
3082
+ // Find the last unescaped same quote
3083
+ var lastPos = -1;
3084
+ for (var i = v.length - 1; i >= 0; i--) {
3085
+ if (v[i] === quote) {
3086
+ // check escaped
3087
+ var bs = 0,
3088
+ k = i - 1;
3089
+ while (k >= 0 && v[k] === '\\') {
3090
+ bs++;
3091
+ k--;
3092
+ }
3093
+ if (bs % 2 === 0) {
3094
+ lastPos = i;
3095
+ break;
3096
+ }
3097
+ }
3098
+ }
3099
+ var inner = lastPos > 0 ? v.slice(1, lastPos) : v.slice(1);
3100
+ return JSON.stringify(inner); // Use JSON.stringify to generate valid JSON string (automatically escape internal quotes, etc.)
3101
+ }
3102
+
3103
+ // If it's an object or array literal (not wrapped in quotes) -> recursively treat as new outermost layer
3104
+ if (v.startsWith('{')) {
3105
+ return processTopObject(v, depth, MAX_DEPTH);
3106
+ }
3107
+ if (v.startsWith('[')) {
3108
+ return processTopArray(v, depth, MAX_DEPTH);
3109
+ }
3110
+
3111
+ // Others (numbers, boolean, null, or JS expressions): return as-is
3112
+ return v;
3113
+ }
3114
+
3115
+ /* --------- Utilities: Split by top-level commas, find top-level colon, extract key --------- */
3116
+
3117
+ // Split by top-level commas (ignore strings, sub-objects, sub-arrays, commas inside parentheses)
3118
+ function splitTopLevel(str) {
3119
+ var parts = [];
3120
+ var buf = '';
3121
+ var depthCurly = 0,
3122
+ depthSquare = 0,
3123
+ depthParen = 0;
3124
+ var inSingle = false,
3125
+ inDouble = false,
3126
+ esc = false;
3127
+ for (var i = 0; i < str.length; i++) {
3128
+ var ch = str[i];
3129
+ if (esc) {
3130
+ buf += ch;
3131
+ esc = false;
3132
+ continue;
3133
+ }
3134
+ if (ch === '\\') {
3135
+ buf += ch;
3136
+ esc = true;
3137
+ continue;
3138
+ }
3139
+ if (ch === "'" && !inDouble) {
3140
+ inSingle = !inSingle;
3141
+ buf += ch;
3142
+ continue;
3143
+ }
3144
+ if (ch === '"' && !inSingle) {
3145
+ inDouble = !inDouble;
3146
+ buf += ch;
3147
+ continue;
3148
+ }
3149
+ if (!inSingle && !inDouble) {
3150
+ if (ch === '{') {
3151
+ depthCurly++;
3152
+ buf += ch;
3153
+ continue;
3154
+ }
3155
+ if (ch === '}') {
3156
+ depthCurly--;
3157
+ buf += ch;
3158
+ continue;
3159
+ }
3160
+ if (ch === '[') {
3161
+ depthSquare++;
3162
+ buf += ch;
3163
+ continue;
3164
+ }
3165
+ if (ch === ']') {
3166
+ depthSquare--;
3167
+ buf += ch;
3168
+ continue;
3169
+ }
3170
+ if (ch === '(') {
3171
+ depthParen++;
3172
+ buf += ch;
3173
+ continue;
3174
+ }
3175
+ if (ch === ')') {
3176
+ depthParen--;
3177
+ buf += ch;
3178
+ continue;
3179
+ }
3180
+ if (ch === ',' && depthCurly === 0 && depthSquare === 0 && depthParen === 0) {
3181
+ parts.push(buf);
3182
+ buf = '';
3183
+ continue;
3184
+ }
3185
+ }
3186
+ buf += ch;
3187
+ }
3188
+
3189
+ // Check for unclosed brackets or quotes
3190
+ if (depthCurly !== 0 || depthSquare !== 0 || depthParen !== 0 || inSingle || inDouble) {
3191
+ throw new Error('Invalid JSON: unclosed brackets or quotes');
3192
+ }
3193
+ if (buf.trim() !== '') parts.push(buf);
3194
+ return parts;
3195
+ }
3196
+
3197
+ // Find the first "top-level" colon index (ignore inside strings & sub-levels)
3198
+ function findTopLevelColon(str) {
3199
+ var inSingle = false,
3200
+ inDouble = false,
3201
+ esc = false;
3202
+ var depthCurly = 0,
3203
+ depthSquare = 0,
3204
+ depthParen = 0;
3205
+ for (var i = 0; i < str.length; i++) {
3206
+ var ch = str[i];
3207
+ if (esc) {
3208
+ esc = false;
3209
+ continue;
3210
+ }
3211
+ if (ch === '\\') {
3212
+ esc = true;
3213
+ continue;
3214
+ }
3215
+ if (ch === "'" && !inDouble) {
3216
+ inSingle = !inSingle;
3217
+ continue;
3218
+ }
3219
+ if (ch === '"' && !inSingle) {
3220
+ inDouble = !inDouble;
3221
+ continue;
3222
+ }
3223
+ if (!inSingle && !inDouble) {
3224
+ if (ch === '{') {
3225
+ depthCurly++;
3226
+ continue;
3227
+ }
3228
+ if (ch === '}') {
3229
+ depthCurly--;
3230
+ continue;
3231
+ }
3232
+ if (ch === '[') {
3233
+ depthSquare++;
3234
+ continue;
3235
+ }
3236
+ if (ch === ']') {
3237
+ depthSquare--;
3238
+ continue;
3239
+ }
3240
+ if (ch === '(') {
3241
+ depthParen++;
3242
+ continue;
3243
+ }
3244
+ if (ch === ')') {
3245
+ depthParen--;
3246
+ continue;
3247
+ }
3248
+ if (ch === ':' && depthCurly === 0 && depthSquare === 0 && depthParen === 0) {
3249
+ return i;
3250
+ }
3251
+ }
3252
+ }
3253
+ return -1;
3254
+ }
3255
+
3256
+ // Extract key content (supports "key", 'key', key), returns pure key string
3257
+ function extractKeyContent(rawKey) {
3258
+ var r = rawKey.trim();
3259
+ if (r.startsWith('"') && r.endsWith('"') || r.startsWith("'") && r.endsWith("'")) {
3260
+ var inner = r.slice(1, -1).replace(/\\"/g, '"').replace(/\\'/g, "'");
3261
+ return inner;
3262
+ }
3263
+ return r;
3264
+ }
3265
+
3266
+ /**
3267
+ * Determine whether it is in JSON format
3268
+ * @private
3269
+ */
3270
+ function _isJSON(input) {
3271
+ if (typeof input === 'string' && input.length > 0) {
3272
+ return fixAndParseJSON(input).success;
3273
+ } else {
3274
+ if (_typeof(input) === 'object' && Object.prototype.toString.call(input) === '[object Object]' && !input.length) {
3275
+ return true;
3276
+ } else {
3277
+ return false;
3278
+ }
3279
+ }
3280
+ }
3281
+
3282
+ /**
3283
+ * Check if a string is a valid number
3284
+ * @param str - The string to check
3285
+ * @returns boolean indicating if the string is a valid number
3286
+ */
3287
+ function _isValidNumeric(str) {
3288
+ if (typeof str !== "string") return false; // we only process strings!
3289
+ if (!isNaN(Number(str)) &&
3290
+ // use type coercion to parse the _entirety_ of the string
3291
+ !isNaN(parseFloat(str)) // ensure strings of whitespace fail
3292
+ ) {
3293
+ return true;
3294
+ }
3295
+ return false;
3296
+ }
3297
+
3298
+ /**
3299
+ * Check if input is empty
3300
+ * @param input - The input to check (string or array of strings)
3301
+ * @returns boolean indicating if the input is empty
3302
+ */
3303
+ function _isEmpty(input) {
3304
+ if (Array.isArray(input)) {
3305
+ return input.some(function (str) {
3306
+ return !str.replace(/\s/g, '').length === true;
3307
+ });
3308
+ }
3309
+ return !input.replace(/\s/g, '').length === true;
3310
+ }
3311
+
3312
+ /**
3313
+ * Check if input is a valid number
3314
+ * @param input - The input to check
3315
+ * @returns boolean indicating if the input is a valid number
3316
+ */
3317
+ function _isNumber(input) {
3318
+ var reg = /^[\d|\.|,]+$/;
3319
+ return reg.test(input);
3320
+ }
3321
+
3322
+ /**
3323
+ * Check if input is a valid integer
3324
+ * @param input - The input to check
3325
+ * @returns boolean indicating if the input is a valid integer
3326
+ */
3327
+ function _isInt(input) {
3328
+ if (input === "") {
3329
+ return false;
3330
+ }
3331
+ var reg = /\D+/;
3332
+ return !reg.test(input);
3333
+ }
3334
+
3335
+ /**
3336
+ * Check if input is a valid email address
3337
+ * @param input - The input to check
3338
+ * @returns boolean indicating if the input is a valid email
3339
+ */
3340
+ function _isEmail(input) {
3341
+ var reg = /^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/;
3342
+ return reg.test(input);
3343
+ }
3344
+
3345
+ /**
3346
+ * Check if input is a valid telephone number
3347
+ * @param input - The input to check
3348
+ * @returns boolean indicating if the input is a valid telephone number
3349
+ */
3350
+ function _isTel(input) {
3351
+ var reg = /^[0-9- ]{7,20}$/;
3352
+ return reg.test(input);
3353
+ }
3354
+
3355
+ /**
3356
+ * Check if input is a valid mobile number
3357
+ * @param input - The input to check
3358
+ * @returns boolean indicating if the input is a valid mobile number
3359
+ */
3360
+ function _isMobile(input) {
3361
+ var reg = /^1[0-9]{10}$/;
3362
+ return reg.test(input);
3363
+ }
3364
+
3365
+ /******/
3366
+ return __webpack_exports__;
3367
+ /******/
3368
+ }()
3369
+ );
3370
+ });
3371
+
3372
+ /***/ }),
3373
+
3374
+ /***/ 787:
3375
+ /***/ ((module) => {
3376
+
3377
+ "use strict";
3378
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
3379
+
3380
+ /***/ })
3381
+
3382
+ /******/ });
3383
+ /************************************************************************/
3384
+ /******/ // The module cache
3385
+ /******/ var __webpack_module_cache__ = {};
3386
+ /******/
3387
+ /******/ // The require function
3388
+ /******/ function __webpack_require__(moduleId) {
3389
+ /******/ // Check if module is in cache
3390
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
3391
+ /******/ if (cachedModule !== undefined) {
3392
+ /******/ return cachedModule.exports;
3393
+ /******/ }
3394
+ /******/ // Create a new module (and put it into the cache)
3395
+ /******/ var module = __webpack_module_cache__[moduleId] = {
3396
+ /******/ id: moduleId,
3397
+ /******/ loaded: false,
3398
+ /******/ exports: {}
3399
+ /******/ };
3400
+ /******/
3401
+ /******/ // Execute the module function
3402
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
3403
+ /******/
3404
+ /******/ // Flag the module as loaded
3405
+ /******/ module.loaded = true;
3406
+ /******/
3407
+ /******/ // Return the exports of the module
3408
+ /******/ return module.exports;
3409
+ /******/ }
3410
+ /******/
3411
+ /************************************************************************/
3412
+ /******/ /* webpack/runtime/compat get default export */
3413
+ /******/ (() => {
3414
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
3415
+ /******/ __webpack_require__.n = (module) => {
3416
+ /******/ var getter = module && module.__esModule ?
3417
+ /******/ () => (module['default']) :
3418
+ /******/ () => (module);
3419
+ /******/ __webpack_require__.d(getter, { a: getter });
3420
+ /******/ return getter;
3421
+ /******/ };
3422
+ /******/ })();
3423
+ /******/
3424
+ /******/ /* webpack/runtime/define property getters */
3425
+ /******/ (() => {
3426
+ /******/ // define getter functions for harmony exports
3427
+ /******/ __webpack_require__.d = (exports, definition) => {
3428
+ /******/ for(var key in definition) {
3429
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3430
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3431
+ /******/ }
3432
+ /******/ }
3433
+ /******/ };
3434
+ /******/ })();
3435
+ /******/
3436
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
3437
+ /******/ (() => {
3438
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3439
+ /******/ })();
3440
+ /******/
3441
+ /******/ /* webpack/runtime/make namespace object */
3442
+ /******/ (() => {
3443
+ /******/ // define __esModule on exports
3444
+ /******/ __webpack_require__.r = (exports) => {
3445
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3446
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3447
+ /******/ }
3448
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
3449
+ /******/ };
3450
+ /******/ })();
3451
+ /******/
3452
+ /******/ /* webpack/runtime/node module decorator */
3453
+ /******/ (() => {
3454
+ /******/ __webpack_require__.nmd = (module) => {
3455
+ /******/ module.paths = [];
3456
+ /******/ if (!module.children) module.children = [];
3457
+ /******/ return module;
3458
+ /******/ };
3459
+ /******/ })();
3460
+ /******/
3461
+ /************************************************************************/
3462
+ var __webpack_exports__ = {};
3463
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
3464
+ (() => {
3465
+ "use strict";
3466
+ // ESM COMPAT FLAG
3467
+ __webpack_require__.r(__webpack_exports__);
3468
+
3469
+ // EXPORTS
3470
+ __webpack_require__.d(__webpack_exports__, {
3471
+ "default": () => (/* binding */ src)
3472
+ });
3473
+
3474
+ // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
3475
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
3476
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
3477
+ // EXTERNAL MODULE: ../DragDropList/dist/cjs/index.js
3478
+ var cjs = __webpack_require__(954);
3479
+ var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
3480
+ // EXTERNAL MODULE: ../Utils/dist/cjs/useComId.js
3481
+ var useComId = __webpack_require__(85);
3482
+ var useComId_default = /*#__PURE__*/__webpack_require__.n(useComId);
3483
+ // EXTERNAL MODULE: ../Utils/dist/cjs/validate.js
3484
+ var validate = __webpack_require__(455);
3485
+ // EXTERNAL MODULE: ../Utils/dist/cjs/extract.js
3486
+ var extract = __webpack_require__(135);
3487
+ // EXTERNAL MODULE: ../Utils/dist/cjs/convert.js
3488
+ var convert = __webpack_require__(79);
3489
+ // EXTERNAL MODULE: ../Utils/dist/cjs/object.js
3490
+ var object = __webpack_require__(575);
3491
+ // EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
3492
+ var cls = __webpack_require__(188);
3493
+ ;// CONCATENATED MODULE: ./src/utils/func.ts
3494
+ /**
3495
+ * Format indent value
3496
+ * @param {String|Array} inputData
3497
+ * @param {String} placeholder
3498
+ * @returns {String|Array}
3499
+ */
3500
+ function formatIndentVal(inputData, placeholder) {
3501
+ var reVar = new RegExp(placeholder, 'g');
3502
+ if (Array.isArray(inputData)) {
3503
+ return inputData.map(function (s) {
3504
+ return String(s).replace(reVar, '').replace(/\&nbsp;/ig, '');
3505
+ });
3506
+ } else {
3507
+ if (inputData === null) return '';
3508
+ var _txt = typeof inputData === 'string' ? inputData : inputData.toString();
3509
+ return _txt.replace(reVar, '').replace(/\&nbsp;/ig, '');
3510
+ }
3511
+ }
3512
+
3513
+ /**
3514
+ * Determine whether the option exists
3515
+ * @param val
3516
+ * @returns
3517
+ */
3518
+ function multiSelControlOptionExist(arr, val) {
3519
+ var _data = arr.filter(Boolean);
3520
+ return _data.map(function (v) {
3521
+ return v.toString();
3522
+ }).includes(val.toString());
3523
+ }
3524
+
3525
+ /**
3526
+ * Remove Duplicate objects from JSON Array
3527
+ * @param {Array} arr
3528
+ * @returns
3529
+ */
3530
+ function uniqueArr(arr) {
3531
+ return arr.filter(function (item, index, self) {
3532
+ return index === self.findIndex(function (t) {
3533
+ return t.id == item.id;
3534
+ });
3535
+ });
3536
+ }
3537
+
3538
+ /**
3539
+ * Remove Duplicate objects from Options
3540
+ * @param {Array} arr
3541
+ * @returns
3542
+ */
3543
+ function uniqueOpt(arr) {
3544
+ return arr.flat().filter(function (item, index, self) {
3545
+ return index === self.findIndex(function (t) {
3546
+ return t.id === item.id;
3547
+ });
3548
+ });
3549
+ }
3550
+
3551
+ /**
3552
+ * Sort JSON arrays according to the order of the numeric arrays
3553
+ * @param {Array<Number>|Array<String>} orderArray
3554
+ * @param {Array<*>} arr
3555
+ * @param {String} field
3556
+ * @returns
3557
+ */
3558
+ function sortedJsonArray(orderArray, arr) {
3559
+ var field = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'value';
3560
+ return orderArray.map(function (orderId) {
3561
+ return arr.find(function (item) {
3562
+ return item[field] === orderId;
3563
+ });
3564
+ });
3565
+ }
3566
+ ;// CONCATENATED MODULE: ./src/index.tsx
3567
+ var _excluded = ["contentRef", "wrapperClassName", "childClassName", "wrapperMinHeight", "wrapperMinWidth", "availableHeaderTitle", "selectedHeaderTitle", "selectedHeaderNote", "selectedResultReverse", "removeAllBtnLabel", "addAllBtnLabel", "iconAdd", "iconRemove", "unattachedSelect", "options", "disabled", "required", "defaultValue", "value", "label", "name", "id", "draggable", "handleHide", "handleIcon", "handlePos", "dragMode", "indentation", "doubleIndent", "alternateCollapse", "arrow", "extractValueByBrackets", "style", "data", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onFetch", "onAddAll", "onRemoveAll", "onChange"];
3568
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3569
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3570
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3571
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3572
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3573
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
3574
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
3575
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3576
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3577
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3578
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3579
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3580
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3581
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3582
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3583
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3584
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
3585
+
3586
+
3587
+
3588
+
3589
+
3590
+
3591
+
3592
+
3593
+
3594
+ var MultipleSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, externalRef) {
3595
+ var contentRef = props.contentRef,
3596
+ wrapperClassName = props.wrapperClassName,
3597
+ childClassName = props.childClassName,
3598
+ wrapperMinHeight = props.wrapperMinHeight,
3599
+ wrapperMinWidth = props.wrapperMinWidth,
3600
+ availableHeaderTitle = props.availableHeaderTitle,
3601
+ selectedHeaderTitle = props.selectedHeaderTitle,
3602
+ selectedHeaderNote = props.selectedHeaderNote,
3603
+ _props$selectedResult = props.selectedResultReverse,
3604
+ selectedResultReverse = _props$selectedResult === void 0 ? false : _props$selectedResult,
3605
+ removeAllBtnLabel = props.removeAllBtnLabel,
3606
+ addAllBtnLabel = props.addAllBtnLabel,
3607
+ iconAdd = props.iconAdd,
3608
+ iconRemove = props.iconRemove,
3609
+ unattachedSelect = props.unattachedSelect,
3610
+ options = props.options,
3611
+ disabled = props.disabled,
3612
+ required = props.required,
3613
+ defaultValue = props.defaultValue,
3614
+ value = props.value,
3615
+ label = props.label,
3616
+ name = props.name,
3617
+ id = props.id,
3618
+ _props$draggable = props.draggable,
3619
+ draggable = _props$draggable === void 0 ? true : _props$draggable,
3620
+ _props$handleHide = props.handleHide,
3621
+ handleHide = _props$handleHide === void 0 ? false : _props$handleHide,
3622
+ _props$handleIcon = props.handleIcon,
3623
+ handleIcon = _props$handleIcon === void 0 ? '☰' : _props$handleIcon,
3624
+ _props$handlePos = props.handlePos,
3625
+ handlePos = _props$handlePos === void 0 ? 'left' : _props$handlePos,
3626
+ _props$dragMode = props.dragMode,
3627
+ dragMode = _props$dragMode === void 0 ? 'handle' : _props$dragMode,
3628
+ indentation = props.indentation,
3629
+ doubleIndent = props.doubleIndent,
3630
+ alternateCollapse = props.alternateCollapse,
3631
+ _props$arrow = props.arrow,
3632
+ arrow = _props$arrow === void 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3633
+ viewBox: "0 0 22 22",
3634
+ width: "8px"
3635
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3636
+ d: "m345.44 248.29l-194.29 194.28c-12.359 12.365-32.397 12.365-44.75 0-12.354-12.354-12.354-32.391 0-44.744l171.91-171.91-171.91-171.9c-12.354-12.359-12.354-32.394 0-44.748 12.354-12.359 32.391-12.359 44.75 0l194.29 194.28c6.177 6.18 9.262 14.271 9.262 22.366 0 8.099-3.091 16.196-9.267 22.373",
3637
+ transform: "matrix(.03541-.00013.00013.03541 2.98 3.02)",
3638
+ fill: "#a5a5a5"
3639
+ }))) : _props$arrow,
3640
+ extractValueByBrackets = props.extractValueByBrackets,
3641
+ style = props.style,
3642
+ data = props.data,
3643
+ fetchFuncAsync = props.fetchFuncAsync,
3644
+ fetchFuncMethod = props.fetchFuncMethod,
3645
+ fetchFuncMethodParams = props.fetchFuncMethodParams,
3646
+ fetchCallback = props.fetchCallback,
3647
+ onFetch = props.onFetch,
3648
+ onAddAll = props.onAddAll,
3649
+ onRemoveAll = props.onRemoveAll,
3650
+ onChange = props.onChange,
3651
+ attributes = _objectWithoutProperties(props, _excluded);
3652
+ var UNATTACHED_SELECT = typeof unattachedSelect === 'undefined' || unattachedSelect === false ? false : true;
3653
+ var WRAPPER_MIN_H = typeof wrapperMinHeight === 'undefined' ? '' : wrapperMinHeight;
3654
+ var WRAPPER_MIN_W = typeof wrapperMinWidth === 'undefined' ? '' : wrapperMinWidth;
3655
+ var VALUE_BY_BRACKETS = typeof extractValueByBrackets === 'undefined' ? true : extractValueByBrackets;
3656
+ var uniqueID = useComId_default()();
3657
+ var idRes = id || uniqueID;
3658
+ var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3659
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3660
+ var availableListRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3661
+ var optionsRes = options ? (0,validate.isJSON)(options) ? JSON.parse(options) : options : [];
3662
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
3663
+ _useState2 = _slicedToArray(_useState, 2),
3664
+ valSelectedData = _useState2[0],
3665
+ setValSelectedData = _useState2[1];
3666
+ var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
3667
+ _useState4 = _slicedToArray(_useState3, 2),
3668
+ valSelected = _useState4[0],
3669
+ setValSelected = _useState4[1];
3670
+
3671
+ // temp default value
3672
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(undefined),
3673
+ _useState6 = _slicedToArray(_useState5, 2),
3674
+ tempDefaultValue = _useState6[0],
3675
+ setTempDefaultValue = _useState6[1];
3676
+
3677
+ // return a array of options
3678
+ var optionsDataInit = optionsRes;
3679
+
3680
+ //
3681
+ var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
3682
+ _useState8 = _slicedToArray(_useState7, 2),
3683
+ changedSearchVal = _useState8[0],
3684
+ setChangedSearchVal = _useState8[1];
3685
+
3686
+ //
3687
+ var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(optionsDataInit),
3688
+ _useState10 = _slicedToArray(_useState9, 2),
3689
+ dataInit = _useState10[0],
3690
+ setDataInit = _useState10[1];
3691
+ var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3692
+ _useState12 = _slicedToArray(_useState11, 2),
3693
+ hasErr = _useState12[0],
3694
+ setHasErr = _useState12[1];
3695
+
3696
+ // exposes the following methods
3697
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(contentRef, function () {
3698
+ return {
3699
+ clear: function clear(cb) {
3700
+ var _params = fetchFuncMethodParams || [];
3701
+ fetchData(_params.join(','), '');
3702
+ cb === null || cb === void 0 ? void 0 : cb();
3703
+ },
3704
+ set: function set(inputData, cb) {
3705
+ if (!Array.isArray(inputData)) return;
3706
+ var _params = fetchFuncMethodParams || [];
3707
+ fetchData(_params.join(','), inputData.map(function (v) {
3708
+ return "[".concat(v.value, "]");
3709
+ }).join(''));
3710
+ cb === null || cb === void 0 ? void 0 : cb();
3711
+ }
3712
+ };
3713
+ }, [contentRef]);
3714
+ var getExtControll = function getExtControll(index, id, value, extendedContent, defaultValue) {
3715
+ var forceItemSelected = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;
3716
+ var itemSelected = false;
3717
+ if (typeof defaultValue !== 'undefined' && defaultValue !== '') {
3718
+ var _val = VALUE_BY_BRACKETS ? (0,extract.extractContentsOfBrackets)(defaultValue) : defaultValue.trim().replace(/^\,|\,$/g, '').split(',');
3719
+ if (Array.isArray(_val) && _val.includes(String(value))) {
3720
+ itemSelected = true;
3721
+ }
3722
+ }
3723
+ if (typeof forceItemSelected !== 'undefined') itemSelected = forceItemSelected;
3724
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3725
+ style: {
3726
+ paddingLeft: '1rem',
3727
+ width: '100%',
3728
+ display: 'flex',
3729
+ alignItems: 'center',
3730
+ justifyContent: 'end'
3731
+ }
3732
+ }, extendedContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3733
+ className: "m-select-v2__ext",
3734
+ id: "m-select-v2__ext-".concat(id).concat(itemSelected ? '-selected' : '')
3735
+ }, extendedContent)) : null, itemSelected ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
3736
+ href: "#",
3737
+ onClick: function onClick(e) {
3738
+ e.preventDefault();
3739
+ e.stopPropagation();
3740
+
3741
+ // remove
3742
+ removeItem(id);
3743
+ }
3744
+ }, iconRemove ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, iconRemove) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3745
+ width: "15px",
3746
+ height: "15px",
3747
+ viewBox: "0 0 24 24",
3748
+ fill: "none"
3749
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3750
+ fillRule: "evenodd",
3751
+ clipRule: "evenodd",
3752
+ d: "M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10ZM8 11a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Z",
3753
+ fill: "#000"
3754
+ }))))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
3755
+ href: "#",
3756
+ onClick: function onClick(e) {
3757
+ e.preventDefault();
3758
+ e.stopPropagation();
3759
+
3760
+ // add
3761
+ selectItem(id);
3762
+ }
3763
+ }, iconAdd ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, iconAdd) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3764
+ width: "15px",
3765
+ height: "15px",
3766
+ viewBox: "0 0 24 24",
3767
+ fill: "none"
3768
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3769
+ d: "M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16 12.75H12.75V16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16V12.75H8C7.59 12.75 7.25 12.41 7.25 12C7.25 11.59 7.59 11.25 8 11.25H11.25V8C11.25 7.59 11.59 7.25 12 7.25C12.41 7.25 12.75 7.59 12.75 8V11.25H16C16.41 11.25 16.75 11.59 16.75 12C16.75 12.41 16.41 12.75 16 12.75Z",
3770
+ fill: "#000"
3771
+ })))))));
3772
+ };
3773
+ var dragdropListDataInit = function dragdropListDataInit(data) {
3774
+ // Add appendControl to list
3775
+ data.forEach(function (item, index) {
3776
+ var _extendedContent = typeof item.extendedContent === 'function' ? item.extendedContent(true) : item.extendedContent;
3777
+ item.appendControl = getExtControll(index, item.id, item.value, _extendedContent, tempDefaultValue);
3778
+ });
3779
+ return data;
3780
+ };
3781
+ var dragdropListDefaultDataInit = function dragdropListDefaultDataInit(data) {
3782
+ // Update appendControl to list
3783
+ data.forEach(function (item, index) {
3784
+ var _extendedContent = typeof item.extendedContent === 'function' ? item.extendedContent(false) : item.extendedContent;
3785
+ item.appendControl = getExtControll(index, item.id, item.value, item.extendedContent, tempDefaultValue, false);
3786
+ });
3787
+ return data;
3788
+ };
3789
+ function fetchData(_x2, _x3) {
3790
+ return _fetchData.apply(this, arguments);
3791
+ }
3792
+ function _fetchData() {
3793
+ _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, inputDefault) {
3794
+ var response, _ORGIN_DATA;
3795
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3796
+ while (1) switch (_context.prev = _context.next) {
3797
+ case 0:
3798
+ // set default value
3799
+ if (typeof inputDefault !== 'undefined' && inputDefault !== '') inputRef.current.dataset.value = inputDefault;
3800
+
3801
+ //
3802
+ if (!(_typeof(fetchFuncAsync) === 'object')) {
3803
+ _context.next = 16;
3804
+ break;
3805
+ }
3806
+ _context.next = 4;
3807
+ return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')));
3808
+ case 4:
3809
+ response = _context.sent;
3810
+ _ORGIN_DATA = response.data; // reset data structure
3811
+ if (typeof fetchCallback === 'function') {
3812
+ _ORGIN_DATA = fetchCallback(_ORGIN_DATA);
3813
+ }
3814
+
3815
+ // Determine whether the data structure matches
3816
+ if (_ORGIN_DATA.length > 0 && typeof _ORGIN_DATA[0].value === 'undefined') {
3817
+ console.warn('The data structure does not match, please refer to the example in the component documentation.');
3818
+ setHasErr(true);
3819
+ _ORGIN_DATA = [];
3820
+ }
3821
+
3822
+ // remove Duplicate objects from JSON Array
3823
+ _ORGIN_DATA = (0,object.removeArrDuplicateItems)(_ORGIN_DATA, 'value');
3824
+
3825
+ // save temporary default value
3826
+ setTempDefaultValue(inputDefault);
3827
+
3828
+ //
3829
+ setDataInit(_ORGIN_DATA); // data must be initialized
3830
+
3831
+ //
3832
+ initDefaultValue(inputDefault, _ORGIN_DATA); // value must be initialized
3833
+
3834
+ //
3835
+ onFetch === null || onFetch === void 0 ? void 0 : onFetch(_ORGIN_DATA);
3836
+ return _context.abrupt("return", _ORGIN_DATA);
3837
+ case 16:
3838
+ // remove Duplicate objects from JSON Array
3839
+ optionsDataInit = (0,object.removeArrDuplicateItems)(optionsDataInit, 'value');
3840
+
3841
+ // save temporary default value
3842
+ setTempDefaultValue(inputDefault);
3843
+
3844
+ //
3845
+ setDataInit(optionsDataInit); // data must be initialized
3846
+
3847
+ //
3848
+ initDefaultValue(inputDefault, optionsDataInit); // value must be initialized
3849
+
3850
+ //
3851
+ onFetch === null || onFetch === void 0 ? void 0 : onFetch(optionsDataInit);
3852
+ return _context.abrupt("return", optionsDataInit);
3853
+ case 22:
3854
+ case "end":
3855
+ return _context.stop();
3856
+ }
3857
+ }, _callee);
3858
+ }));
3859
+ return _fetchData.apply(this, arguments);
3860
+ }
3861
+ function initDefaultValue(defaultValue, options) {
3862
+ // change the value to trigger component rendering
3863
+ if (typeof defaultValue === 'undefined' || defaultValue === '') {
3864
+ setValSelected([]);
3865
+ setValSelectedData([]);
3866
+ } else {
3867
+ var _val = VALUE_BY_BRACKETS ? (0,extract.extractContentsOfBrackets)(defaultValue) : defaultValue.trim().replace(/^\,|\,$/g, '').split(',');
3868
+ if (Array.isArray(_val)) {
3869
+ var _initVal = _val.filter(function (v) {
3870
+ return v !== '';
3871
+ });
3872
+ setValSelected(_initVal);
3873
+
3874
+ // Initialize selected options
3875
+ if (UNATTACHED_SELECT) {
3876
+ setValSelectedData(function (prevState) {
3877
+ var _data = [].concat(_toConsumableArray(prevState), _toConsumableArray(options.filter(function (item) {
3878
+ return multiSelControlOptionExist(_initVal, item.value);
3879
+ })));
3880
+ return uniqueArr(_data);
3881
+ });
3882
+ } else {
3883
+ setValSelectedData(options.filter(function (item) {
3884
+ return multiSelControlOptionExist(_initVal, item.value);
3885
+ }));
3886
+ }
3887
+
3888
+ // Initialize default options
3889
+ setDataInit(options.filter(function (item) {
3890
+ return !multiSelControlOptionExist(_initVal, item.value);
3891
+ }));
3892
+ } else {
3893
+ setValSelected([]);
3894
+ setValSelectedData([]);
3895
+ }
3896
+ }
3897
+ }
3898
+ function selectItem(curId) {
3899
+ // update default options
3900
+ setDataInit(function (prevState) {
3901
+ var newDefaultData = prevState.filter(function (item) {
3902
+ return item.id != curId;
3903
+ });
3904
+ var targetData = prevState.find(function (v) {
3905
+ return v.id == curId;
3906
+ }); // !!!from old "dataInit"
3907
+ var _data = typeof targetData !== 'undefined' ? targetData : {};
3908
+
3909
+ // update selected data
3910
+ setValSelectedData(function (prevState2) {
3911
+ var newSelectedData = dragdropListDataInit([].concat(_toConsumableArray(prevState2), [_data]));
3912
+
3913
+ // update selected items
3914
+ setValSelected(function (prevState3) {
3915
+ var newValueData = newSelectedData.map(function (v) {
3916
+ return v.value;
3917
+ });
3918
+ var newValueStr = VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(newValueData) : newValueData.join(',');
3919
+ onChange === null || onChange === void 0 ? void 0 : onChange(document.querySelector("[data-id=\"".concat(curId, "\"]")), newValueData, newValueStr, _data, 'add', newSelectedData);
3920
+
3921
+ // update temporary default value
3922
+ setTempDefaultValue(newValueStr);
3923
+ return newValueData;
3924
+ });
3925
+ return uniqueArr(newSelectedData);
3926
+ });
3927
+ return uniqueArr(newDefaultData);
3928
+ });
3929
+ }
3930
+ function removeItem(curId) {
3931
+ // update selected data
3932
+ setValSelectedData(function (prevState) {
3933
+ var newSelectedData = prevState.filter(function (item) {
3934
+ return item.id != curId;
3935
+ });
3936
+ var targetData = prevState.find(function (v) {
3937
+ return v.id == curId;
3938
+ }); // !!!from old "valSelectedData"
3939
+ var _data = typeof targetData !== 'undefined' ? targetData : {};
3940
+
3941
+ // update default options
3942
+ setDataInit(function (prevState2) {
3943
+ var newDefaultData = dragdropListDefaultDataInit([].concat(_toConsumableArray(prevState2), [_data]));
3944
+ return uniqueArr(newDefaultData);
3945
+ });
3946
+
3947
+ // update selected items
3948
+ setValSelected(function (prevState3) {
3949
+ var newValueData = newSelectedData.map(function (v) {
3950
+ return v.value;
3951
+ });
3952
+ var newValueStr = VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(newValueData) : newValueData.join(',');
3953
+ onChange === null || onChange === void 0 ? void 0 : onChange(document.querySelector("[data-id=\"".concat(curId, "\"]")), newValueData, newValueStr, _data, 'remove', newSelectedData);
3954
+
3955
+ // update temporary default value
3956
+ setTempDefaultValue(newValueStr);
3957
+ return newValueData;
3958
+ });
3959
+ return uniqueArr(newSelectedData);
3960
+ });
3961
+ }
3962
+ function handleSelectAll(event) {
3963
+ event.preventDefault();
3964
+ event.stopPropagation();
3965
+
3966
+ // update default options
3967
+ setDataInit(function (prevState) {
3968
+ var newDefaultData = [];
3969
+
3970
+ // filter the "disabled" option
3971
+ var disabledData = prevState.filter(function (v) {
3972
+ return v.disabled === true;
3973
+ }); // !!!from old "dataInit"
3974
+ var targetData = prevState.filter(function (v) {
3975
+ return typeof v.disabled === 'undefined' || v.disabled === false;
3976
+ }); // !!!from old "dataInit"
3977
+
3978
+ // update selected data
3979
+ setValSelectedData(function (prevState2) {
3980
+ var newSelectedData = dragdropListDataInit([].concat(_toConsumableArray(prevState2), _toConsumableArray(targetData)));
3981
+
3982
+ // update selected items
3983
+ setValSelected(function (prevState3) {
3984
+ var newValueData = newSelectedData.map(function (v) {
3985
+ return v.value;
3986
+ });
3987
+ var newValueStr = VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(newValueData) : newValueData.join(',');
3988
+ onChange === null || onChange === void 0 ? void 0 : onChange(null, newValueData, newValueStr, null, 'add-all', newSelectedData);
3989
+
3990
+ // update temporary default value
3991
+ setTempDefaultValue(newValueStr);
3992
+ return newValueData;
3993
+ });
3994
+ return uniqueArr(newSelectedData);
3995
+ });
3996
+ return uniqueArr([].concat(newDefaultData, _toConsumableArray(disabledData)));
3997
+ });
3998
+ }
3999
+ function handleRemoveAll(event) {
4000
+ event.preventDefault();
4001
+ event.stopPropagation();
4002
+
4003
+ // update selected data
4004
+ setValSelectedData(function (prevState) {
4005
+ var newSelectedData = [];
4006
+ var targetData = prevState; // !!!from old "valSelectedData"
4007
+
4008
+ // update default options
4009
+ setDataInit(function (prevState2) {
4010
+ var newDefaultData = dragdropListDefaultDataInit([].concat(_toConsumableArray(prevState2), _toConsumableArray(targetData)));
4011
+ return uniqueArr(newDefaultData);
4012
+ });
4013
+
4014
+ // update selected items
4015
+ setValSelected(function (prevState3) {
4016
+ var newValueData = newSelectedData.map(function (v) {
4017
+ return v.value;
4018
+ });
4019
+ var newValueStr = VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(newValueData) : newValueData.join(',');
4020
+ onChange === null || onChange === void 0 ? void 0 : onChange(null, newValueData, newValueStr, null, 'remove-all', newSelectedData);
4021
+ onRemoveAll === null || onRemoveAll === void 0 ? void 0 : onRemoveAll(event, newValueData, newValueStr, newSelectedData);
4022
+
4023
+ // update temporary default value
4024
+ setTempDefaultValue(newValueStr);
4025
+ return newValueData;
4026
+ });
4027
+ return uniqueArr(newSelectedData);
4028
+ });
4029
+ }
4030
+ function handleChangeSearch(event) {
4031
+ var inputVal = event.target.value;
4032
+ if (availableListRef.current === null) return;
4033
+ setChangedSearchVal(inputVal);
4034
+ var items = [].slice.call(availableListRef.current.querySelectorAll('li[data-value]'));
4035
+ items.forEach(function (item) {
4036
+ // Avoid fatal errors causing page crashes
4037
+ var _label = typeof item.dataset.label !== 'undefined' && item.dataset.label !== null ? item.dataset.label : '';
4038
+ var _queryString = typeof item.dataset.querystring !== 'undefined' && item.dataset.querystring !== null ? item.dataset.querystring : '';
4039
+ if ((_queryString.split(',').some(function (l) {
4040
+ return l.charAt(0) === inputVal.toLowerCase();
4041
+ }) || _queryString.split(',').some(function (l) {
4042
+ return l.replace(/ /g, '').indexOf(inputVal.toLowerCase()) >= 0;
4043
+ }) || _label.toLowerCase().indexOf(inputVal.toLowerCase()) >= 0) && inputVal != '') {
4044
+ item.classList.remove('hide');
4045
+ } else {
4046
+ item.classList.add('hide');
4047
+ }
4048
+ });
4049
+ items.forEach(function (item) {
4050
+ if (inputVal === '') {
4051
+ item.classList.remove('hide');
4052
+ }
4053
+ });
4054
+ }
4055
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
4056
+ // data init
4057
+ //--------------
4058
+ var _params = fetchFuncMethodParams || [];
4059
+ fetchData(_params.join(','), value);
4060
+ }, [value, options, data]);
4061
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
4062
+ // update default value (It does not re-render the component because the incoming value changes.)
4063
+ //--------------
4064
+ if (typeof defaultValue !== 'undefined') {
4065
+ //REQUIRED
4066
+ var _params = fetchFuncMethodParams || [];
4067
+ fetchData(_params.join(','), defaultValue);
4068
+ }
4069
+ }, []);
4070
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4071
+ className: (0,cls.combinedCls)('m-select-v2__wrapper', (0,cls.clsWrite)(wrapperClassName, 'mb-3')),
4072
+ ref: rootRef,
4073
+ style: {
4074
+ minWidth: WRAPPER_MIN_W === '' ? 'var(--m-select-v2-wrapper-min-w)' : WRAPPER_MIN_W,
4075
+ minHeight: WRAPPER_MIN_H === '' ? 'var(--m-select-v2-wrapper-min-h)' : WRAPPER_MIN_H
4076
+ }
4077
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4078
+ className: "m-select-v2-diving-line"
4079
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
4080
+ ref: function ref(node) {
4081
+ inputRef.current = node;
4082
+ if (typeof externalRef === 'function') {
4083
+ externalRef(node);
4084
+ } else if (externalRef) {
4085
+ externalRef.current = node;
4086
+ }
4087
+ },
4088
+ tabIndex: -1,
4089
+ type: "hidden",
4090
+ id: idRes,
4091
+ name: name,
4092
+ value: VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(valSelected) : valSelected.join(',') // do not use `defaultValue`
4093
+ ,
4094
+ onChange: function onChange() {
4095
+ return void 0;
4096
+ },
4097
+ required: required || null
4098
+ }, attributes)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4099
+ className: "m-select-v2-inner"
4100
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4101
+ className: "m-select-v2__available__container"
4102
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4103
+ className: "m-select-v2__m-select-v2__item-actions m-select-v2__header"
4104
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4105
+ className: "m-select-v2__search__container"
4106
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
4107
+ type: "text",
4108
+ value: changedSearchVal,
4109
+ className: "m-select-v2__search",
4110
+ onChange: handleChangeSearch
4111
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
4112
+ width: "0.8em",
4113
+ height: "0.8em",
4114
+ fill: "#ddd",
4115
+ viewBox: "0 0 16 16"
4116
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
4117
+ d: "M12.027 9.92L16 13.95 14 16l-4.075-3.976A6.465 6.465 0 0 1 6.5 13C2.91 13 0 10.083 0 6.5 0 2.91 2.917 0 6.5 0 10.09 0 13 2.917 13 6.5a6.463 6.463 0 0 1-.973 3.42zM1.997 6.452c0 2.48 2.014 4.5 4.5 4.5 2.48 0 4.5-2.015 4.5-4.5 0-2.48-2.015-4.5-4.5-4.5-2.48 0-4.5 2.014-4.5 4.5z",
4118
+ fillRule: "evenodd"
4119
+ })))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
4120
+ className: "m-select-v2__title",
4121
+ dangerouslySetInnerHTML: {
4122
+ __html: "".concat(availableHeaderTitle || '')
4123
+ }
4124
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
4125
+ href: "#",
4126
+ className: "m-select-v2__btn--add-all",
4127
+ onClick: handleSelectAll
4128
+ }, addAllBtnLabel || 'Add all')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
4129
+ data: dragdropListDefaultDataInit(dataInit),
4130
+ wrapperClassName: "",
4131
+ ref: availableListRef,
4132
+ prefix: "m-select-v2",
4133
+ draggable: false,
4134
+ handleHide: handleHide,
4135
+ handleIcon: handleIcon,
4136
+ handlePos: handlePos,
4137
+ dragMode: dragMode,
4138
+ indentation: indentation,
4139
+ doubleIndent: doubleIndent,
4140
+ alternateCollapse: alternateCollapse,
4141
+ arrow: arrow
4142
+ })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4143
+ className: "m-select-v2__selected__container"
4144
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
4145
+ className: "m-select-v2__m-select-v2__item-actions m-select-v2__header"
4146
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
4147
+ className: "m-select-v2__count",
4148
+ dangerouslySetInnerHTML: {
4149
+ __html: "".concat(typeof selectedHeaderNote !== 'undefined' ? selectedHeaderNote.replace('{items_num}', valSelectedData.length) : '')
4150
+ }
4151
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
4152
+ className: "m-select-v2__title",
4153
+ dangerouslySetInnerHTML: {
4154
+ __html: "".concat(selectedHeaderTitle || '')
4155
+ }
4156
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
4157
+ href: "#",
4158
+ className: "m-select-v2__btn--remove-all",
4159
+ onClick: handleRemoveAll
4160
+ }, removeAllBtnLabel || 'Remove all')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
4161
+ data: dragdropListDataInit(selectedResultReverse ? valSelectedData.reverse() : valSelectedData),
4162
+ onUpdate: function onUpdate(newData, curId) {
4163
+ setValSelectedData(newData);
4164
+ var newValueData = newData.map(function (v) {
4165
+ return v.value;
4166
+ });
4167
+ var newValueStr = VALUE_BY_BRACKETS ? (0,convert.convertArrToValByBrackets)(newValueData) : newValueData.join(',');
4168
+ var targetData = newData.find(function (v) {
4169
+ return v.id == curId;
4170
+ }); // !!!from old "dataInit"
4171
+ var _data = typeof targetData !== 'undefined' ? targetData : {};
4172
+ setValSelected(newData.map(function (v) {
4173
+ return v.value;
4174
+ }));
4175
+ onChange === null || onChange === void 0 ? void 0 : onChange(document.querySelector("[data-id=\"".concat(curId, "\"]")), newValueData, newValueStr, _data, 'update', newData);
4176
+ },
4177
+ wrapperClassName: "",
4178
+ prefix: "m-select-v2",
4179
+ draggable: draggable,
4180
+ handleHide: handleHide,
4181
+ handleIcon: handleIcon,
4182
+ handlePos: handlePos,
4183
+ dragMode: dragMode,
4184
+ indentation: indentation,
4185
+ doubleIndent: doubleIndent,
4186
+ alternateCollapse: false,
4187
+ arrow: arrow,
4188
+ hierarchical: false
4189
+ })))));
4190
+ });
4191
+ /* harmony default export */ const src = (MultipleSelect);
4192
+ })();
4193
+
4194
+ /******/ return __webpack_exports__;
4195
+ /******/ })()
4196
+ ;
4197
+ });