@oliasoft-open-source/charts-library 5.0.0-beta-2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/dist/assets/Color-6VNJS4EI-DLbcRNMp.js +1 -0
  2. package/dist/assets/DocsRenderer-NNNQARDV-BOzykHvd.js +1 -0
  3. package/dist/assets/WithTooltip-V3YHNWJZ-BeePhoIB.js +1 -0
  4. package/dist/assets/_getPrototype-Bgn98YsR.js +3 -0
  5. package/dist/assets/{bar-chart.stories-D9mtWCnD.js → bar-chart.stories-BEwhK613.js} +35 -35
  6. package/dist/assets/chunk-HLWAVYOI-BJEcfeBO.js +364 -0
  7. package/dist/assets/entry-preview-D8lfu5jc.js +1 -0
  8. package/dist/assets/entry-preview-docs-CRyh30bF.js +54 -0
  9. package/dist/assets/formatter-SWP5E3XI-Bj1a9__W.js +156 -0
  10. package/dist/assets/get-draggableData-DhvAHrT5.js +2 -0
  11. package/dist/assets/iframe-BurE_SJm.js +8 -0
  12. package/dist/assets/index-B7LTuyD5.js +1 -0
  13. package/dist/assets/index-BXzfdmYx.js +24 -0
  14. package/dist/assets/index-CZvFZgOq.js +9 -0
  15. package/dist/assets/index-D3eZ-H7s.js +1 -0
  16. package/dist/assets/index-DrFu-skq.js +6 -0
  17. package/dist/assets/index-uubelm5h.js +9 -0
  18. package/dist/assets/isPlainObject-DdO3KXLu.js +1 -0
  19. package/dist/assets/legend-BWpTckOL.js +278 -0
  20. package/dist/assets/legend-context-BAQplG-D.js +71 -0
  21. package/dist/assets/line-chart-L0zq38Nj.js +1 -0
  22. package/dist/assets/line-chart.stories-CurD8upE.js +1130 -0
  23. package/dist/assets/{line-chart.test-case.stories-DgfMW1VB.js → line-chart.test-case.stories-Cq5J45Io.js} +2 -2
  24. package/dist/assets/pie-chart.stories-Duex2I6n.js +45 -0
  25. package/dist/assets/preview-BBDnT5_b.js +30 -0
  26. package/dist/assets/preview-D4u66u8a.js +2 -0
  27. package/dist/assets/preview-FHoZfaOb.js +17 -0
  28. package/dist/assets/react-18-Xi5cNDBV.js +1 -0
  29. package/dist/assets/scatter-chart.stories-D0618GGr.js +41 -0
  30. package/dist/assets/syntaxhighlighter-MJWPISIS-Bmhn3z6A.js +1 -0
  31. package/dist/bar-chart/bar-chart-const.d.ts +2 -0
  32. package/dist/bar-chart/bar-chart-default-props.d.ts +2 -0
  33. package/dist/bar-chart/bar-chart.d.ts +3 -0
  34. package/dist/bar-chart/bar-chart.interface.d.ts +96 -0
  35. package/dist/bar-chart/bar-chart.stories.d.ts +807 -0
  36. package/dist/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
  37. package/dist/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
  38. package/dist/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
  39. package/dist/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
  40. package/dist/bar-chart/utils/use-bar-chart-options.d.ts +55 -0
  41. package/dist/common/common.interface.d.ts +206 -0
  42. package/dist/common/controls-portal.d.ts +7 -0
  43. package/dist/common/enums.d.ts +10 -0
  44. package/dist/common/helpers/chart-border-plugin.d.ts +16 -0
  45. package/dist/common/helpers/chart-consts.d.ts +39 -0
  46. package/dist/common/helpers/chart-utils.d.ts +84 -0
  47. package/dist/common/helpers/container.d.ts +18 -0
  48. package/dist/common/helpers/custom-format-number.d.ts +1 -0
  49. package/dist/common/helpers/download-pgn.d.ts +4 -0
  50. package/dist/common/helpers/enums.d.ts +80 -0
  51. package/dist/common/helpers/get-chart-annotation.d.ts +90 -0
  52. package/dist/common/helpers/get-custom-legend-plugin-example.d.ts +8 -0
  53. package/dist/common/helpers/get-draggableData.d.ts +18 -0
  54. package/dist/common/helpers/range/estimate-close-values.test.d.ts +1 -0
  55. package/dist/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
  56. package/dist/common/helpers/range/range.d.ts +33 -0
  57. package/dist/common/helpers/range/range.test.d.ts +1 -0
  58. package/dist/common/helpers/text.d.ts +1 -0
  59. package/dist/common/helpers/to-annotation.d.ts +4 -0
  60. package/dist/common/hooks/use-generated-labels.d.ts +4 -0
  61. package/dist/common/hooks/use-legend-state.d.ts +28 -0
  62. package/dist/common/hooks/use-legend.d.ts +4 -0
  63. package/dist/common/hooks/use-reset.d.ts +3 -0
  64. package/dist/common/legend-component/legend-dropzone.d.ts +3 -0
  65. package/dist/common/legend-component/legend-interface.d.ts +48 -0
  66. package/dist/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
  67. package/dist/common/legend-component/legend-item/legend-item.d.ts +3 -0
  68. package/dist/common/legend-component/legend-panel.d.ts +3 -0
  69. package/dist/common/legend-component/legend.d.ts +3 -0
  70. package/dist/common/legend-component/state/legend-action-types.d.ts +2 -0
  71. package/dist/common/legend-component/state/legend-context.d.ts +12 -0
  72. package/dist/common/legend-component/state/legend-state-reducer.d.ts +26 -0
  73. package/dist/common/legend-component/utils/create-style-object.d.ts +27 -0
  74. package/dist/common/legend-component/utils/get-generated-labels.d.ts +2 -0
  75. package/dist/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
  76. package/dist/common/plugins/annotation-dragger-plugin/enums.d.ts +20 -0
  77. package/dist/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
  78. package/dist/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
  79. package/dist/common/plugins/annotation-dragger-plugin/helpers.test.d.ts +1 -0
  80. package/dist/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
  81. package/dist/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
  82. package/dist/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
  83. package/dist/favicon.svg +7 -1
  84. package/dist/iframe.html +51 -259
  85. package/dist/index.d.ts +1 -8
  86. package/dist/index.html +30 -80
  87. package/dist/index.json +1 -1
  88. package/dist/line-chart/__tests__/test-data/app-test-case-1.json.d.ts +8733 -0
  89. package/dist/line-chart/__tests__/test-data/app-test-case-2.json.d.ts +11614 -0
  90. package/dist/line-chart/__tests__/test-data/app-test-case-3.json.d.ts +34 -0
  91. package/dist/line-chart/__tests__/test-data/app-test-case-4.json.d.ts +411 -0
  92. package/dist/line-chart/__tests__/test-data/app-test-case-5.json.d.ts +2734 -0
  93. package/dist/line-chart/__tests__/test-data/app-test-case-6.json.d.ts +2236 -0
  94. package/dist/line-chart/constants/default-translations.d.ts +25 -0
  95. package/dist/line-chart/constants/line-chart-consts.d.ts +13 -0
  96. package/dist/line-chart/controls/axes-options/action-types.d.ts +5 -0
  97. package/dist/line-chart/controls/axes-options/axes-options-form-state.d.ts +23 -0
  98. package/dist/line-chart/controls/axes-options/axes-options-form-state.test.d.ts +1 -0
  99. package/dist/line-chart/controls/axes-options/axes-options-interfaces.d.ts +54 -0
  100. package/dist/line-chart/controls/axes-options/axes-options.d.ts +6 -0
  101. package/dist/line-chart/controls/controls-interfaces.d.ts +20 -0
  102. package/dist/line-chart/controls/controls.d.ts +6 -0
  103. package/dist/line-chart/controls/drag-options-interfaces.d.ts +14 -0
  104. package/dist/line-chart/controls/drag-options.d.ts +23 -0
  105. package/dist/line-chart/controls/line-options.d.ts +19 -0
  106. package/dist/line-chart/hooks/use-chart-functions.d.ts +32 -0
  107. package/dist/line-chart/hooks/use-chart-options.d.ts +16 -0
  108. package/dist/line-chart/hooks/use-chart-plugins.d.ts +7 -0
  109. package/dist/line-chart/hooks/use-chart-state.d.ts +17 -0
  110. package/dist/line-chart/hooks/use-toggle-handler.d.ts +12 -0
  111. package/dist/line-chart/initialize/config.d.ts +12 -0
  112. package/dist/line-chart/initialize/initialize-line-chart.d.ts +12 -0
  113. package/dist/line-chart/initialize/initialize-line-chart.test.d.ts +1 -0
  114. package/dist/line-chart/line-chart-get-default-props.d.ts +2 -0
  115. package/dist/line-chart/line-chart.d.ts +3 -0
  116. package/dist/line-chart/line-chart.interface.d.ts +146 -0
  117. package/dist/line-chart/line-chart.stories.d.ts +1729 -0
  118. package/dist/line-chart/line-chart.test-case.stories.d.ts +29 -0
  119. package/dist/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
  120. package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
  121. package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.test.d.ts +1 -0
  122. package/dist/line-chart/plugins/plugin-constants.d.ts +11 -0
  123. package/dist/line-chart/plugins/plugins.interface.d.ts +9 -0
  124. package/dist/line-chart/state/action-types.d.ts +12 -0
  125. package/dist/line-chart/state/initial-state.d.ts +14 -0
  126. package/dist/line-chart/state/line-chart-reducer.d.ts +2 -0
  127. package/dist/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
  128. package/dist/line-chart/state/state.interfaces.d.ts +34 -0
  129. package/dist/line-chart/utils/__tests__/get-annotations-data.test.d.ts +1 -0
  130. package/dist/line-chart/utils/__tests__/get-axes-data-from-metasets.test.d.ts +1 -0
  131. package/dist/line-chart/utils/__tests__/get-axes-type-from-key.test.d.ts +1 -0
  132. package/dist/line-chart/utils/__tests__/get-axis-range-by-type.test.d.ts +1 -0
  133. package/dist/line-chart/utils/__tests__/get-line-chart-tooltips.test.d.ts +1 -0
  134. package/dist/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
  135. package/dist/line-chart/utils/axis-formatting/axis-formatting.test.d.ts +1 -0
  136. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +11 -0
  137. package/dist/line-chart/utils/axis-scales/axis-scales.test.d.ts +1 -0
  138. package/dist/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
  139. package/dist/line-chart/utils/check-custom-option/check-custom-option.test.d.ts +1 -0
  140. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-condition.test.d.ts +1 -0
  141. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-data.test.d.ts +1 -0
  142. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-datalabels-position.test.d.ts +1 -0
  143. package/dist/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
  144. package/dist/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
  145. package/dist/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
  146. package/dist/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
  147. package/dist/line-chart/utils/enums.d.ts +4 -0
  148. package/dist/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
  149. package/dist/line-chart/utils/get-annotations-data.d.ts +1 -0
  150. package/dist/line-chart/utils/get-axes-data-from-metasets.d.ts +1 -0
  151. package/dist/line-chart/utils/get-axes-ranges-from-chart.d.ts +9 -0
  152. package/dist/line-chart/utils/get-axis-range-by-type.d.ts +10 -0
  153. package/dist/line-chart/utils/get-generated-labels.d.ts +2 -0
  154. package/dist/line-chart/utils/get-line-chart-data-labels.d.ts +19 -0
  155. package/dist/line-chart/utils/get-line-chart-scales.d.ts +4 -0
  156. package/dist/line-chart/utils/get-line-chart-tooltips.d.ts +20 -0
  157. package/dist/line-chart/utils/line-chart-utils.d.ts +32 -0
  158. package/dist/line-chart/utils/translations/get-translations.d.ts +8 -0
  159. package/dist/line-chart/utils/translations/get-translations.test.d.ts +1 -0
  160. package/dist/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
  161. package/dist/pie-chart/pie-chart-get-default-props.d.ts +3 -0
  162. package/dist/pie-chart/pie-chart.d.ts +3 -0
  163. package/dist/pie-chart/pie-chart.interface.d.ts +70 -0
  164. package/dist/pie-chart/pie-chart.stories.d.ts +263 -0
  165. package/dist/pie-chart/use-pie-chart-config.d.ts +41 -0
  166. package/dist/project.json +1 -1
  167. package/dist/sb-addons/actions-0/manager-bundle.js +3 -0
  168. package/dist/sb-addons/actions-0/manager-bundle.js.LEGAL.txt +0 -0
  169. package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js +5 -0
  170. package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js.LEGAL.txt +0 -0
  171. package/dist/sb-common-assets/fonts.css +31 -0
  172. package/dist/sb-manager/WithTooltip-V3YHNWJZ-MXTFSDU5.js +1 -0
  173. package/dist/sb-manager/chunk-5QAFKPS7.js +7 -0
  174. package/dist/sb-manager/chunk-7PRFHFSS.js +9 -0
  175. package/dist/sb-manager/chunk-XE6LDGTE.js +406 -0
  176. package/dist/sb-manager/chunk-YDUB7CS6.js +348 -0
  177. package/dist/sb-manager/chunk-ZEU7PDD3.js +1 -0
  178. package/dist/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +156 -0
  179. package/dist/sb-manager/globals-module-info.js +1 -1051
  180. package/dist/sb-manager/globals.js +1 -48
  181. package/dist/sb-manager/index.js +1 -0
  182. package/dist/sb-manager/runtime.js +1 -12048
  183. package/dist/sb-manager/syntaxhighlighter-MJWPISIS-JOSCT6CQ.js +1 -0
  184. package/dist/sb-preview/globals.js +1 -0
  185. package/dist/sb-preview/runtime.js +112 -0
  186. package/dist/scatter-chart/hooks/use-scatter-chart-config.d.ts +113 -0
  187. package/dist/scatter-chart/scatter-chart-default-props.interface.d.ts +71 -0
  188. package/dist/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
  189. package/dist/scatter-chart/scatter-chart.d.ts +3 -0
  190. package/dist/scatter-chart/scatter-chart.interface.d.ts +81 -0
  191. package/dist/scatter-chart/scatter-chart.stories.d.ts +279 -0
  192. package/dist/scatter-chart/utils/get-scales-config.d.ts +49 -0
  193. package/dist/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
  194. package/dist/src/components/bar-chart/bar-chart-const.d.ts +2 -0
  195. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +2 -0
  196. package/dist/src/components/bar-chart/bar-chart.d.ts +3 -0
  197. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +96 -0
  198. package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
  199. package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
  200. package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
  201. package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
  202. package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +55 -0
  203. package/dist/src/components/common/common.interface.d.ts +206 -0
  204. package/dist/src/components/common/controls-portal.d.ts +7 -0
  205. package/dist/src/components/common/enums.d.ts +10 -0
  206. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +16 -0
  207. package/dist/src/components/common/helpers/chart-consts.d.ts +39 -0
  208. package/dist/src/components/common/helpers/chart-utils.d.ts +84 -0
  209. package/dist/src/components/common/helpers/container.d.ts +18 -0
  210. package/dist/src/components/common/helpers/custom-format-number.d.ts +1 -0
  211. package/dist/src/components/common/helpers/download-pgn.d.ts +4 -0
  212. package/dist/src/components/common/helpers/enums.d.ts +80 -0
  213. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +90 -0
  214. package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +8 -0
  215. package/dist/src/components/common/helpers/get-draggableData.d.ts +18 -0
  216. package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
  217. package/dist/src/components/common/helpers/range/range.d.ts +33 -0
  218. package/dist/src/components/common/helpers/text.d.ts +1 -0
  219. package/dist/src/components/common/helpers/to-annotation.d.ts +4 -0
  220. package/dist/src/components/common/hooks/use-generated-labels.d.ts +4 -0
  221. package/dist/src/components/common/hooks/use-legend-state.d.ts +28 -0
  222. package/dist/src/components/common/hooks/use-legend.d.ts +4 -0
  223. package/dist/src/components/common/hooks/use-reset.d.ts +3 -0
  224. package/dist/src/components/common/legend-component/legend-dropzone.d.ts +3 -0
  225. package/dist/src/components/common/legend-component/legend-interface.d.ts +48 -0
  226. package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
  227. package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +3 -0
  228. package/dist/src/components/common/legend-component/legend-panel.d.ts +3 -0
  229. package/dist/src/components/common/legend-component/legend.d.ts +3 -0
  230. package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +2 -0
  231. package/dist/src/components/common/legend-component/state/legend-context.d.ts +12 -0
  232. package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +26 -0
  233. package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +27 -0
  234. package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +2 -0
  235. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
  236. package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +20 -0
  237. package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
  238. package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
  239. package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
  240. package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
  241. package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
  242. package/dist/src/components/line-chart/constants/default-translations.d.ts +25 -0
  243. package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +13 -0
  244. package/dist/src/components/line-chart/controls/axes-options/action-types.d.ts +5 -0
  245. package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +23 -0
  246. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +54 -0
  247. package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +6 -0
  248. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +20 -0
  249. package/dist/src/components/line-chart/controls/controls.d.ts +6 -0
  250. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +14 -0
  251. package/dist/src/components/line-chart/controls/drag-options.d.ts +23 -0
  252. package/dist/src/components/line-chart/controls/line-options.d.ts +19 -0
  253. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +32 -0
  254. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +16 -0
  255. package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +7 -0
  256. package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +17 -0
  257. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +12 -0
  258. package/dist/src/components/line-chart/initialize/config.d.ts +12 -0
  259. package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +12 -0
  260. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +2 -0
  261. package/dist/src/components/line-chart/line-chart.d.ts +3 -0
  262. package/dist/src/components/line-chart/line-chart.interface.d.ts +146 -0
  263. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
  264. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
  265. package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +11 -0
  266. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +9 -0
  267. package/dist/src/components/line-chart/state/action-types.d.ts +12 -0
  268. package/dist/src/components/line-chart/state/initial-state.d.ts +14 -0
  269. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +2 -0
  270. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
  271. package/dist/src/components/line-chart/state/state.interfaces.d.ts +34 -0
  272. package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
  273. package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +11 -0
  274. package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
  275. package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
  276. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
  277. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
  278. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
  279. package/dist/src/components/line-chart/utils/enums.d.ts +4 -0
  280. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
  281. package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +1 -0
  282. package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +1 -0
  283. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +9 -0
  284. package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +10 -0
  285. package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +2 -0
  286. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +19 -0
  287. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +4 -0
  288. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +20 -0
  289. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +32 -0
  290. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +8 -0
  291. package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
  292. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +3 -0
  293. package/dist/src/components/pie-chart/pie-chart.d.ts +3 -0
  294. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +70 -0
  295. package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +41 -0
  296. package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +113 -0
  297. package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +71 -0
  298. package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
  299. package/dist/src/components/scatter-chart/scatter-chart.d.ts +3 -0
  300. package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +81 -0
  301. package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +49 -0
  302. package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
  303. package/dist/stories.json +1 -0
  304. package/package.json +3 -2
  305. package/dist/assets/Color-YHDXOIA2-D6i6tiFz.js +0 -1
  306. package/dist/assets/DocsRenderer-CFRXHY34-D88vu1Xb.js +0 -580
  307. package/dist/assets/client-9BU5HM4U.js +0 -1
  308. package/dist/assets/entry-preview-D2XJoWVM.js +0 -10
  309. package/dist/assets/entry-preview-docs-z3mMcuG4.js +0 -46
  310. package/dist/assets/get-draggableData-DO0Px5pc.js +0 -2
  311. package/dist/assets/iframe-DLnw2TiW.js +0 -217
  312. package/dist/assets/index-B-BONL6g.js +0 -1
  313. package/dist/assets/index-BGqSdrBK.js +0 -1
  314. package/dist/assets/index-CVdx34fM.js +0 -1
  315. package/dist/assets/index-D3-0uUTW.js +0 -24
  316. package/dist/assets/index-Dytf1aFS.js +0 -8
  317. package/dist/assets/index-eCxJ45ll.js +0 -9
  318. package/dist/assets/jsx-runtime-Y5Ju2SGo.js +0 -9
  319. package/dist/assets/legend-BI53UIaI.js +0 -1346
  320. package/dist/assets/legend-context-BNCYpFYh.js +0 -68
  321. package/dist/assets/line-chart-BdFuLh7N.js +0 -1
  322. package/dist/assets/line-chart.stories-BVsiy8CQ.js +0 -1130
  323. package/dist/assets/pie-chart.stories-BVurv17M.js +0 -45
  324. package/dist/assets/preview-CLM2f008.js +0 -2
  325. package/dist/assets/preview-DD_OYowb.js +0 -1
  326. package/dist/assets/preview-XObsormK.js +0 -3
  327. package/dist/assets/react-18-DZY5LW1V.js +0 -1
  328. package/dist/assets/react-CxVRKATl.js +0 -1
  329. package/dist/assets/scatter-chart.stories-DnivHhIH.js +0 -41
  330. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  331. package/dist/nunito-sans-bold.woff2 +0 -0
  332. package/dist/nunito-sans-italic.woff2 +0 -0
  333. package/dist/nunito-sans-regular.woff2 +0 -0
  334. package/dist/sb-addons/actions-1/manager-bundle.js +0 -3
  335. package/dist/sb-addons/docs-2/manager-bundle.js +0 -242
  336. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
  337. package/dist/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +0 -5
  338. package/dist/sb-common-assets/favicon.svg +0 -1
  339. package/dist/sb-manager/globals-runtime.js +0 -41591
@@ -0,0 +1,278 @@
1
+ import{aa as Ia,ab as Na,h as Cp,ac as Ls,ad as To,ae as r0,af as xo,ag as dh,ah as Cr,ai as nI,aj as rI,ak as Ca,al as QC,am as oI,an as iI,ao as sI,ap as aI,aq as vc,ar as eE,as as o0,at as Ol,au as Hu,av as ib,aw as tE,ax as lI,ay as sb,az as Ep,aA as ab,aB as cI,t as We,d as vr,aC as uI,aD as dI,aE as fI,aF as hI,aG as kp,c as i0,P as Vl}from"./legend-context-BAQplG-D.js";import{j as v,e as pI}from"./index-CZvFZgOq.js";import{r as x,R as U}from"./index-uubelm5h.js";import{p as gt,P as fu}from"./index-D3eZ-H7s.js";import{r as xr,R as nE}from"./index-BXzfdmYx.js";/*!
2
+ * chartjs-plugin-annotation v3.1.0
3
+ * https://www.chartjs.org/chartjs-plugin-annotation/index
4
+ * (c) 2024 chartjs-plugin-annotation Contributors
5
+ * Released under the MIT License
6
+ */const lb={modes:{point(e,t){return wd(e,t,{intersect:!0})},nearest(e,t,n){return vI(e,t,n)},x(e,t,n){return wd(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return wd(e,t,{intersect:n.intersect,axis:"y"})}}};function s0(e,t,n){return(lb.modes[n.mode]||lb.modes.nearest)(e,t,n)}function gI(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function mI(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function wd(e,t,n){return e.filter(r=>n.intersect?r.inRange(t.x,t.y):gI(r,t,n.axis))}function vI(e,t,n){let r=Number.POSITIVE_INFINITY;return wd(e,t,n).reduce((o,i)=>{const s=i.getCenterPoint(),a=mI(t,s,n.axis),l=r0(t,a);return l<r?(o=[i],r=l):l===r&&o.push(i),o},[]).sort((o,i)=>o._index-i._index).slice(0,1)}function js(e,t,n){const r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}const yI=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,us=.001,fh=(e,t,n)=>Math.min(n,Math.max(t,e)),rE=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function bI(e,t,n){for(const r of Object.keys(e))e[r]=fh(e[r],t,n);return e}function xI(e,t,n,r){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+r,2)}function oE(e,{x:t,y:n,x2:r,y2:o},i,{borderWidth:s,hitTolerance:a}){const l=(s+a)/2,c=e.x>=t-l-us&&e.x<=r+l+us,u=e.y>=n-l-us&&e.y<=o+l+us;return i==="x"?c:(i==="y"||c)&&u}function iE(e,{rect:t,center:n},r,{rotation:o,borderWidth:i,hitTolerance:s}){const a=js(e,n,To(-o));return oE(a,t,r,{borderWidth:i,hitTolerance:s})}function $s(e,t){const{centerX:n,centerY:r}=e.getProps(["centerX","centerY"],t);return{x:n,y:r}}function wI(e,t,n,r=!0){const o=n.split(".");let i=0;for(const s of t.split(".")){const a=o[i++];if(parseInt(s,10)<parseInt(a,10))break;if(yI(a,s)){if(r)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const sE=e=>typeof e=="string"&&e.endsWith("%"),aE=e=>parseFloat(e)/100,lE=e=>fh(aE(e),0,1),Tl=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),SI={box:e=>Tl(e.centerX,e.centerY),doughnutLabel:e=>Tl(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Tl(e.centerX,e.centerY),line:e=>Tl(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Tl(e.centerX,e.centerY)};function a0(e,t){return t==="start"?0:t==="end"?e:sE(t)?lE(t)*e:e/2}function Mi(e,t,n=!0){return typeof t=="number"?t:sE(t)?(n?lE(t):aE(t))*e:e}function CI(e,t){const{x:n,width:r}=e,o=t.textAlign;return o==="center"?n+r/2:o==="end"||o==="right"?n+r:n}function cE(e,t,{borderWidth:n,position:r,xAdjust:o,yAdjust:i},s){const a=Ia(s),l=t.width+(a?s.width:0)+n,c=t.height+(a?s.height:0)+n,u=l0(r),d=cb(e.x,l,o,u.x),f=cb(e.y,c,i,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function l0(e,t="center"){return Ia(e)?{x:vc(e.x,t),y:vc(e.y,t)}:(e=vc(e,t),{x:e,y:e})}const uE=(e,t)=>e&&e.autoFit&&t<1;function dE(e,t){const n=e.font,r=Na(n)?n:[n];return uE(e,t)?r.map(function(o){const i=Ep(o);return i.size=Math.floor(o.size*t),i.lineHeight=o.lineHeight,Ep(i)}):r.map(o=>Ep(o))}function fE(e){return e&&(xo(e.xValue)||xo(e.yValue))}function cb(e,t,n=0,r){return e-a0(t,r)+n}function ol(e,t,n){const r=n.init;if(r){if(r===!0)return pE(t,n)}else return;return EI(e,t,n)}function hE(e,t,n){let r=!1;return t.forEach(o=>{Ca(e[o])?(r=!0,n[o]=e[o]):xo(n[o])&&delete n[o]}),r}function pE(e,t){const n=t.type||"line";return SI[n](e)}function EI(e,t,n){const r=o0(n.init,[{chart:e,properties:t,options:n}]);if(r===!0)return pE(t,n);if(Ia(r))return r}const Op=new Map,kI=e=>isNaN(e)||e<=0,OI=e=>e.reduce(function(t,n){return t+=n.string,t},"");function hh(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ph(e,{x:t,y:n},r){r&&(e.translate(t,n),e.rotate(To(r)),e.translate(-t,-n))}function wo(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function il(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function gh(e,t){const n=t.content;if(hh(n))return{width:Mi(n.width,t.width),height:Mi(n.height,t.height)};const r=dE(t),o=t.textStrokeWidth,i=Na(n)?n:[n],s=i.join()+OI(r)+o+(e._measureText?"-spriting":"");return Op.has(s)||Op.set(s,DI(e,i,r,o)),Op.get(s)}function gE(e,t,n){const{x:r,y:o,width:i,height:s}=t;e.save(),il(e,n);const a=wo(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),oI(e,{x:r,y:o,w:i,h:s,radius:bI(iI(n.borderRadius),0,Math.min(i,s)/2)}),e.closePath(),e.fill(),a&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function mE(e,t,n,r){const o=n.content;if(hh(o)){e.save(),e.globalAlpha=NI(n.opacity,o.style.opacity),e.drawImage(o,t.x,t.y,t.width,t.height),e.restore();return}const i=Na(o)?o:[o],s=dE(n,r),a=n.color,l=Na(a)?a:[a],c=CI(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,TI(e,n)&&RI(e,{x:c,y:u},i,s),II(e,{x:c,y:u},i,{fonts:s,colors:l}),e.restore()}function TI(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function _I(e,t,n,r){const{radius:o,options:i}=t,s=i.pointStyle,a=i.rotation;let l=(a||0)*QC;if(hh(s)){e.save(),e.translate(n,r),e.rotate(l),e.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),e.restore();return}kI(o)||MI(e,{x:n,y:r,radius:o,rotation:a,style:s,rad:l})}function MI(e,{x:t,y:n,radius:r,rotation:o,style:i,rad:s}){let a,l,c,u;switch(e.beginPath(),i){default:e.arc(t,n,r,0,tE),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(s)*r,n-Math.cos(s)*r),s+=ib,e.lineTo(t+Math.sin(s)*r,n-Math.cos(s)*r),s+=ib,e.lineTo(t+Math.sin(s)*r,n-Math.cos(s)*r),e.closePath();break;case"rectRounded":u=r*.516,c=r-u,a=Math.cos(s+Ol)*c,l=Math.sin(s+Ol)*c,e.arc(t-a,n-l,u,s-Cr,s-Hu),e.arc(t+l,n-a,u,s-Hu,s),e.arc(t+a,n+l,u,s,s+Hu),e.arc(t-l,n+a,u,s+Hu,s+Cr),e.closePath();break;case"rect":if(!o){c=Math.SQRT1_2*r,e.rect(t-c,n-c,2*c,2*c);break}s+=Ol;case"rectRot":a=Math.cos(s)*r,l=Math.sin(s)*r,e.moveTo(t-a,n-l),e.lineTo(t+l,n-a),e.lineTo(t+a,n+l),e.lineTo(t-l,n+a),e.closePath();break;case"crossRot":s+=Ol;case"cross":a=Math.cos(s)*r,l=Math.sin(s)*r,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"star":a=Math.cos(s)*r,l=Math.sin(s)*r,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a),s+=Ol,a=Math.cos(s)*r,l=Math.sin(s)*r,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"line":a=Math.cos(s)*r,l=Math.sin(s)*r,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(s)*r,n+Math.sin(s)*r);break}e.fill()}function DI(e,t,n,r){e.save();const o=t.length;let i=0,s=r;for(let a=0;a<o;a++){const l=n[Math.min(a,n.length-1)];e.font=l.string;const c=t[a];i=Math.max(i,e.measureText(c).width+r),s+=l.lineHeight}return e.restore(),{width:i,height:s}}function RI(e,{x:t,y:n},r,o){e.beginPath();let i=0;r.forEach(function(s,a){const l=o[Math.min(a,o.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(s,t,n+c/2+i),i+=c}),e.stroke()}function II(e,{x:t,y:n},r,{fonts:o,colors:i}){let s=0;r.forEach(function(a,l){const c=i[Math.min(l,i.length-1)],u=o[Math.min(l,o.length-1)],d=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=c,e.fillText(a,t,n+d/2+s),s+=d,e.fill()})}function NI(e,t){const n=sb(e)?e:t;return sb(n)?fh(n,0,1):1}const vE=["left","bottom","top","right"];function PI(e,t){const{pointX:n,pointY:r,options:o}=t,i=o.callout,s=i&&i.display&&zI(t,i);if(!s||FI(t,i,s))return;if(e.save(),e.beginPath(),!wo(e,i))return e.restore();const{separatorStart:l,separatorEnd:c}=AI(t,s),{sideStart:u,sideEnd:d}=jI(t,s,l);(i.margin>0||o.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(u.x,u.y),e.lineTo(d.x,d.y);const f=js({x:n,y:r},t.getCenterPoint(),To(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function AI(e,t){const{x:n,y:r,x2:o,y2:i}=e,s=LI(e,t);let a,l;return t==="left"||t==="right"?(a={x:n+s,y:r},l={x:a.x,y:i}):(a={x:n,y:r+s},l={x:o,y:a.y}),{separatorStart:a,separatorEnd:l}}function LI(e,t){const{width:n,height:r,options:o}=e,i=o.callout.margin+o.borderWidth/2;return t==="right"?n+i:t==="bottom"?r+i:-i}function jI(e,t,n){const{y:r,width:o,height:i,options:s}=e,a=s.callout.start,l=$I(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:n.x,y:r+Mi(i,a)},u={x:c.x+l,y:c.y}):(c={x:n.x+Mi(o,a),y:n.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function $I(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function zI(e,t){const n=t.position;return vE.includes(n)?n:BI(e,t)}function BI(e,t){const{x:n,y:r,x2:o,y2:i,width:s,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=e,h={x:u,y:d},p=t.start,g=Mi(s,p),m=Mi(a,p),b=[n,n+g,n+g,o],y=[r+m,i,r,i],w=[];for(let S=0;S<4;S++){const C=js({x:b[S],y:y[S]},h,To(f));w.push({position:vE[S],distance:r0(C,{x:l,y:c})})}return w.sort((S,C)=>S.distance-C.distance)[0].position}function FI(e,t,n){const{pointX:r,pointY:o}=e,i=t.margin;let s=r,a=o;return n==="left"?s+=i:n==="right"?s-=i:n==="top"?a+=i:n==="bottom"&&(a-=i),e.inRange(s,a)}const ub={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Pa(e,t,n){return t=typeof t=="number"?t:e.parse(t),eE(t)?e.getPixelForValue(t):n}function Ts(e,t,n){const r=t[n];if(r||n==="scaleID")return r;const o=n.charAt(0),i=Object.values(e).filter(s=>s.axis&&s.axis===o);return i.length?i[0].id:o}function yE(e,t){if(e){const n=e.options.reverse,r=Pa(e,t.min,n?t.end:t.start),o=Pa(e,t.max,n?t.start:t.end);return{start:r,end:o}}}function bE(e,t){const{chartArea:n,scales:r}=e,o=r[Ts(r,t,"xScaleID")],i=r[Ts(r,t,"yScaleID")];let s=n.width/2,a=n.height/2;return o&&(s=Pa(o,t.xValue,o.left+o.width/2)),i&&(a=Pa(i,t.yValue,i.top+i.height/2)),{x:s,y:a}}function c0(e,t){const n=e.scales,r=n[Ts(n,t,"xScaleID")],o=n[Ts(n,t,"yScaleID")];if(!r&&!o)return{};let{left:i,right:s}=r||e.chartArea,{top:a,bottom:l}=o||e.chartArea;const c=db(r,{min:t.xMin,max:t.xMax,start:i,end:s});i=c.start,s=c.end;const u=db(o,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:i,y:a,x2:s,y2:l,width:s-i,height:l-a,centerX:i+(s-i)/2,centerY:a+(l-a)/2}}function xE(e,t){if(!fE(t)){const n=c0(e,t);let r=t.radius;(!r||isNaN(r))&&(r=Math.min(n.width,n.height)/2,t.radius=r);const o=r*2,i=n.centerX+t.xAdjust,s=n.centerY+t.yAdjust;return{x:i-r,y:s-r,x2:i+r,y2:s+r,centerX:i,centerY:s,width:o,height:o,radius:r}}return VI(e,t)}function HI(e,t){const{scales:n,chartArea:r}=e,o=n[t.scaleID],i={x:r.left,y:r.top,x2:r.right,y2:r.bottom};return o?WI(o,i,t):UI(n,i,t),i}function wE(e,t){const n=c0(e,t);return n.initProperties=ol(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:GI(e,n,t),initProperties:n.initProperties}],n}function VI(e,t){const n=bE(e,t),r=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:r,height:r}}function db(e,t){const n=yE(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function WI(e,t,n){const r=Pa(e,n.value,NaN),o=Pa(e,n.endValue,r);e.isHorizontal()?(t.x=r,t.x2=o):(t.y=r,t.y2=o)}function UI(e,t,n){for(const r of Object.keys(ub)){const o=e[Ts(e,n,r)];if(o){const{min:i,max:s,start:a,end:l,startProp:c,endProp:u}=ub[r],d=yE(o,{min:n[i],max:n[s],start:o[a],end:o[l]});t[c]=d.start,t[u]=d.end}}}function qI({properties:e,options:t},n,r,o){const{x:i,x2:s,width:a}=e;return SE({start:i,end:s,borderWidth:t.borderWidth},{position:r.x,padding:{start:o.left,end:o.right},adjust:t.label.xAdjust,size:n.width})}function KI({properties:e,options:t},n,r,o){const{y:i,y2:s,height:a}=e;return SE({start:i,end:s,borderWidth:t.borderWidth},{position:r.y,padding:{start:o.top,end:o.bottom},adjust:t.label.yAdjust,size:n.height})}function SE(e,t){const{start:n,end:r,borderWidth:o}=e,{position:i,padding:{start:s,end:a},adjust:l}=t,c=r-o-n-s-a-t.size;return n+o/2+l+a0(c,i)}function GI(e,t,n){const r=n.label;r.backgroundColor="transparent",r.callout.display=!1;const o=l0(r.position),i=dh(r.padding),s=gh(e.ctx,r),a=qI({properties:t,options:n},s,o,i),l=KI({properties:t,options:n},s,o,i),c=s.width+i.width,u=s.height+i.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:r.rotation}}const tm=["enter","leave"],u0=tm.concat("click");function YI(e,t,n){t.listened=hE(n,u0,t.listeners),t.moveListened=!1,tm.forEach(r=>{Ca(n[r])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(r=>{!t.listened&&Ca(r.click)&&(t.listened=!0),t.moveListened||tm.forEach(o=>{Ca(r[o])&&(t.listened=!0,t.moveListened=!0)})})}function XI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return JI(e,t,n);case"click":return ZI(e,t,n)}}function JI(e,t,n){if(!e.moveListened)return;let r;t.type==="mousemove"?r=s0(e.visibleElements,t,n.interaction):r=[];const o=e.hovered;e.hovered=r;const i={state:e,event:t};let s=fb(i,"leave",o,r);return fb(i,"enter",r,o)||s}function fb({state:e,event:t},n,r,o){let i;for(const s of r)o.indexOf(s)<0&&(i=CE(s.options[n]||e.listeners[n],s,t)||i);return i}function ZI(e,t,n){const r=e.listeners,o=s0(e.visibleElements,t,n.interaction);let i;for(const s of o)i=CE(s.options.click||r.click,s,t)||i;return i}function CE(e,t,n){return o0(e,[t.$context,n])===!0}const cf=["afterDraw","beforeDraw"];function QI(e,t,n){const r=t.visibleElements;t.hooked=hE(n,cf,t.hooks),t.hooked||r.forEach(o=>{t.hooked||cf.forEach(i=>{Ca(o.options[i])&&(t.hooked=!0)})})}function hb(e,t,n){if(e.hooked){const r=t.options[n]||e.hooks[n];return o0(r,[t.$context])}}function eN(e,t,n){const r=iN(e.scales,t,n);let o=pb(t,r,"min","suggestedMin");o=pb(t,r,"max","suggestedMax")||o,o&&Ca(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function tN(e,t){for(const n of e)rN(n,t)}function pb(e,t,n,r){if(eE(t[n])&&!nN(e.options,n,r)){const o=e[n]!==t[n];return e[n]=t[n],o}}function nN(e,t,n){return xo(e[t])||xo(e[n])}function rN(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const r=Ts(t,e,n);r&&!t[r]&&oN(e,n)&&console.warn(`No scale found with id '${r}' for annotation '${e.id}'`)}}function oN(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const r of["Min","Max","Value"])if(xo(e[n+r]))return!0;return!1}function iN(e,t,n){const r=t.axis,o=t.id,i=r+"ScaleID",s={min:vc(t.min,Number.NEGATIVE_INFINITY),max:vc(t.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===o?gb(a,t,["value","endValue"],s):Ts(e,a,i)===o&&gb(a,t,[r+"Min",r+"Max",r+"Value"],s);return s}function gb(e,t,n,r){for(const o of n){const i=e[o];if(xo(i)){const s=t.parse(i);r.min=Math.min(r.min,s),r.max=Math.max(r.max,s)}}}class sl extends Ls{inRange(t,n,r,o){const{x:i,y:s}=js({x:t,y:n},this.getCenterPoint(o),To(-this.options.rotation));return oE({x:i,y:s},this.getProps(["x","y","x2","y2"],o),r,this.options)}getCenterPoint(t){return $s(this,t)}draw(t){t.save(),ph(t,this.getCenterPoint(),this.options.rotation),gE(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return wE(t,n)}}sl.id="boxAnnotation";sl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};sl.defaultRoutes={borderColor:"color",backgroundColor:"color"};sl.descriptors={label:{_fallback:!0}};class mh extends Ls{inRange(t,n,r,o){return iE({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],o),center:this.getCenterPoint(o)},r,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return $s(this,t)}draw(t){const n=this.options;!n.display||!n.content||(dN(t,this),t.save(),ph(t,this.getCenterPoint(),this.rotation),mE(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const r=sN(t,n);if(!r)return{};const{controllerMeta:o,point:i,radius:s}=lN(t,n,r);let a=gh(t.ctx,n);const l=cN(a,s);uE(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=n,f=cE(i,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:ol(t,f,n),...f,...o,rotation:n.rotation,_fitRatio:l}}}mh.id="doughnutLabelAnnotation";mh.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0};mh.defaultRoutes={};function sN(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,r){const o=r.controller;return o instanceof sI&&aN(e,t,r.data)&&(!n||o.innerRadius<n.controller.innerRadius)&&o.options.circumference>=90?r:n},void 0)}function aN(e,t,n){if(!t.autoHide)return!0;for(let r=0;r<n.length;r++)if(!n[r].hidden&&e.getDataVisibility(r))return!0}function lN({chartArea:e},t,n){const{left:r,top:o,right:i,bottom:s}=e,{innerRadius:a,offsetX:l,offsetY:c}=n.controller,u=(r+i)/2+l,d=(o+s)/2+c,f={left:Math.max(u-a,r),right:Math.min(u+a,i),top:Math.max(d-a,o),bottom:Math.min(d+a,s)},h={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,g=a-p,m=h.y>d,b=m?o+p:s-p,y=uN(b,u,d,g);return{controllerMeta:{_centerX:u,_centerY:d,_radius:g,_counterclockwise:m,...y},point:h,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function cN({width:e,height:t},n){const r=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/r}function uN(e,t,n,r){const o=Math.pow(n-e,2),i=Math.pow(r,2),s=t*-2,a=Math.pow(t,2)+o-i,l=Math.pow(s,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:tE};const c=(-s-Math.sqrt(l))/2,u=(-s+Math.sqrt(l))/2;return{_startAngle:ab({x:t,y:n},{x:c,y:e}).angle,_endAngle:ab({x:t,y:n},{x:u,y:e}).angle}}function dN(e,t){const{_centerX:n,_centerY:r,_radius:o,_startAngle:i,_endAngle:s,_counterclockwise:a,options:l}=t;e.save();const c=wo(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,r,o,i,s,a),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class hu extends Ls{inRange(t,n,r,o){return iE({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],o),center:this.getCenterPoint(o)},r,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return $s(this,t)}draw(t){const n=this.options,r=!xo(this._visible)||this._visible;!n.display||!n.content||!r||(t.save(),ph(t,this.getCenterPoint(),this.rotation),PI(t,this),gE(t,this,n),mE(t,fN(this),n),t.restore())}resolveElementProperties(t,n){let r;if(fE(n))r=bE(t,n);else{const{centerX:a,centerY:l}=c0(t,n);r={x:a,y:l}}const o=dh(n.padding),i=gh(t.ctx,n),s=cE(r,i,n,o);return{initProperties:ol(t,s,n),pointX:r.x,pointY:r.y,...s,rotation:n.rotation}}}hu.id="labelAnnotation";hu.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};hu.defaultRoutes={borderColor:"color"};function fN({x:e,y:t,width:n,height:r,options:o}){const i=o.borderWidth/2,s=dh(o.padding);return{x:e+s.left+i,y:t+s.top+i,width:n-s.left-s.right-o.borderWidth,height:r-s.top-s.bottom-o.borderWidth}}const d0=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),nm=(e,t,n)=>d0(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,mb=(e,t,n)=>d0(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Wl=e=>e*e,hN=(e,t,{x:n,y:r,x2:o,y2:i},s)=>s==="y"?{start:Math.min(r,i),end:Math.max(r,i),value:t}:{start:Math.min(n,o),end:Math.max(n,o),value:e},vb=(e,t,n,r)=>(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n,rm=(e,t,n,r)=>({x:vb(e.x,t.x,n.x,r),y:vb(e.y,t.y,n.y,r)}),yb=(e,t,n,r)=>2*(1-r)*(t-e)+2*r*(n-t),bb=(e,t,n,r)=>-Math.atan2(yb(e.x,t.x,n.x,r),yb(e.y,t.y,n.y,r))+.5*Cr;class pu extends Ls{inRange(t,n,r,o){const i=(this.options.borderWidth+this.options.hitTolerance)/2;if(r!=="x"&&r!=="y"){const s={mouseX:t,mouseY:n},{path:a,ctx:l}=this;if(a){wo(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,h=l.isPointInStroke(a,d,f)||om(this,s,o);return l.restore(),h}const c=Wl(i);return vN(this,s,c,o)||om(this,s,o)}return pN(this,{mouseX:t,mouseY:n},r,{hitSize:i,useFinalPosition:o})}getCenterPoint(t){return $s(this,t)}draw(t){const{x:n,y:r,x2:o,y2:i,cp:s,options:a}=this;if(t.save(),!wo(t,a))return t.restore();il(t,a);const l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2));if(a.curve&&s)return kN(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=EE(this),h=Math.atan2(i-r,o-n);t.translate(n,r),t.rotate(h),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),im(t,0,d,c),im(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const r=HI(t,n),{x:o,y:i,x2:s,y2:a}=r,l=gN(r,t.chartArea),c=l?mN({x:o,y:i},{x:s,y:a},t.chartArea):{x:o,y:i,x2:s,y2:a,width:Math.abs(s-o),height:Math.abs(a-i)};if(c.centerX=(s+o)/2,c.centerY=(a+i)/2,c.initProperties=ol(t,c,n),n.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=EN(c,n,r0(d,f))}const u=yN(t,c,n.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}pu.id="lineAnnotation";const xb={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};pu.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},xb),fill:!1,length:12,start:Object.assign({},xb),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},hu.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};pu.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};pu.defaultRoutes={borderColor:"color"};function pN(e,{mouseX:t,mouseY:n},r,{hitSize:o,useFinalPosition:i}){const s=hN(t,n,e.getProps(["x","y","x2","y2"],i),r);return rE(s,o)||om(e,{mouseX:t,mouseY:n},i,r)}function gN({x:e,y:t,x2:n,y2:r},{top:o,right:i,bottom:s,left:a}){return!(e<a&&n<a||e>i&&n>i||t<o&&r<o||t>s&&r>s)}function wb({x:e,y:t},n,{top:r,right:o,bottom:i,left:s}){return e<s&&(t=mb(s,{x:e,y:t},n),e=s),e>o&&(t=mb(o,{x:e,y:t},n),e=o),t<r&&(e=nm(r,{x:e,y:t},n),t=r),t>i&&(e=nm(i,{x:e,y:t},n),t=i),{x:e,y:t}}function mN(e,t,n){const{x:r,y:o}=wb(e,t,n),{x:i,y:s}=wb(t,e,n);return{x:r,y:o,x2:i,y2:s,width:Math.abs(i-r),height:Math.abs(s-o)}}function vN(e,{mouseX:t,mouseY:n},r=us,o){const{x:i,y:s,x2:a,y2:l}=e.getProps(["x","y","x2","y2"],o),c=a-i,u=l-s,d=Wl(c)+Wl(u),f=d===0?-1:((t-i)*c+(n-s)*u)/d;let h,p;return f<0?(h=i,p=s):f>1?(h=a,p=l):(h=i+f*c,p=s+f*u),Wl(t-h)+Wl(n-p)<=r}function om(e,{mouseX:t,mouseY:n},r,o){const i=e.label;return i.options.display&&i.inRange(t,n,o,r)}function yN(e,t,n){const r=n.borderWidth,o=dh(n.padding),i=gh(e.ctx,n),s=i.width+o.width+r,a=i.height+o.height+r;return xN(t,n,{width:s,height:a,padding:o},e.chartArea)}function bN(e){const{x:t,y:n,x2:r,y2:o}=e,i=Math.atan2(o-n,r-t);return i>Cr/2?i-Cr:i<Cr/-2?i+Cr:i}function xN(e,t,n,r){const{width:o,height:i,padding:s}=n,{xAdjust:a,yAdjust:l}=t,c={x:e.x,y:e.y},u={x:e.x2,y:e.y2},d=t.rotation==="auto"?bN(e):To(t.rotation),f=wN(o,i,d),h=SN(e,t,{labelSize:f,padding:s},r),p=e.cp?rm(c,e.cp,u,h):d0(c,u,h),g={size:f.w,min:r.left,max:r.right,padding:s.left},m={size:f.h,min:r.top,max:r.bottom,padding:s.top},b=Cb(p.x,g)+a,y=Cb(p.y,m)+l;return{x:b-o/2,y:y-i/2,x2:b+o/2,y2:y+i/2,centerX:b,centerY:y,pointX:p.x,pointY:p.y,width:o,height:i,rotation:lI(d)}}function wN(e,t,n){const r=Math.cos(n),o=Math.sin(n);return{w:Math.abs(e*r)+Math.abs(t*o),h:Math.abs(e*o)+Math.abs(t*r)}}function SN(e,t,n,r){let o;const i=CN(e,r);return t.position==="start"?o=Sb({w:e.x2-e.x,h:e.y2-e.y},n,t,i):t.position==="end"?o=1-Sb({w:e.x-e.x2,h:e.y-e.y2},n,t,i):o=a0(1,t.position),o}function Sb(e,t,n,r){const{labelSize:o,padding:i}=t,s=e.w*r.dx,a=e.h*r.dy,l=s>0&&(o.w/2+i.left-r.x)/s,c=a>0&&(o.h/2+i.top-r.y)/a;return fh(Math.max(l,c),0,.25)}function CN(e,t){const{x:n,x2:r,y:o,y2:i}=e,s=Math.min(o,i)-t.top,a=Math.min(n,r)-t.left,l=t.bottom-Math.max(o,i),c=t.right-Math.max(n,r);return{x:Math.min(a,c),y:Math.min(s,l),dx:a<=c?1:-1,dy:s<=l?1:-1}}function Cb(e,t){const{size:n,min:r,max:o,padding:i}=t,s=n/2;return n>o-r?(o+r)/2:(r>=e-i-s&&(e=r+i+s),o<=e+i+s&&(e=o-i-s),e)}function EE(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,r=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:r,startAdjust:Eb(e,n),endAdjust:Eb(e,r)}}function Eb(e,t){if(!t||!t.display)return 0;const{length:n,width:r}=t,o=e.options.borderWidth/2,i={x:n,y:r+o};return Math.abs(nm(0,i,{x:0,y:o}))}function im(e,t,n,r){if(!r||!r.display)return;const{length:o,width:i,fill:s,backgroundColor:a,borderColor:l}=r,c=Math.abs(t-o)+n;e.beginPath(),il(e,r),wo(e,r),e.moveTo(c,-i),e.lineTo(t+n,0),e.lineTo(c,i),s===!0?(e.fillStyle=a||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=r.borderShadowColor,e.stroke()}function EN(e,t,n){const{x:r,y:o,x2:i,y2:s,centerX:a,centerY:l}=e,c=Math.atan2(s-o,i-r),u=l0(t.controlPoint,0),d={x:a+Mi(n,u.x,!1),y:l+Mi(n,u.y,!1)};return js(d,{x:a,y:l},c)}function kb(e,{x:t,y:n},{angle:r,adjust:o},i){!i||!i.display||(e.save(),e.translate(t,n),e.rotate(r),im(e,0,-o,i),e.restore())}function kN(e,t,n,r){const{x:o,y:i,x2:s,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=EE(t),h={x:o,y:i},p={x:s,y:a},g=bb(h,n,p,0),m=bb(h,n,p,1)-Cr,b=rm(h,n,p,d/r),y=rm(h,n,p,1-f/r),w=new Path2D;e.beginPath(),w.moveTo(b.x,b.y),w.quadraticCurveTo(n.x,n.y,y.x,y.y),e.shadowColor=l.borderShadowColor,e.stroke(w),t.path=w,t.ctx=e,kb(e,b,{angle:g,adjust:d},c),kb(e,y,{angle:m,adjust:f},u)}class gu extends Ls{inRange(t,n,r,o){const i=this.options.rotation,s=(this.options.borderWidth+this.options.hitTolerance)/2;if(r!=="x"&&r!=="y")return ON({x:t,y:n},this.getProps(["width","height","centerX","centerY"],o),i,s);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],o),d=r==="y"?{start:l,end:u}:{start:a,end:c},f=js({x:t,y:n},this.getCenterPoint(o),To(-i));return f[r]>=d.start-s-us&&f[r]<=d.end+s+us}getCenterPoint(t){return $s(this,t)}draw(t){const{width:n,height:r,centerX:o,centerY:i,options:s}=this;t.save(),ph(t,this.getCenterPoint(),s.rotation),il(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const a=wo(t,s);t.ellipse(o,i,r/2,n/2,Cr/2,0,2*Cr),t.fill(),a&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return wE(t,n)}}gu.id="ellipseAnnotation";gu.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},sl.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};gu.defaultRoutes={borderColor:"color",backgroundColor:"color"};gu.descriptors={label:{_fallback:!0}};function ON(e,t,n,r){const{width:o,height:i,centerX:s,centerY:a}=t,l=o/2,c=i/2;if(l<=0||c<=0)return!1;const u=To(n||0),d=Math.cos(u),f=Math.sin(u),h=Math.pow(d*(e.x-s)+f*(e.y-a),2),p=Math.pow(f*(e.x-s)-d*(e.y-a),2);return h/Math.pow(l+r,2)+p/Math.pow(c+r,2)<=1.0001}class vh extends Ls{inRange(t,n,r,o){const{x:i,y:s,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],o),u=(this.options.borderWidth+this.options.hitTolerance)/2;return r!=="x"&&r!=="y"?xI({x:t,y:n},this.getCenterPoint(o),c/2,u):rE(r==="y"?{start:s,end:l,value:n}:{start:i,end:a,value:t},u)}getCenterPoint(t){return $s(this,t)}draw(t){const n=this.options,r=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,il(t,n);const o=wo(t,n);_I(t,this,this.centerX,this.centerY),o&&!hh(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=r}resolveElementProperties(t,n){const r=xE(t,n);return r.initProperties=ol(t,r,n),r}}vh.id="pointAnnotation";vh.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};vh.defaultRoutes={borderColor:"color",backgroundColor:"color"};class yh extends Ls{inRange(t,n,r,o){if(r!=="x"&&r!=="y")return this.options.radius>=.1&&this.elements.length>1&&_N(this.elements,t,n,o);const i=js({x:t,y:n},this.getCenterPoint(o),To(-this.options.rotation)),s=this.elements.map(c=>r==="y"?c.bY:c.bX),a=Math.min(...s),l=Math.max(...s);return i[r]>=a&&i[r]<=l}getCenterPoint(t){return $s(this,t)}draw(t){const{elements:n,options:r}=this;t.save(),t.beginPath(),t.fillStyle=r.backgroundColor,il(t,r);const o=wo(t,r);let i=!0;for(const s of n)i?(t.moveTo(s.x,s.y),i=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),o&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const r=xE(t,n),{sides:o,rotation:i}=n,s=[],a=2*Cr/o;let l=i*QC;for(let c=0;c<o;c++,l+=a){const u=TN(r,n,l);u.initProperties=ol(t,r,n),s.push(u)}return r.elements=s,r}}yh.id="polygonAnnotation";yh.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};yh.defaultRoutes={borderColor:"color",backgroundColor:"color"};function TN({centerX:e,centerY:t},{radius:n,borderWidth:r,hitTolerance:o},i){const s=(r+o)/2,a=Math.sin(i),l=Math.cos(i),c={x:e+a*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+a*(n+s),bY:t-l*(n+s)}}}function _N(e,t,n,r){let o=!1,i=e[e.length-1].getProps(["bX","bY"],r);for(const s of e){const a=s.getProps(["bX","bY"],r);a.bY>n!=i.bY>n&&t<(i.bX-a.bX)*(n-a.bY)/(i.bY-a.bY)+a.bX&&(o=!o),i=a}return o}const wi={box:sl,doughnutLabel:mh,ellipse:gu,label:hu,line:pu,point:vh,polygon:yh};Object.keys(wi).forEach(e=>{cI.describe(`elements.${wi[e].id}`,{_fallback:"plugins.annotation.common"})});const MN={update:Object.assign},DN=u0.concat(cf),Ob=(e,t)=>Ia(t)?am(e,t):e,sm=e=>e==="color"||e==="font";function f0(e="line"){return wi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function RN(e,t,n,r){const o=NN(e,n.animations,r),i=t.annotations,s=LN(t.elements,i);for(let a=0;a<i.length;a++){const l=i[a],c=kE(s,a,l.type),u=l.setContext(AN(e,c,s,l)),d=c.resolveElementProperties(e,u);d.skip=IN(d),"elements"in d&&(PN(c,d.elements,u,o),delete d.elements),xo(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=OE(u),o.update(c,d)}}function IN(e){return isNaN(e.x)||isNaN(e.y)}function NN(e,t,n){return n==="reset"||n==="none"||n==="resize"?MN:new aI(e,t)}function PN(e,t,n,r){const o=e.elements||(e.elements=[]);o.length=t.length;for(let i=0;i<t.length;i++){const s=t[i],a=s.properties,l=kE(o,i,s.type,s.initProperties),c=n[s.optionScope].override(s);a.options=OE(c),r.update(l,a)}}function kE(e,t,n,r){const o=wi[f0(n)];let i=e[t];return(!i||!(i instanceof o))&&(i=e[t]=new o,Object.assign(i,r)),i}function OE(e){const t=wi[f0(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,am(e,t.defaults),am(e,t.defaultRoutes));for(const r of DN)n[r]=e[r];return n}function am(e,t){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r];sm(r)&&Na(i)?n[r]=i.map(s=>Ob(s,o)):n[r]=Ob(i,o)}return n}function AN(e,t,n,r){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(o=>o&&o.options)},id:r.id,type:"annotation"}))}function LN(e,t){const n=t.length,r=e.length;if(r<n){const o=n-r;e.splice(r,0,...new Array(o))}else r>n&&e.splice(n,r-n);return e}var jN="3.1.0";const Jo=new Map,Tb=e=>e.type!=="doughnutLabel",$N=u0.concat(cf);var yhe={id:"annotation",version:jN,beforeRegister(){wI("chart.js","4.0",Cp.version)},afterRegister(){Cp.register(wi)},afterUnregister(){Cp.unregister(wi)},beforeInit(e){Jo.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const r=Jo.get(e),o=r.annotations=[];let i=n.annotations;Ia(i)?Object.keys(i).forEach(s=>{const a=i[s];Ia(a)&&(a.id=s,o.push(a))}):Na(i)&&o.push(...i),tN(o.filter(Tb),e.scales)},afterDataLimits(e,t){const n=Jo.get(e);eN(e,t.scale,n.annotations.filter(Tb).filter(r=>r.display&&r.adjustScaleRange))},afterUpdate(e,t,n){const r=Jo.get(e);YI(e,r,n),RN(e,r,n,t.mode),r.visibleElements=r.elements.filter(o=>!o.skip&&o.options.display),QI(e,r,n)},beforeDatasetsDraw(e,t,n){_l(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){_l(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){_l(e,t.index,n.clip)},beforeDraw(e,t,n){_l(e,"beforeDraw",n.clip)},afterDraw(e,t,n){_l(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const r=Jo.get(e);XI(r,t.event,n)&&(t.changed=!0)},afterDestroy(e){Jo.delete(e)},getAnnotations(e){const t=Jo.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return s0(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!$N.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${wi[f0(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:sm,_fallback:!0},_indexable:sm}},additionalOptionScopes:[""]};function _l(e,t,n){const{ctx:r,chartArea:o}=e,i=Jo.get(e);n&&nI(r,o);const s=zN(i.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of s)BN(r,o,i,a);n&&rI(r)}function zN(e,t){const n=[];for(const r of e)if(r.options.drawTime===t&&n.push({element:r,main:!0}),r.elements&&r.elements.length)for(const o of r.elements)o.options.display&&o.options.drawTime===t&&n.push({element:o});return n}function BN(e,t,n,r){const o=r.element;r.main?(hb(n,o,"beforeDraw"),o.draw(e,t),hb(n,o,"afterDraw")):o.draw(e,t)}function TE(e){let t=null;return()=>(t==null&&(t=e()),t)}function FN(e,t){return e.filter(n=>n!==t)}function HN(e,t){const n=new Set,r=i=>n.add(i);e.forEach(r),t.forEach(r);const o=[];return n.forEach(i=>o.push(i)),o}class VN{enter(t){const n=this.entered.length,r=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(t));return this.entered=HN(this.entered.filter(r),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=FN(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class WN{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const _E="__NATIVE_FILE__",ME="__NATIVE_URL__",DE="__NATIVE_TEXT__",RE="__NATIVE_HTML__",_b=Object.freeze(Object.defineProperty({__proto__:null,FILE:_E,HTML:RE,TEXT:DE,URL:ME},Symbol.toStringTag,{value:"Module"}));function Tp(e,t,n){const r=t.reduce((o,i)=>o||e.getData(i),"");return r??n}const lm={[_E]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[RE]:{exposeProperties:{html:(e,t)=>Tp(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[ME]:{exposeProperties:{urls:(e,t)=>Tp(e,t,"").split(`
7
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[DE]:{exposeProperties:{text:(e,t)=>Tp(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function UN(e,t){const n=lm[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new WN(n);return r.loadDataTransfer(t),r}function _p(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(lm).filter(n=>{const r=lm[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(o=>t.indexOf(o)>-1):!1})[0]||null}const qN=TE(()=>/firefox/i.test(navigator.userAgent)),IE=TE(()=>!!window.safari);class Mb{interpolate(t){const{xs:n,ys:r,c1s:o,c2s:i,c3s:s}=this;let a=n.length-1;if(t===n[a])return r[a];let l=0,c=s.length-1,u;for(;l<=c;){u=Math.floor(.5*(l+c));const h=n[u];if(h<t)l=u+1;else if(h>t)c=u-1;else return r[u]}a=Math.max(0,c);const d=t-n[a],f=d*d;return r[a]+o[a]*d+i[a]*f+s[a]*d*f}constructor(t,n){const{length:r}=t,o=[];for(let h=0;h<r;h++)o.push(h);o.sort((h,p)=>t[h]<t[p]?-1:1);const i=[],s=[];let a,l;for(let h=0;h<r-1;h++)a=t[h+1]-t[h],l=n[h+1]-n[h],i.push(a),s.push(l/a);const c=[s[0]];for(let h=0;h<i.length-1;h++){const p=s[h],g=s[h+1];if(p*g<=0)c.push(0);else{a=i[h];const m=i[h+1],b=a+m;c.push(3*b/((b+m)/p+(b+a)/g))}}c.push(s[s.length-1]);const u=[],d=[];let f;for(let h=0;h<c.length-1;h++){f=s[h];const p=c[h],g=1/i[h],m=p+c[h+1]-f-f;u.push((f-p-m)*g),d.push(m*g*g)}this.xs=t,this.ys=n,this.c1s=c,this.c2s=u,this.c3s=d}}const KN=1;function NE(e){const t=e.nodeType===KN?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Vu(e){return{x:e.clientX,y:e.clientY}}function GN(e){var t;return e.nodeName==="IMG"&&(qN()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function YN(e,t,n,r){let o=e?t.width:n,i=e?t.height:r;return IE()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}function XN(e,t,n,r,o){const i=GN(t),a=NE(i?e:t),l={x:n.x-a.x,y:n.y-a.y},{offsetWidth:c,offsetHeight:u}=e,{anchorX:d,anchorY:f}=r,{dragPreviewWidth:h,dragPreviewHeight:p}=YN(i,t,c,u),g=()=>{let E=new Mb([0,.5,1],[l.y,l.y/u*p,l.y+p-u]).interpolate(f);return IE()&&i&&(E+=(window.devicePixelRatio-1)*p),E},m=()=>new Mb([0,.5,1],[l.x,l.x/c*h,l.x+h-c]).interpolate(d),{offsetX:b,offsetY:y}=o,w=b===0||b,S=y===0||y;return{x:w?b:m(),y:S?y:g()}}class JN{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}}function ZN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Db(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){ZN(e,o,n[o])})}return e}class QN{profile(){var t,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,r){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,r);const o=s=>this.handleDragStart(s,t),i=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const r=s=>this.handleDragEnter(s,t),o=s=>this.handleDragOver(s,t),i=s=>this.handleDrop(s,t);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(t);return Db({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);return Db({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(_b).some(n=>_b[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=UN(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const i=this.sourceNodes.get(o);return i&&NE(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const s=Vu(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:a}=o,l=_p(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),f=this.sourcePreviewNodes.get(u)||d;if(f){const{anchorX:h,anchorY:p,offsetX:g,offsetY:m}=this.getCurrentSourcePreviewNodeOptions(),w=XN(d,f,s,{anchorX:h,anchorY:p},{offsetX:g,offsetY:m});a.setDragImage(f,w.x,w.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:a}=o,l=_p(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,i.length>0&&this.actions.hover(i,{clientOffset:Vu(o)}),i.some(a=>this.monitor.canDropOnTarget(a))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=Vu(o),this.scheduleHover(i),(i||[]).some(a=>this.monitor.canDropOnTarget(a))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;o.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}else _p(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:Vu(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const i=o.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(o.preventDefault(),i.dragDrop()))},this.options=new JN(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new VN(this.isNodeInDocument)}}const bhe=function(t,n,r){return new QN(t,n,r)},PE=x.createContext({dragDropManager:void 0});function Wn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Rb=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Ib=function(){return Math.random().toString(36).substring(7).split("").join(".")},Nb={INIT:"@@redux/INIT"+Ib(),REPLACE:"@@redux/REPLACE"+Ib()};function eP(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function AE(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Wn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Wn(1));return n(AE)(e,t)}if(typeof e!="function")throw new Error(Wn(2));var o=e,i=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Wn(3));return i}function d(g){if(typeof g!="function")throw new Error(Wn(4));if(l)throw new Error(Wn(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(Wn(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function f(g){if(!eP(g))throw new Error(Wn(7));if(typeof g.type>"u")throw new Error(Wn(8));if(l)throw new Error(Wn(9));try{l=!0,i=o(i,g)}finally{l=!1}for(var m=s=a,b=0;b<m.length;b++){var y=m[b];y()}return g}function h(g){if(typeof g!="function")throw new Error(Wn(10));o=g,f({type:Nb.REPLACE})}function p(){var g,m=d;return g={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(Wn(11));function w(){y.next&&y.next(u())}w();var S=m(w);return{unsubscribe:S}}},g[Rb]=function(){return this},g}return f({type:Nb.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:h},r[Rb]=p,r}function ve(e,t,...n){if(tP()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(t.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function tP(){return typeof process<"u"&&!0}function nP(e,t,n){return t.split(".").reduce((r,o)=>r&&r[o]?r[o]:n||null,e)}function rP(e,t){return e.filter(n=>n!==t)}function LE(e){return typeof e=="object"}function oP(e,t){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((i,s)=>{i===1&&o.push(s)}),o}function iP(e,t){return e.filter(n=>t.indexOf(n)>-1)}const h0="dnd-core/INIT_COORDS",bh="dnd-core/BEGIN_DRAG",p0="dnd-core/PUBLISH_DRAG_SOURCE",xh="dnd-core/HOVER",wh="dnd-core/DROP",Sh="dnd-core/END_DRAG";function Pb(e,t){return{type:h0,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const sP={type:h0,payload:{clientOffset:null,sourceClientOffset:null}};function aP(e){return function(n=[],r={publishSource:!0}){const{publishSource:o=!0,clientOffset:i,getSourceClientOffset:s}=r,a=e.getMonitor(),l=e.getRegistry();e.dispatch(Pb(i)),lP(n,a,l);const c=dP(n,a);if(c==null){e.dispatch(sP);return}let u=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");cP(s),u=s(c)}e.dispatch(Pb(i,u));const f=l.getSource(c).beginDrag(a,c);if(f==null)return;uP(f),l.pinSource(c);const h=l.getSourceType(c);return{type:bh,payload:{itemType:h,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!o}}}}function lP(e,t,n){ve(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){ve(n.getSource(r),"Expected sourceIds to be registered.")})}function cP(e){ve(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function uP(e){ve(LE(e),"Item must be an object.")}function dP(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function fP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){fP(e,o,n[o])})}return e}function pP(e){return function(n={}){const r=e.getMonitor(),o=e.getRegistry();gP(r),yP(r).forEach((s,a)=>{const l=mP(s,a,o,r),c={type:wh,payload:{dropResult:hP({},n,l)}};e.dispatch(c)})}}function gP(e){ve(e.isDragging(),"Cannot call drop while not dragging."),ve(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function mP(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;return vP(i),typeof i>"u"&&(i=t===0?{}:r.getDropResult()),i}function vP(e){ve(typeof e>"u"||LE(e),"Drop result must either be an object or undefined.")}function yP(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function bP(e){return function(){const n=e.getMonitor(),r=e.getRegistry();xP(n);const o=n.getSourceId();return o!=null&&(r.getSource(o,!0).endDrag(n,o),r.unpinSource()),{type:Sh}}}function xP(e){ve(e.isDragging(),"Cannot call endDrag while not dragging.")}function cm(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function wP(e){return function(n,{clientOffset:r}={}){SP(n);const o=n.slice(0),i=e.getMonitor(),s=e.getRegistry(),a=i.getItemType();return EP(o,s,a),CP(o,i,s),kP(o,i,s),{type:xh,payload:{targetIds:o,clientOffset:r||null}}}}function SP(e){ve(Array.isArray(e),"Expected targetIds to be an array.")}function CP(e,t,n){ve(t.isDragging(),"Cannot call hover while not dragging."),ve(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const o=e[r];ve(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(o);ve(i,"Expected targetIds to be registered.")}}function EP(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r],i=t.getTargetType(o);cm(i,n)||e.splice(r,1)}}function kP(e,t,n){e.forEach(function(r){n.getTarget(r).hover(t,r)})}function OP(e){return function(){if(e.getMonitor().isDragging())return{type:p0}}}function TP(e){return{beginDrag:aP(e),publishDragSource:OP(e),hover:wP(e),drop:pP(e),endDrag:bP(e)}}class _P{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function r(i){return(...s)=>{const a=i.apply(t,s);typeof a<"u"&&n(a)}}const o=TP(this);return Object.keys(o).reduce((i,s)=>{const a=o[s];return i[s]=r(a),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function MP(e,t){return{x:e.x+t.x,y:e.y+t.y}}function jE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function DP(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:jE(MP(t,r),n)}function RP(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:jE(t,n)}const yc=[],g0=[];yc.__IS_NONE__=!0;g0.__IS_ALL__=!0;function IP(e,t){return e===yc?!1:e===g0||typeof t>"u"?!0:iP(t,e).length>0}class NP{subscribeToStateChange(t,n={}){const{handlerIds:r}=n;ve(typeof t=="function","listener must be a function."),ve(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const i=()=>{const s=this.store.getState(),a=s.stateId;try{a===o||a===o+1&&!IP(s.dirtyHandlerIds,r)||t()}finally{o=a}};return this.store.subscribe(i)}subscribeToOffsetChange(t){ve(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const o=this.store.getState().dragOffset;o!==n&&(n=o,t())};return this.store.subscribe(r)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return ve(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(ve(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(t),o=this.getItemType();return cm(r,o)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(ve(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(t),o=this.getItemType();return r!==o?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();if(i&&!cm(o,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const a=s.indexOf(t);return r?a===s.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return DP(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return RP(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const Ab=typeof global<"u"?global:self,$E=Ab.MutationObserver||Ab.WebKitMutationObserver;function zE(e){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),e()}}}function PP(e){let t=1;const n=new $E(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const AP=typeof $E=="function"?PP:zE;let LP=class{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,o=t.length-this.index;r<o;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=AP(this.flush),this.requestErrorThrow=zE(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},jP=class{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}},$P=class{create(t){const n=this.freeTasks,r=n.length?n.pop():new jP(this.onError,o=>n[n.length]=o);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}};const BE=new LP,zP=new $P(BE.registerPendingError);function BP(e){BE.enqueueTask(zP.create(e))}const m0="dnd-core/ADD_SOURCE",v0="dnd-core/ADD_TARGET",y0="dnd-core/REMOVE_SOURCE",Ch="dnd-core/REMOVE_TARGET";function FP(e){return{type:m0,payload:{sourceId:e}}}function HP(e){return{type:v0,payload:{targetId:e}}}function VP(e){return{type:y0,payload:{sourceId:e}}}function WP(e){return{type:Ch,payload:{targetId:e}}}function UP(e){ve(typeof e.canDrag=="function","Expected canDrag to be a function."),ve(typeof e.beginDrag=="function","Expected beginDrag to be a function."),ve(typeof e.endDrag=="function","Expected endDrag to be a function.")}function qP(e){ve(typeof e.canDrop=="function","Expected canDrop to be a function."),ve(typeof e.hover=="function","Expected hover to be a function."),ve(typeof e.drop=="function","Expected beginDrag to be a function.")}function um(e,t){if(t&&Array.isArray(e)){e.forEach(n=>um(n,!1));return}ve(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Xn;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Xn||(Xn={}));let KP=0;function GP(){return KP++}function YP(e){const t=GP().toString();switch(e){case Xn.SOURCE:return`S${t}`;case Xn.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Lb(e){switch(e[0]){case"S":return Xn.SOURCE;case"T":return Xn.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function jb(e,t){const n=e.entries();let r=!1;do{const{done:o,value:[,i]}=n.next();if(i===t)return!0;r=!!o}while(!r);return!1}class XP{addSource(t,n){um(t),UP(n);const r=this.addHandler(Xn.SOURCE,t,n);return this.store.dispatch(FP(r)),r}addTarget(t,n){um(t,!0),qP(n);const r=this.addHandler(Xn.TARGET,t,n);return this.store.dispatch(HP(r)),r}containsHandler(t){return jb(this.dragSources,t)||jb(this.dropTargets,t)}getSource(t,n=!1){return ve(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return ve(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return ve(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return ve(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Lb(t)===Xn.SOURCE}isTargetId(t){return Lb(t)===Xn.TARGET}removeSource(t){ve(this.getSource(t),"Expected an existing source."),this.store.dispatch(VP(t)),BP(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){ve(this.getTarget(t),"Expected an existing target."),this.store.dispatch(WP(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);ve(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){ve(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,r){const o=YP(t);return this.types.set(o,n),t===Xn.SOURCE?this.dragSources.set(o,r):t===Xn.TARGET&&this.dropTargets.set(o,r),o}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const JP=(e,t)=>e===t;function ZP(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function QP(e,t,n=JP){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function eA(e=yc,t){switch(t.type){case xh:break;case m0:case v0:case Ch:case y0:return yc;case bh:case p0:case Sh:case wh:default:return g0}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=oP(n,r);if(!(o.length>0||!QP(n,r)))return yc;const s=r[r.length-1],a=n[n.length-1];return s!==a&&(s&&o.push(s),a&&o.push(a)),o}function tA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){tA(e,o,n[o])})}return e}const $b={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function rA(e=$b,t){const{payload:n}=t;switch(t.type){case h0:case bh:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case xh:return ZP(e.clientOffset,n.clientOffset)?e:nA({},e,{clientOffset:n.clientOffset});case Sh:case wh:return $b;default:return e}}function oA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){oA(e,o,n[o])})}return e}const iA={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function sA(e=iA,t){const{payload:n}=t;switch(t.type){case bh:return Xs({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case p0:return Xs({},e,{isSourcePublic:!0});case xh:return Xs({},e,{targetIds:n.targetIds});case Ch:return e.targetIds.indexOf(n.targetId)===-1?e:Xs({},e,{targetIds:rP(e.targetIds,n.targetId)});case wh:return Xs({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Sh:return Xs({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function aA(e=0,t){switch(t.type){case m0:case v0:return e+1;case y0:case Ch:return e-1;default:return e}}function lA(e=0){return e+1}function cA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){cA(e,o,n[o])})}return e}function dA(e={},t){return{dirtyHandlerIds:eA(e.dirtyHandlerIds,{type:t.type,payload:uA({},t.payload,{prevTargetIds:nP(e,"dragOperation.targetIds",[])})}),dragOffset:rA(e.dragOffset,t),refCount:aA(e.refCount,t),dragOperation:sA(e.dragOperation,t),stateId:lA(e.stateId)}}function fA(e,t=void 0,n={},r=!1){const o=hA(r),i=new NP(o,new XP(o)),s=new _P(o,i),a=e(s,t,n);return s.receiveBackend(a),s}function hA(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return AE(dA,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function pA(e,t){if(e==null)return{};var n=gA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}let zb=0;const Sd=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Che=x.memo(function(t){var{children:n}=t,r=pA(t,["children"]);const[o,i]=mA(r);return x.useEffect(()=>{if(i){const s=FE();return++zb,()=>{--zb===0&&(s[Sd]=null)}}},[]),v.jsx(PE.Provider,{value:o,children:n})});function mA(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=vA(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function vA(e,t=FE(),n,r){const o=t;return o[Sd]||(o[Sd]={dragDropManager:fA(e,t,n,r)}),o[Sd]}function FE(){return typeof global<"u"?global:window}const _s=typeof window<"u"?x.useLayoutEffect:x.useEffect;function yA(e,t,n){const[r,o]=x.useState(()=>t(e)),i=x.useCallback(()=>{const s=t(e);pI(r,s)||(o(s),n&&n())},[r,e,n]);return _s(i),[r,i]}function bA(e,t,n){const[r,o]=yA(e,t,n);return _s(function(){const s=e.getHandlerId();if(s!=null)return e.subscribeToStateChange(o,{handlerIds:[s]})},[e,o]),r}function HE(e,t,n){return bA(t,e||(()=>({})),()=>n.reconnect())}function VE(e,t){const n=[];return typeof e!="function"&&n.push(e),x.useMemo(()=>typeof e=="function"?e():e,n)}function xA(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function wA(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let Mp=!1,Dp=!1,SA=class{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){ve(!Mp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Mp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Mp=!1}}isDragging(){if(!this.sourceId)return!1;ve(!Dp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Dp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Dp=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}},Rp=!1,CA=class{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;ve(!Rp,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Rp=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Rp=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}};function EA(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}function kA(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}function dm(e,t,n,r){let o;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<i.length;l++){const c=i[l];if(!a(c))return!1;const u=e[c],d=t[c];if(o=void 0,o===!1||o===void 0&&u!==d)return!1}return!0}function fm(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OA(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function TA(e){return(t=null,n=null)=>{if(!x.isValidElement(t)){const i=t;return e(i,n),i}const r=t;return OA(r),_A(r,n?i=>e(i,n):e)}}function WE(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const o=TA(r);t[n]=()=>o}}),t}function Bb(e,t){typeof e=="function"?e(t):e.current=t}function _A(e,t){const n=e.ref;return ve(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?x.cloneElement(e,{ref:r=>{Bb(n,r),Bb(t,r)}}):x.cloneElement(e,{ref:t})}let MA=class{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!dm(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!dm(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=WE({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,fm(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,fm(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}},DA=class{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!dm(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=WE({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,fm(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}};function al(){const{dragDropManager:e}=x.useContext(PE);return ve(e!=null,"Expected drag drop context"),e}function RA(e,t){const n=al(),r=x.useMemo(()=>new MA(n.getBackend()),[n]);return _s(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),_s(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function IA(){const e=al();return x.useMemo(()=>new SA(e),[e])}let NA=class{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return typeof t.item=="object"?r=t.item:typeof t.item=="function"?r=t.item(n):r={},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const r=this.spec,o=this.monitor,{isDragging:i}=r;return i?i(o):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:o}=t;o&&o(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}};function PA(e,t,n){const r=x.useMemo(()=>new NA(e,t,n),[t,n]);return x.useEffect(()=>{r.spec=e},[e]),r}function AA(e){return x.useMemo(()=>{const t=e.type;return ve(t!=null,"spec.type must be defined"),t},[e])}function LA(e,t,n){const r=al(),o=PA(e,t,n),i=AA(e);_s(function(){if(i!=null){const[a,l]=kA(i,o,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,t,n,o,i])}function jA(e,t){const n=VE(e);ve(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=IA(),o=RA(n.options,n.previewOptions);return LA(n,r,o),[HE(n.collect,r,o),xA(o),wA(o)]}function $A(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function zA(e){const t=al(),n=x.useMemo(()=>new DA(t.getBackend()),[t]);return _s(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function BA(){const e=al();return x.useMemo(()=>new CA(e),[e])}function FA(e){const{accept:t}=e;return x.useMemo(()=>(ve(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}let HA=class{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}};function VA(e,t){const n=x.useMemo(()=>new HA(e,t),[t]);return x.useEffect(()=>{n.spec=e},[e]),n}function WA(e,t,n){const r=al(),o=VA(e,t),i=FA(e);_s(function(){const[a,l]=EA(i,o,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,t,o,n,i.map(s=>s.toString()).join("|")])}function UA(e,t){const n=VE(e),r=BA(),o=zA(n.options);return WA(n,r,o),[HE(n.collect,r,o),$A(o)]}var xn={},qA=Object.defineProperty,UE=e=>{throw TypeError(e)},KA=(e,t,n)=>t in e?qA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wn=(e,t,n)=>KA(e,typeof t!="symbol"?t+"":t,n),qE=(e,t,n)=>t.has(e)||UE("Cannot "+n),xe=(e,t,n)=>(qE(e,t,"read from private field"),n?n.call(e):t.get(e)),io=(e,t,n)=>t.has(e)?UE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),He=(e,t,n,r)=>(qE(e,t,"write to private field"),t.set(e,n),n),Wu,Ml,_t,zo,Js,Ar,mt,Bo,Zs,Ip,hm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KE(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var GE={exports:{}};/*!
8
+ Copyright (c) 2018 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(GE);var YE=GE.exports;const oe=_o(YE);var di=(e=>(e.TEXT="Text",e.BUTTON="Button",e.DROP_DOWN_BUTTON="DropDownButton",e.COMPONENT="Component",e))(di||{}),Vt=(e=>(e.FIRST="first",e.MIDDLE="middle",e.LAST="last",e))(Vt||{}),li=(e=>(e.DANGER="danger",e.RED="red",e.WHITE="white",e.SUCCESS="success",e.GREEN="green",e.MUTED="muted",e))(li||{}),Xt=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e))(Xt||{}),b0=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(b0||{}),Ce=(e=>(e.LIBRARY="library",e.ADD="add",e.DRAG="drag",e.HELP="help",e.NOTIFICATION="notification",e.MENU="menu",e.EDIT="edit",e.FAST_FORWARD="fast forward",e.INDENT="indent",e.STAR="star",e.LIST="list",e.SETTINGS="settings",e.CHECK="check",e.LOCK="lock",e.UNLOCK="unlock",e.CLOSE="close",e.SUCCESS="success",e.WARNING="warning",e.ERROR="error",e.INFO="info",e.LEFT="left",e.COLLAPSE="collapse",e.EXPAND="expand",e.SORT_ASCENDING="sort ascending",e.SORT_DESCENDING="sort descending",e.FAST_BACKWARD="fast backward",e.CHEVRON_DOWN="chevron down",e.CHEVRON_RIGHT="chevron right",e.CHEVRON_LEFT="chevron left",e.CHEVRON_DOUBLE_LEFT="chevron double left",e.CHEVRON_DOUBLE_RIGHT="chevron double right",e))(Ce||{}),XE=(e=>(e.TEXT="text",e.RADIO="radio",e.CHECKBOX="checkbox",e))(XE||{});function JE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Di(){return Di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Di.apply(null,arguments)}const GA=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Di}},Symbol.toStringTag,{value:"Module"}));function pm(e,t){return pm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},pm(e,t)}function ZE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pm(e,t)}var gm=function(e,t){return gm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},gm(e,t)};function QE(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var q=function(){return q=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},q.apply(this,arguments)};function ir(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ct(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function $n(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}/*!
12
+ * content-type
13
+ * Copyright(c) 2015 Douglas Christopher Wilson
14
+ * MIT Licensed
15
+ */var Fb=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,YA=/\\([\u000b\u0020-\u00ff])/g,XA=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,JA=ZA;function ZA(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?QA(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=n!==-1?t.slice(0,n).trim():t.trim();if(!XA.test(r))throw new TypeError("invalid media type");var o=new eL(r.toLowerCase());if(n!==-1){var i,s,a;for(Fb.lastIndex=n;s=Fb.exec(t);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,i=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(YA,"$1"))),o.parameters[i]=a}if(n!==t.length)throw new TypeError("invalid parameter format")}return o}function QA(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function eL(e){this.parameters=Object.create(null),this.type=e}var ca=new Map,ek=function(t){return t.cloneNode(!0)},Hb=function(){return window.location.protocol==="file:"},tk=function(t,n,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&o.readyState===2){var i=o.getResponseHeader("Content-Type");if(!i)throw new Error("Content type not found");var s=JA(i).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(o.readyState===4){if(o.status===404||o.responseXML===null)throw new Error(Hb()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(o.status===200||Hb()&&o.status===0)r(null,o);else throw new Error("There was a problem injecting the SVG: "+o.status+" "+o.statusText)}}catch(a){if(o.abort(),a instanceof Error)r(a,o);else throw a}},o.open("GET",t),o.withCredentials=n,o.overrideMimeType&&o.overrideMimeType("text/xml"),o.send()},ci={},Vb=function(t,n){ci[t]=ci[t]||[],ci[t].push(n)},tL=function(t){for(var n=function(s,a){setTimeout(function(){if(Array.isArray(ci[t])){var l=ca.get(t),c=ci[t][s];l instanceof SVGSVGElement&&c(null,ek(l)),l instanceof Error&&c(l),s===ci[t].length-1&&delete ci[t]}},0)},r=0,o=ci[t].length;r<o;r++)n(r)},nL=function(t,n,r){if(ca.has(t)){var o=ca.get(t);if(o===void 0){Vb(t,r);return}if(o instanceof SVGSVGElement){r(null,ek(o));return}}ca.set(t,void 0),Vb(t,r),tk(t,n,function(i,s){var a;i?ca.set(t,i):((a=s.responseXML)===null||a===void 0?void 0:a.documentElement)instanceof SVGSVGElement&&ca.set(t,s.responseXML.documentElement),tL(t)})},rL=function(t,n,r){tk(t,n,function(o,i){var s;o?r(o):((s=i.responseXML)===null||s===void 0?void 0:s.documentElement)instanceof SVGSVGElement&&r(null,i.responseXML.documentElement)})},oL=0,iL=function(){return++oL},Lr=[],Wb={},sL="http://www.w3.org/2000/svg",Np="http://www.w3.org/1999/xlink",Ub=function(t,n,r,o,i,s,a){var l=t.getAttribute("data-src")||t.getAttribute("src");if(!l){a(new Error("Invalid data-src or src attribute"));return}if(Lr.indexOf(t)!==-1){Lr.splice(Lr.indexOf(t),1),t=null;return}Lr.push(t),t.setAttribute("src","");var c=o?nL:rL;c(l,i,function(u,d){if(!d){Lr.splice(Lr.indexOf(t),1),t=null,a(u);return}var f=t.getAttribute("id");f&&d.setAttribute("id",f);var h=t.getAttribute("title");h&&d.setAttribute("title",h);var p=t.getAttribute("width");p&&d.setAttribute("width",p);var g=t.getAttribute("height");g&&d.setAttribute("height",g);var m=Array.from(new Set($n($n($n([],(d.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(t.getAttribute("class")||"").split(" "),!0))).join(" ").trim();d.setAttribute("class",m);var b=t.getAttribute("style");b&&d.setAttribute("style",b),d.setAttribute("data-src",l);var y=[].filter.call(t.attributes,function(z){return/^data-\w[\w-]*$/.test(z.name)});if(Array.prototype.forEach.call(y,function(z){z.name&&z.value&&d.setAttribute(z.name,z.value)}),r){var w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,C,E,k,_;Object.keys(w).forEach(function(z){S=z,E=w[z],C=d.querySelectorAll(S+"[id]");for(var F=function(W,L){k=C[W].id,_=k+"-"+iL();var P;Array.prototype.forEach.call(E,function(Ot){P=d.querySelectorAll("["+Ot+'*="'+k+'"]');for(var Ue=0,it=P.length;Ue<it;Ue++){var st=P[Ue].getAttribute(Ot);st&&!st.match(new RegExp('url\\("?#'+k+'"?\\)'))||P[Ue].setAttribute(Ot,"url(#"+_+")")}});for(var j=d.querySelectorAll("[*|href]"),Y=[],re=0,se=j.length;re<se;re++){var ie=j[re].getAttributeNS(Np,"href");ie&&ie.toString()==="#"+C[W].id&&Y.push(j[re])}for(var _e=0,Me=Y.length;_e<Me;_e++)Y[_e].setAttributeNS(Np,"href","#"+_);C[W].id=_},V=0,ee=C.length;V<ee;V++)F(V)})}d.removeAttribute("xmlns:a");for(var T=d.querySelectorAll("script"),D=[],O,M,R=0,I=T.length;R<I;R++)M=T[R].getAttribute("type"),(!M||M==="application/ecmascript"||M==="application/javascript"||M==="text/javascript")&&(O=T[R].innerText||T[R].textContent,O&&D.push(O),d.removeChild(T[R]));if(D.length>0&&(n==="always"||n==="once"&&!Wb[l])){for(var N=0,$=D.length;N<$;N++)new Function(D[N])(window);Wb[l]=!0}var A=d.querySelectorAll("style");if(Array.prototype.forEach.call(A,function(z){z.textContent+=""}),d.setAttribute("xmlns",sL),d.setAttribute("xmlns:xlink",Np),s(d),!t.parentNode){Lr.splice(Lr.indexOf(t),1),t=null,a(new Error("Parent node is null"));return}t.parentNode.replaceChild(d,t),Lr.splice(Lr.indexOf(t),1),t=null,a(null,d)})},aL=function(t,n){var r=n===void 0?{}:n,o=r.afterAll,i=o===void 0?function(){}:o,s=r.afterEach,a=s===void 0?function(){}:s,l=r.beforeEach,c=l===void 0?function(){}:l,u=r.cacheRequests,d=u===void 0?!0:u,f=r.evalScripts,h=f===void 0?"never":f,p=r.httpRequestWithCredentials,g=p===void 0?!1:p,m=r.renumerateIRIElements,b=m===void 0?!0:m;if(t&&"length"in t)for(var y=0,w=0,S=t.length;w<S;w++)Ub(t[w],h,b,d,g,c,function(C,E){a(C,E),t&&"length"in t&&t.length===++y&&i(y)});else t?Ub(t,h,b,d,g,c,function(C,E){a(C,E),i(1),t=null}):i(0)},lL=function(t){var n=(t==null?void 0:t.ownerDocument)||document;return n.defaultView||window},cL=function(t,n){for(var r in t)if(!(r in n))return!0;for(var o in n)if(t[o]!==n[o])return!0;return!1},uL=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Uu="http://www.w3.org/2000/svg",qb="http://www.w3.org/1999/xlink",x0=function(e){function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(a){r.reactWrapper=a},r}ZE(t,e);var n=t.prototype;return n.renderSVG=function(){var o=this;if(this.reactWrapper instanceof lL(this.reactWrapper).Node){var i=this.props,s=i.desc,a=i.evalScripts,l=i.httpRequestWithCredentials,c=i.renumerateIRIElements,u=i.src,d=i.title,f=i.useRequestCache,h=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,m=this.props.wrapper,b,y;m==="svg"?(b=document.createElementNS(Uu,m),b.setAttribute("xmlns",Uu),b.setAttribute("xmlns:xlink",qb),y=document.createElementNS(Uu,m)):(b=document.createElement(m),y=document.createElement(m)),b.appendChild(y),y.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(b);var w=function(k){if(o.removeSVG(),!o._isMounted){h(k);return}o.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(k)})},S=function(k,_){if(k){w(k);return}o._isMounted&&o.setState(function(){return{isLoading:!1}},function(){try{g(_)}catch(T){w(T)}})},C=function(k){if(k.setAttribute("role","img"),s){var _=k.querySelector(":scope > desc");_&&k.removeChild(_);var T=document.createElement("desc");T.innerHTML=s,k.prepend(T)}if(d){var D=k.querySelector(":scope > title");D&&k.removeChild(D);var O=document.createElement("title");O.innerHTML=d,k.prepend(O)}try{p(k)}catch(M){w(M)}};aL(y,{afterEach:S,beforeEach:C,cacheRequests:f,evalScripts:a,httpRequestWithCredentials:l,renumerateIRIElements:c})}},n.removeSVG=function(){var o;(o=this.nonReactWrapper)!=null&&o.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(o){var i=this;cL(Di({},o),this.props)&&this.setState(function(){return i.initialState},function(){i.removeSVG(),i.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var o=this.props;o.afterInjection,o.beforeInjection,o.desc,o.evalScripts;var i=o.fallback;o.httpRequestWithCredentials;var s=o.loading;o.renumerateIRIElements,o.src,o.title,o.useRequestCache;var a=o.wrapper,l=JE(o,uL),c=a;return x.createElement(c,Di({},l,{ref:this.refCallback},a==="svg"?{xmlns:Uu,xmlnsXlink:qb}:{}),this.state.isLoading&&s&&x.createElement(s,null),this.state.hasError&&i&&x.createElement(i,null))},t}(x.Component);x0.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};x0.propTypes={afterInjection:gt.func,beforeInjection:gt.func,desc:gt.string,evalScripts:gt.oneOf(["always","once","never"]),fallback:gt.oneOfType([gt.func,gt.object,gt.string]),httpRequestWithCredentials:gt.bool,loading:gt.oneOfType([gt.func,gt.object,gt.string]),onError:gt.func,renumerateIRIElements:gt.bool,src:gt.string.isRequired,title:gt.string,useRequestCache:gt.bool,wrapper:gt.oneOf(["div","span","svg"])};const ht=U.createContext(!1),dL="_wrapper_18jt2_1",fL="_customSvg_18jt2_8",hL="_customPng_18jt2_11",pL="_clickable_18jt2_16",qu={wrapper:dL,customSvg:fL,customPng:hL,clickable:pL};var nk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Kb=U.createContext&&U.createContext(nk),Si=function(){return Si=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Si.apply(this,arguments)},gL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function rk(e){return e&&e.map(function(t,n){return U.createElement(t.tag,Si({key:n},t.attr),rk(t.child))})}function H(e){return function(t){return U.createElement(mL,Si({attr:Si({},e.attr)},t),rk(e.child))}}function mL(e){var t=function(n){var r=e.attr,o=e.size,i=e.title,s=gL(e,["attr","size","title"]),a=o||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),U.createElement("svg",Si({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Si(Si({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&U.createElement("title",null,i),e.children)};return Kb!==void 0?U.createElement(Kb.Consumer,null,function(n){return t(n)}):t(nk)}function vL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 9v4"}},{tag:"path",attr:{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z"}},{tag:"path",attr:{d:"M12 16h.01"}}]})(e)}function yL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 5l0 14"}},{tag:"path",attr:{d:"M18 13l-6 6"}},{tag:"path",attr:{d:"M6 13l6 6"}}]})(e)}function bL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 12l14 0"}},{tag:"path",attr:{d:"M5 12l6 6"}},{tag:"path",attr:{d:"M5 12l6 -6"}}]})(e)}function xL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 12l14 0"}},{tag:"path",attr:{d:"M13 18l6 -6"}},{tag:"path",attr:{d:"M13 6l6 6"}}]})(e)}function wL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 5l0 14"}},{tag:"path",attr:{d:"M18 11l-6 -6"}},{tag:"path",attr:{d:"M6 11l6 -6"}}]})(e)}function SL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M16 4l4 0l0 4"}},{tag:"path",attr:{d:"M14 10l6 -6"}},{tag:"path",attr:{d:"M8 20l-4 0l0 -4"}},{tag:"path",attr:{d:"M4 20l6 -6"}}]})(e)}function CL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M16 4l4 0l0 4"}},{tag:"path",attr:{d:"M14 10l6 -6"}},{tag:"path",attr:{d:"M8 20l-4 0l0 -4"}},{tag:"path",attr:{d:"M4 20l6 -6"}},{tag:"path",attr:{d:"M16 20l4 0l0 -4"}},{tag:"path",attr:{d:"M14 14l6 6"}},{tag:"path",attr:{d:"M8 4l-4 0l0 4"}},{tag:"path",attr:{d:"M4 4l6 6"}}]})(e)}function EL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 9l4 0l0 -4"}},{tag:"path",attr:{d:"M3 3l6 6"}},{tag:"path",attr:{d:"M5 15l4 0l0 4"}},{tag:"path",attr:{d:"M3 21l6 -6"}},{tag:"path",attr:{d:"M19 9l-4 0l0 -4"}},{tag:"path",attr:{d:"M15 9l6 -6"}},{tag:"path",attr:{d:"M19 15l-4 0l0 4"}},{tag:"path",attr:{d:"M15 15l6 6"}}]})(e)}function kL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M18 9l3 3l-3 3"}},{tag:"path",attr:{d:"M15 12h6"}},{tag:"path",attr:{d:"M6 9l-3 3l3 3"}},{tag:"path",attr:{d:"M3 12h6"}},{tag:"path",attr:{d:"M9 18l3 3l3 -3"}},{tag:"path",attr:{d:"M12 15v6"}},{tag:"path",attr:{d:"M15 6l-3 -3l-3 3"}},{tag:"path",attr:{d:"M12 3v6"}}]})(e)}function OL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M21 17h-8l-3.5 -5h-6.5"}},{tag:"path",attr:{d:"M21 7h-8l-3.495 5"}},{tag:"path",attr:{d:"M18 10l3 -3l-3 -3"}},{tag:"path",attr:{d:"M18 20l3 -3l-3 -3"}}]})(e)}function TL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6"}},{tag:"path",attr:{d:"M9 17v1a3 3 0 0 0 6 0v-1"}}]})(e)}function _L(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}},{tag:"path",attr:{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"}}]})(e)}function ML(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"}}]})(e)}function DL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z"}},{tag:"path",attr:{d:"M19 16h-12a2 2 0 0 0 -2 2"}},{tag:"path",attr:{d:"M9 8h6"}}]})(e)}function RL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 21l18 0"}},{tag:"path",attr:{d:"M9 8l1 0"}},{tag:"path",attr:{d:"M9 12l1 0"}},{tag:"path",attr:{d:"M9 16l1 0"}},{tag:"path",attr:{d:"M14 8l1 0"}},{tag:"path",attr:{d:"M14 12l1 0"}},{tag:"path",attr:{d:"M14 16l1 0"}},{tag:"path",attr:{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16"}}]})(e)}function IL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2"}},{tag:"path",attr:{d:"M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"}}]})(e)}function NL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M9 8m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M15 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M4 20l14 0"}}]})(e)}function PL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 19l16 0"}},{tag:"path",attr:{d:"M4 15l4 -6l4 2l4 -5l4 4"}}]})(e)}function AL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 3v9h9"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}}]})(e)}function LL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 12l5 5l10 -10"}}]})(e)}function jL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M6 9l6 6l6 -6"}}]})(e)}function $L(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M15 6l-6 6l6 6"}}]})(e)}function zL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 6l6 6l-6 6"}}]})(e)}function BL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M6 15l6 -6l6 6"}}]})(e)}function FL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M11 7l-5 5l5 5"}},{tag:"path",attr:{d:"M17 7l-5 5l5 5"}}]})(e)}function HL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 7l5 5l-5 5"}},{tag:"path",attr:{d:"M13 7l5 5l-5 5"}}]})(e)}function VL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}},{tag:"path",attr:{d:"M9 12l2 2l4 -4"}}]})(e)}function WL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}},{tag:"path",attr:{d:"M10 10l4 4m0 -4l-4 4"}}]})(e)}function UL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}}]})(e)}function qL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"}},{tag:"path",attr:{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"}}]})(e)}function KL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}},{tag:"path",attr:{d:"M12 7v5l3 3"}}]})(e)}function GL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 8l-4 4l4 4"}},{tag:"path",attr:{d:"M17 8l4 4l-4 4"}},{tag:"path",attr:{d:"M14 4l-4 16"}}]})(e)}function YL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}},{tag:"path",attr:{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"}}]})(e)}function XL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M6 6v6a3 3 0 0 0 3 3h10l-4 -4m0 8l4 -4"}}]})(e)}function JL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"}},{tag:"path",attr:{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}},{tag:"path",attr:{d:"M14 4l0 4l-6 0l0 -4"}}]})(e)}function ZL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 19l18 0"}},{tag:"path",attr:{d:"M5 6m0 1a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1z"}}]})(e)}function QL(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}}]})(e)}function ej(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}},{tag:"path",attr:{d:"M7 11l5 5l5 -5"}},{tag:"path",attr:{d:"M12 4l0 12"}}]})(e)}function tj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7.502 19.423c2.602 2.105 6.395 2.105 8.996 0c2.602 -2.105 3.262 -5.708 1.566 -8.546l-4.89 -7.26c-.42 -.625 -1.287 -.803 -1.936 -.397a1.376 1.376 0 0 0 -.41 .397l-4.893 7.26c-1.695 2.838 -1.035 6.441 1.567 8.546z"}}]})(e)}function nj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 19v.01"}},{tag:"path",attr:{d:"M12 15v-10"}}]})(e)}function rj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6"}},{tag:"path",attr:{d:"M11 13l9 -9"}},{tag:"path",attr:{d:"M15 4h5v5"}}]})(e)}function oj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}},{tag:"path",attr:{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}},{tag:"path",attr:{d:"M3 3l18 18"}}]})(e)}function ij(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}},{tag:"path",attr:{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"}}]})(e)}function sj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M14 3v4a1 1 0 0 0 1 1h4"}},{tag:"path",attr:{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}}]})(e)}function aj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M8 4h12v2.172a2 2 0 0 1 -.586 1.414l-3.914 3.914m-.5 3.5v4l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227"}},{tag:"path",attr:{d:"M3 3l18 18"}}]})(e)}function lj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"}}]})(e)}function cj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}},{tag:"path",attr:{d:"M4 16v2a2 2 0 0 0 2 2h2"}},{tag:"path",attr:{d:"M16 4h2a2 2 0 0 1 2 2v2"}},{tag:"path",attr:{d:"M16 20h2a2 2 0 0 0 2 -2v-2"}}]})(e)}function uj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M11 19h-6a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2.5"}},{tag:"path",attr:{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}},{tag:"path",attr:{d:"M20.2 20.2l1.8 1.8"}}]})(e)}function dj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2"}}]})(e)}function fj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}},{tag:"path",attr:{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M13.41 10.59l2.59 -2.59"}},{tag:"path",attr:{d:"M7 12a5 5 0 0 1 5 -5"}}]})(e)}function hj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}},{tag:"path",attr:{d:"M7 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}},{tag:"path",attr:{d:"M17 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}},{tag:"path",attr:{d:"M7 8v2a2 2 0 0 0 2 2h6a2 2 0 0 0 2 -2v-2"}},{tag:"path",attr:{d:"M12 12l0 4"}}]})(e)}function pj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}}]})(e)}function gj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}},{tag:"path",attr:{d:"M12 17l0 .01"}},{tag:"path",attr:{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"}}]})(e)}function mj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}},{tag:"path",attr:{d:"M12 9h.01"}},{tag:"path",attr:{d:"M11 12h1v4h1"}}]})(e)}function vj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M11 5l6 0"}},{tag:"path",attr:{d:"M7 19l6 0"}},{tag:"path",attr:{d:"M14 5l-4 14"}}]})(e)}function yj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0z"}},{tag:"path",attr:{d:"M15 9h.01"}}]})(e)}function bj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}},{tag:"path",attr:{d:"M12 4l0 16"}}]})(e)}function xj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M14 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"}}]})(e)}function wj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}},{tag:"path",attr:{d:"M4 12l16 0"}}]})(e)}function Sj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 15l3 -3m2 -2l1 -1"}},{tag:"path",attr:{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}},{tag:"path",attr:{d:"M3 3l18 18"}},{tag:"path",attr:{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}}]})(e)}function Cj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 15l6 -6"}},{tag:"path",attr:{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}},{tag:"path",attr:{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}}]})(e)}function Ej(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M11 6h9"}},{tag:"path",attr:{d:"M11 12h9"}},{tag:"path",attr:{d:"M12 18h8"}},{tag:"path",attr:{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}},{tag:"path",attr:{d:"M6 10v-6l-2 2"}}]})(e)}function kj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 6l11 0"}},{tag:"path",attr:{d:"M9 12l11 0"}},{tag:"path",attr:{d:"M9 18l11 0"}},{tag:"path",attr:{d:"M5 6l0 .01"}},{tag:"path",attr:{d:"M5 12l0 .01"}},{tag:"path",attr:{d:"M5 18l0 .01"}}]})(e)}function Oj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 3a9 9 0 1 0 9 9"}}]})(e)}function Tj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}},{tag:"path",attr:{d:"M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M8 11v-5a4 4 0 0 1 8 0"}}]})(e)}function _j(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z"}},{tag:"path",attr:{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"}},{tag:"path",attr:{d:"M8 11v-4a4 4 0 1 1 8 0v4"}}]})(e)}function Mj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"}},{tag:"path",attr:{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"}}]})(e)}function Dj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"}}]})(e)}function Rj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 12l14 0"}}]})(e)}function Ij(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z"}}]})(e)}function Nj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}},{tag:"path",attr:{d:"M8 4l0 16"}},{tag:"path",attr:{d:"M16 4l0 16"}},{tag:"path",attr:{d:"M4 8l4 0"}},{tag:"path",attr:{d:"M4 16l4 0"}},{tag:"path",attr:{d:"M4 12l16 0"}},{tag:"path",attr:{d:"M16 8l4 0"}},{tag:"path",attr:{d:"M16 16l4 0"}}]})(e)}function Pj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M13 20l7 -7"}},{tag:"path",attr:{d:"M13 20v-6a1 1 0 0 1 1 -1h6v-7a2 2 0 0 0 -2 -2h-12a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7"}}]})(e)}function Aj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}},{tag:"path",attr:{d:"M13.5 6.5l4 4"}}]})(e)}function Lj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}}]})(e)}function jj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 4v16l13 -8z"}}]})(e)}function $j(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M20 5v14l-12 -7z"}},{tag:"path",attr:{d:"M4 5l0 14"}}]})(e)}function zj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 5v14l12 -7z"}},{tag:"path",attr:{d:"M20 5l0 14"}}]})(e)}function Bj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 5m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}}]})(e)}function Fj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 5v14l8 -7z"}},{tag:"path",attr:{d:"M14 5v14l8 -7z"}}]})(e)}function Hj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M21 5v14l-8 -7z"}},{tag:"path",attr:{d:"M10 5v14l-8 -7z"}}]})(e)}function Vj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 5l0 14"}},{tag:"path",attr:{d:"M5 12l14 0"}}]})(e)}function Wj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M8 8a3.5 3 0 0 1 3.5 -3h1a3.5 3 0 0 1 3.5 3a3 3 0 0 1 -2 3a3 4 0 0 0 -2 4"}},{tag:"path",attr:{d:"M12 19l0 .01"}}]})(e)}function Uj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}},{tag:"path",attr:{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"}}]})(e)}function qj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"}},{tag:"path",attr:{d:"M20 4v5h-5"}}]})(e)}function Kj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5"}}]})(e)}function Gj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"}},{tag:"path",attr:{d:"M12 15l0 4"}},{tag:"path",attr:{d:"M14 17l-4 0"}}]})(e)}function Yj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"}},{tag:"path",attr:{d:"M12 9v-4"}},{tag:"path",attr:{d:"M10 7l4 0"}}]})(e)}function Xj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19.875 8c.621 0 1.125 .512 1.125 1.143v5.714c0 .631 -.504 1.143 -1.125 1.143h-15.875a1 1 0 0 1 -1 -1v-5.857c0 -.631 .504 -1.143 1.125 -1.143h15.75z"}},{tag:"path",attr:{d:"M9 8v2"}},{tag:"path",attr:{d:"M6 8v3"}},{tag:"path",attr:{d:"M12 8v3"}},{tag:"path",attr:{d:"M18 8v3"}},{tag:"path",attr:{d:"M15 8v2"}}]})(e)}function Jj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 20l10 0"}},{tag:"path",attr:{d:"M6 6l6 -1l6 1"}},{tag:"path",attr:{d:"M12 3l0 17"}},{tag:"path",attr:{d:"M9 12l-3 -6l-3 6a3 3 0 0 0 6 0"}},{tag:"path",attr:{d:"M21 12l-3 -6l-3 6a3 3 0 0 0 6 0"}}]})(e)}function Zj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}},{tag:"path",attr:{d:"M21 21l-6 -6"}}]})(e)}function Qj(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"}},{tag:"path",attr:{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"}},{tag:"path",attr:{d:"M7 8l0 .01"}},{tag:"path",attr:{d:"M7 16l0 .01"}}]})(e)}function e4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"}},{tag:"path",attr:{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"}}]})(e)}function t4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 6l7 0"}},{tag:"path",attr:{d:"M4 12l7 0"}},{tag:"path",attr:{d:"M4 18l9 0"}},{tag:"path",attr:{d:"M15 9l3 -3l3 3"}},{tag:"path",attr:{d:"M18 6l0 12"}}]})(e)}function n4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 6l9 0"}},{tag:"path",attr:{d:"M4 12l7 0"}},{tag:"path",attr:{d:"M4 18l7 0"}},{tag:"path",attr:{d:"M15 15l3 3l3 -3"}},{tag:"path",attr:{d:"M18 6l0 12"}}]})(e)}function r4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"}}]})(e)}function o4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"}}]})(e)}function i4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"}},{tag:"path",attr:{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"}}]})(e)}function s4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}},{tag:"path",attr:{d:"M3 10h18"}},{tag:"path",attr:{d:"M10 3v18"}}]})(e)}function a4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}},{tag:"path",attr:{d:"M12 12m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}}]})(e)}function l4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 7l16 0"}},{tag:"path",attr:{d:"M10 11l0 6"}},{tag:"path",attr:{d:"M14 11l0 6"}},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"}}]})(e)}function c4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}},{tag:"path",attr:{d:"M7 9l5 -5l5 5"}},{tag:"path",attr:{d:"M12 4l0 12"}}]})(e)}function u4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"}},{tag:"path",attr:{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}}]})(e)}function d4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"}},{tag:"path",attr:{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}},{tag:"path",attr:{d:"M16 3.13a4 4 0 0 1 0 7.75"}},{tag:"path",attr:{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"}}]})(e)}function f4(e){return H({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M18 6l-12 12"}},{tag:"path",attr:{d:"M6 6l12 12"}}]})(e)}function h4(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9 9H4v1h5V9z"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M5 3l1-1h7l1 1v7l-1 1h-2v2l-1 1H3l-1-1V6l1-1h2V3zm1 2h4l1 1v4h2V3H6v2zm4 1H3v7h7V6z"}}]})(e)}function p4(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9 9H4v1h5V9z"}},{tag:"path",attr:{d:"M7 12V7H6v5h1z"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M5 3l1-1h7l1 1v7l-1 1h-2v2l-1 1H3l-1-1V6l1-1h2V3zm1 2h4l1 1v4h2V3H6v2zm4 1H3v7h7V6z"}}]})(e)}function g4(e){return H({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attr:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]})(e)}function m4(e){return H({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attr:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]})(e)}const v4=({icon:e})=>{switch(e){case"add":case"plus":return v.jsx(Vj,{});case"add above":return v.jsx(Yj,{});case"add below":return v.jsx(Gj,{});case"arrow down":case"down":return v.jsx(yL,{});case"arrow left":case"left":return v.jsx(bL,{});case"arrow right":case"right":return v.jsx(xL,{});case"arrow up":case"up":return v.jsx(wL,{});case"bold":return v.jsx(_L,{});case"book":case"library":return v.jsx(DL,{});case"camera":return v.jsx(IL,{});case"close":case"clear":case"times":return v.jsx(f4,{});case"chart":case"chart line":return v.jsx(PL,{});case"chart bar":return v.jsx(NL,{});case"chart pie":return v.jsx(AL,{});case"chat":return v.jsx(Dj,{});case"check":case"checkmark":return v.jsx(LL,{});case"chevron up":return v.jsx(BL,{});case"chevron down":return v.jsx(jL,{});case"chevron left":return v.jsx($L,{});case"chevron right":return v.jsx(zL,{});case"chevron double left":return v.jsx(FL,{});case"chevron double right":return v.jsx(HL,{});case"clock":return v.jsx(KL,{});case"clone":case"copy":case"duplicate":return v.jsx(YL,{});case"code":return v.jsx(GL,{});case"collapse":return v.jsx(g4,{});case"collapse all":return v.jsx(h4,{});case"company":return v.jsx(RL,{});case"compare":return v.jsx(Jj,{});case"delete":case"trash":return v.jsx(l4,{});case"depth":return v.jsx(Xj,{style:{transform:"rotate(-90deg)"}});case"download":case"export":return v.jsx(ej,{});case"drag":return v.jsx(pj,{});case"edit":case"pencil":case"rename":return v.jsx(Aj,{});case"electricity":return v.jsx(ML,{});case"error":return v.jsx(WL,{});case"exclamation":return v.jsx(nj,{});case"expand":return v.jsx(m4,{});case"expand all":return v.jsx(p4,{});case"external":return v.jsx(rj,{});case"fast forward":return v.jsx(Fj,{});case"fast backward":return v.jsx(Hj,{});case"file":return v.jsx(sj,{});case"filter":return v.jsx(lj,{});case"focus":return v.jsx(cj,{});case"folder":return v.jsx(dj,{});case"folder search":return v.jsx(uj,{});case"fork":return v.jsx(hj,{});case"gauge":return v.jsx(fj,{});case"help":return v.jsx(gj,{});case"hide":return v.jsx(oj,{});case"indent":return v.jsx(XL,{});case"info":return v.jsx(mj,{});case"italic":return v.jsx(vj,{});case"key":return v.jsx(yj,{});case"laptop":return v.jsx(ZL,{});case"layout columns":case"columns":return v.jsx(bj,{});case"layout grid":case"grid":return v.jsx(xj,{});case"layout rows":case"rows":return v.jsx(wj,{});case"layout single":case"square":return v.jsx(r4,{});case"link":return v.jsx(Cj,{});case"list":case"legend":case"ul":return v.jsx(kj,{});case"list numbers":case"ol":return v.jsx(Ej,{});case"location":return v.jsx(Mj,{});case"lock":return v.jsx(_j,{});case"maximize":return v.jsx(CL,{});case"menu":return v.jsx(QL,{});case"minimize":return v.jsx(EL,{});case"minus":return v.jsx(Rj,{});case"moon":return v.jsx(Ij,{});case"move":return v.jsx(kL,{});case"note":return v.jsx(Pj,{});case"notification":case"bell":return v.jsx(TL,{});case"paste":return v.jsx(qL,{});case"pause":return v.jsx(Lj,{});case"play":return v.jsx(jj,{});case"question":return v.jsx(Wj,{});case"redo":case"rotate":case"rotate right":return v.jsx(qj,{});case"refresh":case"sync":return v.jsx(Uj,{});case"save":return v.jsx(JL,{});case"scale":return v.jsx(SL,{});case"search":return v.jsx(Zj,{});case"server":return v.jsx(Qj,{});case"settings":return v.jsx(e4,{});case"show":case"eye":return v.jsx(ij,{});case"sort":case"sort descending":case"sort down":case"sort amount down":return v.jsx(n4,{});case"sort ascending":case"sort up":case"sort amount up":return v.jsx(t4,{});case"spinner":return v.jsx(Oj,{});case"split":return v.jsx(OL,{});case"star":return v.jsx(o4,{});case"step backward":return v.jsx($j,{});case"step forward":return v.jsx(zj,{});case"stop":return v.jsx(Bj,{});case"success":return v.jsx(VL,{});case"sun":return v.jsx(i4,{});case"table":return v.jsx(s4,{});case"target":return v.jsx(a4,{});case"undo":case"rotate left":return v.jsx(Kj,{});case"unfilter":return v.jsx(aj,{});case"unlink":return v.jsx(Sj,{});case"unlock":return v.jsx(Tj,{});case"upload":case"import":return v.jsx(c4,{});case"user":return v.jsx(u4,{});case"users":case"group":return v.jsx(d4,{});case"video":return v.jsx(Nj,{});case"warning":case"alert":return v.jsx(vL,{});case"water":case"droplet":return v.jsx(tj,{});case"":return null;default:return v.jsx(UL,{})}},Ae=({icon:e,onClick:t,clickable:n=!1,color:r,size:o,testId:i})=>{const s=x.useContext(ht),a={color:r,fill:r,fontSize:o||"inherit",width:o||"auto",height:o||"auto"};return v.jsx("div",{className:oe(qu.wrapper,(n||t)&&!s?qu.clickable:""),style:a,onClick:l=>t&&!s?t(l):void 0,"data-testid":i,children:x.isValidElement(e)?e:typeof e=="string"&&(e.includes(".svg")||e.includes("image/svg"))?v.jsx(x0,{className:qu.customSvg,beforeInjection:l=>{o&&(l.setAttribute("width",String(o)),l.setAttribute("height",String(o)))},src:e}):typeof e=="string"&&(e.includes(".png")||e.includes("image/png"))?v.jsx("img",{alt:"icon",className:qu.customPng,src:e}):typeof e=="string"?v.jsx(v4,{icon:e}):null})},y4="_checkbox_1ybyr_1",b4="_noLabel_1ybyr_17",x4="_small_1ybyr_20",w4="_checkmark_1ybyr_43",S4="_disabled_1ybyr_67",C4="_noMargin_1ybyr_81",E4="_isInTable_1ybyr_84",k4="_helpIconEnabled_1ybyr_87",Fo={checkbox:y4,noLabel:b4,small:x4,checkmark:w4,disabled:S4,noMargin:C4,isInTable:E4,helpIconEnabled:k4};var ok=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),mm=typeof window<"u"&&typeof document<"u"&&window.document===document,uf=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),O4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(uf):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),T4=2;function _4(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){O4(i)}function a(){var l=Date.now();if(n){if(l-o<T4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var M4=20,D4=["top","right","bottom","left","width","height","size","weight"],R4=typeof MutationObserver<"u",I4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_4(this.refresh.bind(this),M4)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!mm||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),R4?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!mm||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=D4.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),ik=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Aa=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||uf},sk=Eh(0,0,0,0);function df(e){return parseFloat(e)||0}function Gb(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+df(i)},0)}function N4(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=df(s)}return n}function P4(e){var t=e.getBBox();return Eh(0,0,t.width,t.height)}function A4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return sk;var r=Aa(e).getComputedStyle(e),o=N4(r),i=o.left+o.right,s=o.top+o.bottom,a=df(r.width),l=df(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=Gb(r,"left","right")+i),Math.round(l+s)!==n&&(l-=Gb(r,"top","bottom")+s)),!j4(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Eh(o.left,o.top,a,l)}var L4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Aa(e).SVGGraphicsElement}:function(e){return e instanceof Aa(e).SVGElement&&typeof e.getBBox=="function"}}();function j4(e){return e===Aa(e).document.documentElement}function $4(e){return mm?L4(e)?P4(e):A4(e):sk}function z4(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return ik(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Eh(e,t,n,r){return{x:e,y:t,width:n,height:r}}var B4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Eh(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=$4(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),F4=function(){function e(t,n){var r=z4(n);ik(this,{target:t,contentRect:r})}return e}(),H4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new ok,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Aa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new B4(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Aa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new F4(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ak=typeof WeakMap<"u"?new WeakMap:new ok,lk=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=I4.getInstance(),r=new H4(t,n,this);ak.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){lk.prototype[e]=function(){var t;return(t=ak.get(this))[e].apply(t,arguments)}});var kh=function(){return typeof uf.ResizeObserver<"u"?uf.ResizeObserver:lk}();function V4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oh(e,t,n){return t&&V4(e.prototype,t),e}function cn(){return cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn.apply(this,arguments)}function W4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,vm(e,t)}function vm(e,t){return vm=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},vm(e,t)}function U4(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function q4(e,t){if(e){if(typeof e=="string")return Yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yb(e,t)}}function Yb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function La(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=q4(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xb(e){var t=x.useRef(null);function n(r){!r||r===t.current||(t.current=r,e(r))}return n}function K4(e){var t=x.useRef(e);return x.useMemo(function(){function n(o){typeof o=="function"?t.current=o(t.current):t.current=o}function r(){return t.current}return[r,n]},[])}function G4(){var e=x.useRef([]);return x.useMemo(function(){function t(){return e.current.length>0}function n(){for(var o=La(e.current),i;!(i=o()).done;){var s=i.value;s()}e.current=[]}function r(o){e.current.push(o)}return{hasEventSubscriptions:t,removeAllEventSubscriptions:n,addEventSubscription:r}},[])}var Pp=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Y4(e,t){var n=x.useRef(e);return t?(n.current=e,n):(n.current=null,n)}var Ap={top:0,left:0,right:1,bottom:1,width:1,height:1};function X4(e){var t={},n=t.enabled,r=n===void 0?!0:n,o=t.preventDefault,i=o===void 0?!0:o,s=x.useRef(null),a=x.useState(Ap),l=a[0],c=a[1];function u(){c(Ap)}var d=l!==Ap;function f(h){if(r){i&&h.preventDefault();var p=h.clientX,g=h.clientY;c({top:g,left:p,width:1,height:1,right:p+1,bottom:g+1})}}return{hasMousePosition:d,resetMousePosition:u,handleMouseEvent:f,trigger:{getBounds:function(){return l},getParent:s.current?function(){return s.current}:void 0},parentRef:s}}function Lc(e){return parseFloat(e.replace("px",""))}function ym(e,t,n){return e<t?t:e>n?n:e}function Jb(e){return e!=null}function bm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=La(t),i;!(i=o()).done;){var s=i.value;s&&(typeof s=="function"?s(r):s.current=r)}}}function J4(e,t){if(!(typeof e>"u"))return t||e.ResizeObserver}function ck(e,t){var n=[];if(!e||!t||e===document.body)return n;var r=t.getComputedStyle(e),o=r.overflow,i=r.overflowX,s=r.overflowY;return[o,i,s].some(function(a){return["auto","scroll"].includes(a)})&&n.push(e),[].concat(n,ck(e.parentElement,t))}function Ku(e){return"react-laag: Could not find a valid reference for the "+e+` element. There might be 2 causes:
17
+ - Make sure that the 'ref' is set correctly on the `+e+` element when isOpen: true. Also make sure your component forwards the ref with "forwardRef()".
18
+ - Make sure that you are actually rendering the `+e+" when the isOpen prop is set to true"}function Z4(e){var t=e.enabled,n=e.onChange,r=e.environment,o=e.ResizeObserverPolyfill,i=e.overflowContainer,s=e.triggerOption,a=J4(r,o);x.useEffect(function(){},[a]);var l=x.useRef(null),c=!!s,u=K4({scrollContainers:[],trigger:null,layer:null}),d=u[0],f=u[1],h=G4(),p=h.hasEventSubscriptions,g=h.addEventSubscription,m=h.removeAllEventSubscriptions,b=x.useCallback(function(){var T=d(),D=T.layer,O=T.trigger,M=T.scrollContainers,R=M[0];if(!D)throw new Error(Ku("layer"));if(!O&&!c)throw new Error(Ku("trigger"));var I={top:0,left:0};if(R){var N=R.scrollLeft,$=R.scrollTop;I={top:$,left:N}}else{var A=r.scrollX,z=r.scrollY;I={top:z,left:A}}var F={left:0,top:0};if(R){var V=r.getComputedStyle(R),ee=V.borderLeftWidth,X=V.borderTopWidth;F={left:Lc(ee)||0,top:Lc(X)||0}}n({layer:D,trigger:O,scrollContainers:M,arrow:l.current},I,F)},[d,n,r,l,c]),y=x.useCallback(function(){var T=d(),D=T.trigger,O=T.layer,M=T.scrollContainers;if(!O)throw new Error(Ku("layer"));if(!D&&!c)throw new Error(Ku("trigger"));if(a){for(var R=!1,I=function(){if(!R){R=!0;return}b()},N=new a(I),$=0,A=[D,O,document.body];$<A.length;$++){var z=A[$];z&&N.observe(z)}g(function(){for(var W=0,L=[D,O,document.body];W<L.length;W++){var P=L[W];P&&N.unobserve(P)}N.disconnect()})}for(var F=[r].concat(M),V=function(){var L=X.value;L.addEventListener("scroll",b),g(function(){return L.removeEventListener("scroll",b)})},ee=La(F),X;!(X=ee()).done;)V()},[d,g,b,r,a,c]),w=x.useCallback(function(_,T){t&&_&&_!==T&&(m(),y(),b())},[m,y,b,t]),S=Xb(x.useCallback(function(_){var T=d(),D=T.layer;f(function(O){return cn({},O,{layer:_})}),w(D,_)},[d,f,w])),C=x.useCallback(function(T){var D=ck(T,r),O=D[0];if(O){var M=r.getComputedStyle(O).position,R=["relative","absolute","fixed"].includes(M)||i;R||(O.style.position="relative")}return D},[r,i]),E=Xb(x.useCallback(function(_){var T=C(_),D=d(),O=D.trigger;f(function(M){return cn({},M,{trigger:_,scrollContainers:T})}),w(O,_)},[d,f,w,C])),k=s==null||s.getParent==null?void 0:s.getParent();return Pp(function(){k&&f(function(_){return cn({},_,{scrollContainers:C(k)})})},[k,f,C]),Pp(function(){return t&&(p()||y()),function(){p()&&m()}},[t,p,y,m]),Pp(function(){t&&b()}),{triggerRef:E,layerRef:S,arrowRef:l,closestScrollContainer:d().scrollContainers[0]||null}}var uk=x.createContext({});function Q4(e){var t=e.children,n=e.registrations,r=x.useCallback(function(i){return n.current.add(i),function(){return n.current.delete(i)}},[n]);return x.createElement(uk.Provider,{value:r},t)}function e$(e,t){for(var n=La(e),r;!(r=n()).done;){var o=r.value.shouldCloseWhenClickedOutside;if(!o(t))return!1}return!0}function t$(e){var t=e.isOpen,n=e.onOutsideClick,r=e.onParentClose,o=x.useRef(null),i=x.useRef(null),s=x.useRef(new Set),a=x.useContext(uk),l=x.useCallback(function(u){var d=u.target,f=o.current&&o.current.contains(d),h=i.current&&i.current.contains(d),p=e$(s.current,u);return h&&p&&s.current.forEach(function(g){var m=g.closeChild;return m()}),!f&&!h&&p},[o,i,s]);return x.useEffect(function(){if(typeof a=="function")return a({shouldCloseWhenClickedOutside:l,closeChild:function(){r&&r()}})},[a,l,r,s]),x.useEffect(function(){var c=typeof a=="function",u=!t||!n||c;if(u)return;function d(f){l(f)&&n()}return document.addEventListener("click",d,!0),function(){return document.removeEventListener("click",d,!0)}},[t,n,l,a]),x.useEffect(function(){t||s.current.forEach(function(c){var u=c.closeChild;return u()})},[t]),{closeOnOutsideClickRefs:{trigger:o,layer:i},registrations:s}}var n$=["bottom-start","bottom-end","bottom-center","top-start","top-center","top-end","left-end","left-center","left-start","right-end","right-center","right-start","center"],r$={top:"bottom",left:"right",bottom:"top",right:"left",center:"center"},o$=function(){function e(n,r,o,i,s,a,l,c,u){this.prop=void 0,this.opposite=void 0,this.isHorizontal=void 0,this.sizeProp=void 0,this.oppositeSizeProp=void 0,this.cssProp=void 0,this.oppositeCssProp=void 0,this.isCenter=void 0,this.isPush=void 0,this.prop=n,this.opposite=r,this.isHorizontal=o,this.sizeProp=i,this.oppositeSizeProp=s,this.cssProp=a,this.oppositeCssProp=l,this.isCenter=c,this.isPush=u}var t=e.prototype;return t.factor=function(r){return r*(this.isPush?1:-1)},t.isOppositeDirection=function(r){return this.isHorizontal!==r.isHorizontal},e}();function va(e,t){t===void 0&&(t=!0);var n=["left","right"].includes(e);return new o$(e,t?va(r$[e],!1):null,n,n?"width":"height",n?"height":"width",n?"left":"top",n?"top":"left",e==="center",!["right","bottom"].includes(e))}var bt={top:va("top"),bottom:va("bottom"),left:va("left"),right:va("right")},ct=cn({},bt,{center:va("center")}),Gu=["top","left","bottom","right"],w0=function(){function e(t){return this.top=void 0,this.left=void 0,this.right=void 0,this.bottom=void 0,Object.assign(this,t)}return e.mergeSmallestSides=function(n){var r=n[0],o=n.slice(1);if(!r)throw new Error("Please provide at least 1 bounds objects in order to merge");for(var i=Object.fromEntries(Gu.map(function(f){return[f,r[f]]})),s=La(o),a;!(a=s()).done;)for(var l=a.value,c=La(Gu),u;!(u=c()).done;){var d=u.value;i[d]=Math.min(i[d],l[d])}return new e(i)},Oh(e,[{key:"allSidesArePositive",get:function(){var n=this;return Gu.every(function(r){return n[r]>=0})}},{key:"negativeSides",get:function(){var n=this;return Object.fromEntries(Gu.filter(function(r){return n[r]<0}).map(function(r){return[r,n[r]]}))}}]),e}();function Zb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(r,o){return r+(o?Lc(o):0)},0)}function xm(e){var t=e.top,n=e.left,r=e.right,o=e.bottom,i=e.width,s=e.height;return{top:t,left:n,right:r,bottom:o,width:i,height:s}}var i$={top:0,left:0,right:0,bottom:0,width:0,height:0},mr=function(){e.create=function(r){return new e(r)},e.fromElement=function(r,o){o===void 0&&(o={});var i=o,s=i.withTransform,a=s===void 0?!0:s,l=i.environment,c=l===void 0?window:l,u=i.withScrollbars,d=u===void 0?!0:u,f=xm(r.getBoundingClientRect()),h=new e(f);if(!a){var p=c.getComputedStyle(r),g=p.width,m=p.height,b=p.boxSizing,y=p.borderLeft,w=p.borderRight,S=p.borderTop,C=p.borderBottom,E=p.paddingLeft,k=p.paddingRight,_=p.paddingTop,T=p.paddingBottom,D=b==="border-box"?Lc(g):Zb(g,y,w,E,k),O=b==="border-box"?Lc(m):Zb(m,S,C,_,T);h=new e(cn({},h,{width:D,height:O}))}if(!d){var M=h.width-r.clientWidth,R=h.height-r.clientHeight;return h.substract({right:M,bottom:R})}return h},e.empty=function(){return new e},e.fromWindow=function(r){var o,i=(o=r==null?void 0:r.document.scrollingElement)!=null?o:r==null?void 0:r.document.documentElement,s=i??{},a=s.clientWidth,l=a===void 0?0:a,c=s.clientHeight,u=c===void 0?0:c;return new e({width:l,height:u,right:l,bottom:u})};function e(n){return n===void 0&&(n={}),this.top=void 0,this.left=void 0,this.right=void 0,this.bottom=void 0,this.width=void 0,this.height=void 0,Object.assign(this,i$,n)}var t=e.prototype;return t.toObject=function(){return xm(this)},t.merge=function(r){var o=this.toObject();return new e(cn({},o,typeof r=="function"?r(o):r))},t.substract=function(r){for(var o=this.toObject(),i=Object.entries(r),s=0,a=i;s<a.length;s++){var l=a[s],c=l[0],u=l[1];if(c in bt){var d=bt[c];o[c]+=d.factor(u),o[d.isHorizontal?"width":"height"]-=u}else o[c]-=u||0}return new e(o)},t.offsetsTo=function(r){return new w0({top:r.top-this.top,bottom:this.bottom-r.bottom,left:r.left-this.left,right:this.right-r.right})},t.mapSides=function(r){for(var o=this.toObject(),i=Object.values(bt),s=0,a=i;s<a.length;s++){var l=a[s];o[l.prop]=r(l,o[l.prop])}return new e(o)},Oh(e,[{key:"surface",get:function(){return this.width*this.height}}]),e}(),dk=function(){function e(n,r,o,i,s){this.primary=void 0,this.secondary=void 0,this.offsets=void 0,this.subjectsBounds=void 0,this._cachedLayerBounds=null,this._cachedContainerOffsets=null,this.primary=n,this.secondary=r,this.offsets=s,this.setSubjectsBounds(o,i)}var t=e.prototype;return t.setSubjectsBounds=function(r,o){if(!o){this.subjectsBounds=r;return}var i=typeof o=="function"?o(this.primary.prop):o;this.subjectsBounds=r.merge({layer:cn({},r.layer,i)})},t.getLayerBounds=function(r){if(r===void 0&&(r=0),this._cachedLayerBounds&&r===0)return this._cachedLayerBounds;var o=this.primary,i=this.secondary,s=this.subjectsBounds,a=s.trigger,l=s.layer,c=s.arrow,u=o.isHorizontal,d=o.oppositeCssProp,f=o.oppositeSizeProp,h=o.prop,p=o.opposite,g=mr.empty();g[p.prop]=a[h]-o.factor(this.offsets.trigger),g[h]=g[p.prop]-o.factor(l[o.sizeProp]);var m=this.offsets.arrow*2,b=a[d]-(l[f]-c[f])+m,y=a[d]+(a[f]-c[f])-m;if(i.isPush||(b+=l[f],y+=l[f]),i.isCenter){var w=(u?bt.top:bt.left).prop,S=(u?bt.bottom:bt.right).prop;g[w]=ym(a[w]+a[f]/2-l[f]/2+r,b,y),g[S]=g[w]+l[f]}else{var C=i,E=a[C.prop],k=E<b?b-E:E>y?y-E:0;g[C.prop]=ym(E+r+k,b,y),g[C.opposite.prop]=g[C.prop]+i.factor(l[f])}g.width=g.right-g.left,g.height=g.bottom-g.top;var _=mr.create(g);return r===0&&(this._cachedLayerBounds=_),_},t.getLayerCollisionBounds=function(){var r=this.offsets.container;return this.getLayerBounds().mapSides(function(o,i){return i-=o.factor(r)}).merge(function(o){var i=o.width,s=o.height;return{width:i+r*2,height:s+r*2}})},t.getContainerOffsets=function(r){if(this._cachedContainerOffsets&&!r)return this._cachedContainerOffsets;var o=this.subjectsBounds.merge({layer:r||this.getLayerCollisionBounds()}),i=w0.mergeSmallestSides(o.layerOffsetsToScrollContainers);return r||(this._cachedContainerOffsets=i),i},Oh(e,[{key:"type",get:function(){return this.primary.prop+"-"+(this.secondary.prop==="center"?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var r=this.secondary.isHorizontal,o=this.subjectsBounds,i=o.triggerHasBiggerWidth,s=o.triggerHasBiggerHeight;return r&&i||!r&&s}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var r=this.getLayerBounds(),o=this.getContainerOffsets(r),i=o.negativeSides;for(var s in i)i[s]=-i[s];return r.substract(i).surface}},{key:"secondaryOffsetSide",get:function(){var r,o,i=this,s=this.getContainerOffsets(),a=(r=(o=Object.entries(s.negativeSides).map(function(c){var u=c[0],d=c[1];return[bt[u],d]}).filter(function(c){var u=c[0];return i.primary.isOppositeDirection(u)}).sort(function(c,u){var d=c[1],f=u[1];return f-d}))==null?void 0:o[0])!=null?r:[],l=a[0];return l||null}}]),e}(),Qb=function(e){W4(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getLayerBounds=function(){var o=this.subjectsBounds,i=o.trigger,s=o.layer,a=mr.empty();return a.top=i.top+i.height/2-s.height/2,a.bottom=a.top+s.height,a.left=i.left+i.width/2-s.width/2,a.right=a.left+s.width,a.width=a.right-a.left,a.height=a.bottom-a.top,a},t}(dk);function s$(e,t,n){var r=e.layer,o=e.trigger,i=e.arrow,s=t.primary.oppositeSizeProp,a=t.primary.isHorizontal?["top","bottom"]:["left","right"],l=a[0],c=a[1],u=r[l]+r[s]/2-o[l]-i[s]/2-n,d=r[c]-r[s]/2-o[c]+i[s]/2+n;return(u<0?-u:0)+(d>0?-d:0)}var e1={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function a$(e,t,n){var r;if(t.primary.isCenter)return e1;var o=e.layer,i=e.trigger,s=e.arrow,a=t.primary.oppositeSizeProp,l=i[a]>o[a],c=n+s[a]/2,u=o[a]-s[a]/2-n,d=s$(e,t,n),f=t.primary.prop,h=t.primary.oppositeCssProp,p=l?o[a]/2+d:i[h]+i[a]/2-o[h];return cn({},e1,(r={},r[f]="100%",r[h]=ym(p,c,u),r))}var t1=function(){function e(n,r,o){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=n,this.config=r,this.subjectsBounds=o}e.getSidesFromPlacementType=function(r){var o=r.split("-"),i=o[0],s=o[1],a=bt[i],l;return s==="center"?l=ct.center:a.isHorizontal?l=s==="start"?ct.top:ct.bottom:l=s==="start"?ct.left:ct.right,[a,l]},e.create=function(r,o){var i={arrow:o.arrowOffset,container:o.containerOffset,trigger:o.triggerOffset};function s(a){a===void 0&&(a=o.placement);var l=e.getSidesFromPlacementType(a),c=l[0],u=l[1],d=bt[c.isHorizontal?o.preferY:o.preferX],f=!c.isHorizontal&&r.triggerHasBiggerWidth||c.isHorizontal&&r.triggerHasBiggerHeight;function h(g,m){return new dk(g,m,r,o.layerDimensions,i)}var p=[];return p[0]=h(c,u),p[1]=h(c,u.isCenter?d:ct.center),p[2]=h(c,ct[(u.opposite.isCenter?d.opposite:u.opposite).prop]),p[3]=h(d,f?c:ct[c.opposite.prop]),p[4]=h(d,ct.center),p[5]=h(d,f?ct[c.opposite.prop]:c),p[6]=h(bt[d.opposite.prop],f?c:ct[c.opposite.prop]),p[7]=h(bt[d.opposite.prop],ct.center),p[8]=h(bt[d.opposite.prop],f?ct[c.opposite.prop]:c),p[9]=h(bt[c.opposite.prop],u),p[10]=h(bt[c.opposite.prop],u.isCenter?d:ct.center),p[11]=h(bt[c.opposite.prop],ct[(u.opposite.isCenter?d.opposite:u.opposite).prop]),p=p.filter(function(g){return g.type===o.placement||o.possiblePlacements.includes(g.type)}),p}return o.placement==="center"?new e([new Qb(ct.center,ct.center,r,o.layerDimensions,i)].concat(s(o.preferY+"-"+o.preferX)),o,r):new e(s(),o,r)};var t=e.prototype;return t.filterPlacementsBySide=function(r){return this.placements.filter(function(o){return o.primary===r})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(r){return r.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){var r=this.placements.map(function(i){return{placement:i,surface:i.visibleSurface}}).sort(function(i,s){return s.surface-i.surface}),o=r[0].placement;return o},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(r){var o=this.config,i=o.auto,s=o.snap;if(!i||s||r instanceof Qb)return 0;var a=this.filterPlacementsBySide(r.primary),l=a.indexOf(r)===0;if(l&&r.fitsContainer)return 0;var c=a.find(function(g){return!g.fitsContainer});if(!c)return 0;var u=c.secondaryOffsetSide;if(!u)return 0;var d=r.getContainerOffsets(),f=r.secondary,h;r.triggerIsBigger||c===r?h=u.isPush?-1:1:h=f===ct.left||[ct.top,ct.center].includes(f)&&u.isPush?-1:1;var p=d[u.prop];return p*h},t.getStyles=function(r,o,i,s){var a={willChange:"top, left, width, height"},l=a$(this.subjectsBounds.merge({layer:r}),o,this.config.arrowOffset),c=this.config.overflowContainer?cn({},a,{position:"fixed",top:r.top,left:r.left}):cn({},a,{position:"absolute",top:r.top-this.subjectsBounds.parent.top+i.top-s.top,left:r.left-this.subjectsBounds.parent.left+i.left-s.left});return{arrow:l,layer:c}},t.getHasDisappeared=function(r){var o=this.config.overflowContainer?this.subjectsBounds.trigger:r,i=w0.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(o,!0)),s=Object.entries(i.negativeSides),a=s.some(function(l){var c=l[0],u=l[1],d=bt[c];return u<=-o[d.sizeProp]});return a?"full":i.allSidesArePositive?null:"partial"},t.result=function(r,o){var i=this.findSuitablePlacement(),s=this.getSecondaryOffset(i),a=i.getLayerBounds(s),l=this.getStyles(a,i,r,o),c=i.primary.prop;return{styles:l,layerSide:c,placement:i,layerBounds:a,hasDisappeared:this.getHasDisappeared(a)}},e}(),l$=function(){function e(n,r){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=r,Object.assign(this,n)}e.create=function(r,o,i,s,a,l,c,u){var d=mr.fromWindow(r);return new e({layer:mr.fromElement(o,{environment:r,withTransform:!1}),trigger:u?mr.create(xm(u())):mr.fromElement(i),arrow:a?mr.fromElement(a):mr.empty(),parent:s?mr.fromElement(s):d,window:d,scrollContainers:[d].concat(l.map(function(f){return mr.fromElement(f,{withScrollbars:!1})}))},c)};var t=e.prototype;return t.merge=function(r){return new e(cn({},this,r),this.overflowContainer)},t.offsetsToScrollContainers=function(r,o){o===void 0&&(o=!1);var i=this.overflowContainer&&!o?[this.window]:this.scrollContainers;return i.map(function(s){return s.offsetsTo(r)})},Oh(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),n1=null,cr={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:n$,preferX:"right",preferY:"bottom",snap:!1,container:void 0};function mu(e){var t,n=e.isOpen,r=n===void 0?!1:n,o=e.overflowContainer,i=o===void 0?cr.overflowContainer:o,s=e.environment,a=s===void 0?typeof window<"u"?window:void 0:s,l=e.ResizeObserver,c=e.placement,u=c===void 0?cr.placement:c,d=e.possiblePlacements,f=d===void 0?cr.possiblePlacements:d,h=e.preferX,p=h===void 0?cr.preferX:h,g=e.preferY,m=g===void 0?cr.preferY:g,b=e.auto,y=b===void 0?cr.auto:b,w=e.snap,S=w===void 0?cr.snap:w,C=e.triggerOffset,E=C===void 0?cr.triggerOffset:C,k=e.containerOffset,_=k===void 0?cr.containerOffset:k,T=e.arrowOffset,D=T===void 0?cr.arrowOffset:T,O=e.container,M=O===void 0?cr.container:O,R=e.layerDimensions,I=R===void 0?null:R,N=e.onDisappear,$=e.onOutsideClick,A=e.onParentClose,z=e.trigger,F=x.useState(function(){return{layerSide:u==="center"?"center":t1.getSidesFromPlacementType(u)[0].prop,styles:{layer:{position:i?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),V=F[0],ee=F[1],X=x.useRef(null),W=Y4(V,r),L=x.useRef({cancelled:!1});x.useEffect(function(){return function(){L.current.cancelled=!0}},[]);var P=x.useCallback(function(st,jt,lr){var _n=st.arrow,Bn=st.layer,Fn=st.scrollContainers,Po=st.trigger,Gi=Fn[0],ro=l$.create(a,Bn,Po,Gi,_n,Fn,i,z==null?void 0:z.getBounds),Ks={placement:u,possiblePlacements:f,auto:y,layerDimensions:I,arrowOffset:D,containerOffset:_,triggerOffset:E,preferX:p,preferY:m,snap:S,overflowContainer:i},Yi=t1.create(ro,Ks).result(jt,lr),Hn=Yi.hasDisappeared,$t=Yi.layerSide,oo=Yi.styles,zt={layerSide:$t,styles:oo};if(!W.current||c$(W.current,zt)){W.current=zt,L.current.cancelled=!0;var Wt={cancelled:!1};L.current=Wt,Promise.resolve().then(function(){Wt.cancelled||ee(zt)})}Jb(Hn)&&Jb(N)&&N(Hn)},[D,y,_,a,I,N,i,u,f,p,m,S,E,W,z]),j=Z4({ResizeObserverPolyfill:l,environment:a,enabled:r,overflowContainer:i,onChange:P,triggerOption:z}),Y=j.triggerRef,re=j.layerRef,se=j.arrowRef,ie=j.closestScrollContainer,_e=t$({isOpen:r,onOutsideClick:$,onParentClose:A}),Me=_e.closeOnOutsideClickRefs,Ot=_e.registrations,Ue={triggerProps:z?{}:{ref:bm(Y,Me.trigger,X)},layerProps:{ref:bm(re,Me.layer),style:V.styles.layer},arrowProps:{ref:se,style:V.styles.arrow,layerSide:V.layerSide},layerSide:V.layerSide,triggerBounds:r?z?z.getBounds():(t=X.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(st){return typeof document<"u"?xr.createPortal(x.createElement(Q4,{registrations:Ot,children:st}),i||!ie?u$(M):ie):null}};return Ue}function c$(e,t){if(e.layerSide!==t.layerSide)return!0;for(var n=["position","top","left","right","bottom"],r=0,o=n;r<o.length;r++){var i=o[r];if(e.styles.layer[i]!==t.styles.layer[i]||e.styles.arrow[i]!==t.styles.arrow[i])return!0}return!1}var r1="layers";function u$(e){var t;if(typeof e=="function"){if(t=e(),!t||!(t instanceof HTMLElement))throw new Error("react-laag: You've passed a function to the 'container' prop, but it returned no valid HTMLElement")}else if(e instanceof HTMLElement)t=e;else if(typeof e=="string"){if(t=document.getElementById(e),!t)throw new Error("react-laag: You've passed element with id '"+e+"' to the 'container' prop, but it returned no valid HTMLElement")}else{if(n1 instanceof HTMLElement)return n1;t=document.getElementById(r1),t||(t=document.createElement("div"),t.id=r1,t.style.cssText=`
19
+ position: absolute;
20
+ top: 0px;
21
+ left: 0px;
22
+ right: 0px;
23
+ `,document.body.appendChild(t))}return t}var d$=["size","angle","borderWidth","borderColor","roundness","backgroundColor","layerSide","style"],Cd="left",Ed="top",kd="bottom",Od="right";function ff(e,t){return Math.tan(e*(Math.PI/180))*t}function f$(e,t,n,r){var o,i=(o={},o[kd]="0 "+-r+" "+t+" "+e,o[Ed]="0 0 "+t+" "+(e+r),o[Od]=-r+" 0 "+e+" "+t,o[Cd]="0 0 "+(e+r)+" "+t,o);return i[n.prop]}function h$(e,t,n,r,o){var i,s,a,l=r/10*e*2,c=(i={},i[kd]=[0,e],i[Ed]=[0,0],i[Od]=[e,t],i[Cd]=[0,t],i)[n.prop].join(" "),u=n.isHorizontal?"V 0":"H "+t,d=t/2,f=t/2+ff(o,e/8),h=e/8,p=(s={},s[kd]=["C",f,h,d+l,0,d,0],s[Ed]=["C",f,e-h,d+l,e,d,e],s[Od]=["C",h,t-f,0,d-l,0,d],s[Cd]=["C",e-h,t-f,e,d-l,e,d],s)[n.prop].join(" "),g=t/2-ff(o,e/8),m=e/8,b=(a={},a[kd]=["C",d-l,0,g,m,c],a[Ed]=["C",d-l,e,g,e-m,c],a[Od]=["C",0,d+l,m,t-g,c],a[Cd]=["C",e,d+l,e-m,t-g,c],a)[n.prop].join(" ");return["M",c,u,p,b].join(" ")}function p$(e,t,n,r,o){var i=ff(o,n),s=r.isPush?[0,n]:[e,e-n],a=s[0],l=s[1];return r.isHorizontal?["M",a,n,"V",t-n,"L",l,t-n-i,"V",i+n,"Z"].join(" "):["M",n,a,"H",t-n,"L",t-n-i,l,"H",i+n,"Z"].join(" ")}var fk=x.forwardRef(function(t,n){var r=t.size,o=r===void 0?8:r,i=t.angle,s=i===void 0?45:i,a=t.borderWidth,l=a===void 0?0:a,c=t.borderColor,u=c===void 0?"black":c,d=t.roundness,f=d===void 0?0:d,h=t.backgroundColor,p=h===void 0?"white":h,g=t.layerSide,m=g===void 0?"top":g,b=t.style,y=b===void 0?{}:b,w=U4(t,d$);if(m==="center")return null;var S=bt[m],C=o,E=ff(s,o)*2,k=Math.max(C,E);return x.createElement("svg",cn({ref:n},w,{style:cn({},y,{transform:"translate"+(S.isHorizontal?"Y":"X")+"(-50%)"}),width:k,height:k,preserveAspectRatio:S.isPush?"xMinYMin":"xMaxYMax",viewBox:f$(C,E,S,l)}),x.createElement("path",{fill:p,strokeWidth:l,stroke:u,d:h$(C,E,S,f,s)}),x.createElement("path",{fill:p,d:p$(C,E,l,S,s)}))}),gr;(function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"})(gr||(gr={}));function g$(e){var t=e===void 0?{}:e,n=t.delayEnter,r=n===void 0?0:n,o=t.delayLeave,i=o===void 0?0:o,s=t.hideOnScroll,a=s===void 0?!0:s,l=x.useState(!1),c=l[0],u=l[1],d=x.useRef(null),f=x.useRef(gr.IDLE),h=x.useRef(!1),p=x.useCallback(function(){clearTimeout(d.current),d.current=null,f.current=gr.IDLE},[]);function g(){f.current===gr.LEAVING&&d.current&&p(),!c&&(f.current=gr.ENTERING,d.current=window.setTimeout(function(){u(!0),d.current=null,f.current=gr.IDLE},r))}function m(y,w){if(f.current===gr.ENTERING&&d.current&&p(),!!c){if(w){u(!1),d.current=null,f.current=gr.IDLE;return}f.current=gr.LEAVING,d.current=window.setTimeout(function(){u(!1),d.current=null,f.current=gr.IDLE},i)}}x.useEffect(function(){function y(){c&&a&&(p(),u(!1))}return window.addEventListener("scroll",y,!0),function(){window.removeEventListener("scroll",y,!0),d.current&&clearTimeout(d.current)}},[c,a,p]);var b={onMouseEnter:g,onMouseLeave:m,onTouchStart:function(){h.current=!1},onTouchMove:function(){h.current=!0},onTouchEnd:function(){!h.current&&!c&&u(!0),h.current=!1}};return[c,b,function(){return m(null,!0)}]}const m$="_tooltip_wli9z_1",v$="_error_wli9z_15",y$="_warning_wli9z_19",Lp={tooltip:m$,error:v$,warning:y$},b$=({text:e="",error:t=!1,warning:n=!1,maxWidth:r="none",fontSize:o="inherit",padding:i="var(--padding-xxs) var(--padding-xs)",layerProps:s={style:{position:"fixed"}},arrowProps:a={style:{top:"100%",bottom:void 0,left:"50%",right:void 0,position:"absolute"}}})=>v.jsxs("div",{className:oe(Lp.tooltip,t?Lp.error:n?Lp.warning:""),...s,children:[v.jsx("div",{style:{maxWidth:r,fontSize:o,padding:i},children:e}),v.jsx(fk,{...a,size:6})]}),hn=({children:e,text:t="",error:n=!1,placement:r="top-center",possiblePlacements:o=["top-center","left-center","bottom-center","right-center"],enabled:i=!0,warning:s=!1,maxWidth:a="40em",triggerOffset:l=12,fontSize:c="inherit",padding:u="var(--padding-xxs) var(--padding-xs)",display:d="inline",flex:f="none",forceOpen:h=!1})=>{const p=i&&(x.isValidElement(t)||typeof t=="string"&&t.length>0||typeof t=="number"),[g,m,b]=g$({delayEnter:100,delayLeave:0}),y=p?h?!0:g:!1,{renderLayer:w,triggerProps:S,layerProps:C,arrowProps:E}=mu({isOpen:y,overflowContainer:!0,ResizeObserver:kh,auto:!0,triggerOffset:l,placement:r,possiblePlacements:o,onParentClose:b});return v.jsxs(v.Fragment,{children:[y&&w(v.jsx(b$,{text:t,error:n,warning:s,padding:u,maxWidth:a,fontSize:c,layerProps:C,arrowProps:E})),v.jsx("span",{...S,...m,style:{display:d,flex:f},children:e})]})},x$="_helpIcon_hd0z2_1",w$="_active_hd0z2_9",S$="_clickable_hd0z2_12",jp={helpIcon:x$,active:w$,clickable:S$},C$=({children:e,text:t,maxWidth:n})=>!!t?v.jsx(hn,{text:t,display:"inline-flex",maxWidth:n,children:e}):v.jsx(v.Fragment,{children:e}),Er=({text:e,onClick:t,icon:n="help",active:r=!1,maxWidth:o="300px",testId:i})=>{const s=a=>{t&&(a.stopPropagation(),t())};return v.jsx("div",{className:oe(jp.helpIcon,t?jp.clickable:"",r?jp.active:""),onClick:s,"data-testid":i,children:v.jsx(C$,{text:e,maxWidth:o,children:v.jsx(Ae,{icon:n})})})},E$=({noMargin:e=!1,dataix:t=0,isInTable:n=!1,tabIndex:r=0,checked:o=!1,name:i,label:s="",disabled:a=!1,small:l=!1,onChange:c,testId:u,value:d,helpText:f,onClickHelp:h})=>{const p=x.useContext(ht),g=f||h,m=a||p;return v.jsxs("div",{className:oe(Fo.checkbox,e&&Fo.noMargin,n&&Fo.isInTable,m&&Fo.disabled,l&&Fo.small,!s&&Fo.noLabel),"data-ix":t,onClick:b=>{if(!m){const y=b.target;y.name=i,y.checked=!o,c({...b,target:{...y,value:y.checked}})}},"data-testid":u,children:[v.jsx("input",{type:"checkbox",tabIndex:r,checked:o,name:i,onChange:()=>{},disabled:m}),v.jsxs("label",{htmlFor:i,children:[v.jsx("span",{className:Fo.checkmark,children:v.jsx(Ae,{icon:Ce.CHECK})}),s]}),g&&v.jsx("div",{className:Fo.helpIconEnabled,onClick:h,children:v.jsx(Er,{text:f})})]})},k$="_button_1m45a_100",O$="_active_1m45a_135",T$="_green_1m45a_135",_$="_red_1m45a_135",M$="_orange_1m45a_135",D$="_icon_1m45a_147",R$="_iconOnly_1m45a_153",I$="_basic_1m45a_163",N$="_muted_1m45a_169",P$="_disabled_1m45a_188",A$="_small_1m45a_198",L$="_pill_1m45a_203",j$="_round_1m45a_204",$$="_inverted_1m45a_310",z$="_groupOrderFirst_1m45a_340",B$="_groupOrderMiddle_1m45a_341",F$="_groupOrderLast_1m45a_342",Mt={button:k$,active:O$,green:T$,red:_$,orange:M$,icon:D$,iconOnly:R$,basic:I$,muted:N$,disabled:P$,small:A$,pill:L$,round:j$,inverted:$$,groupOrderFirst:z$,groupOrderMiddle:B$,groupOrderLast:F$},H$="_spinner_156m4_1",V$={spinner:H$},W$=({small:e=!1,colored:t=!1,dark:n=!1,tiny:r=!1})=>{const o=t?"var(--color-text-primary)":n?"var(--color-text-muted)":"white",i=e?"var(--font-size)":r?"var(--font-size-xs)":"var(--size)";return v.jsx("div",{className:V$.spinner,style:{color:o,fontSize:i}})};var Ul=(e=>(e.SUBMIT="submit",e.BUTTON="button",e.RESET="reset",e))(Ul||{});const U$=({children:e,tooltip:t=null})=>t?v.jsx(hn,{text:t,display:"inline-flex",children:e}):v.jsx(v.Fragment,{children:e}),ln=({active:e=!1,basic:t=!1,colored:n=!1,disabled:r=!1,ignoreDisabledContext:o=!1,groupOrder:i,icon:s=null,label:a="",loading:l=!1,name:c,pill:u=!1,round:d=!1,small:f=!1,styles:h="",width:p="",title:g="",type:m=Ul.BUTTON,onClick:b=()=>{},error:y,warning:w,testId:S,tooltip:C,inverted:E=!1,component:k="button",url:_,tabIndex:T})=>{const D=x.useContext(ht),O=(()=>{if(n)switch(n){case li.DANGER:case li.RED:return Mt.red;case li.SUCCESS:case li.GREEN:return Mt.green;case li.MUTED:return Mt.muted;default:return Mt.orange}return""})(),M=(()=>{if(i)switch(i){case Vt.FIRST:return Mt.groupOrderFirst;case Vt.LAST:return Mt.groupOrderLast;default:return Mt.groupOrderMiddle}return""})(),R=r||D&&!o;return v.jsx(U$,{tooltip:C,children:v.jsxs(k,{type:m===Ul.SUBMIT?Ul.SUBMIT:Ul.BUTTON,className:oe(Mt.button,e?Mt.active:"",t?Mt.basic:"",O,R?Mt.disabled:"",(s||l)&&!a?Mt.iconOnly:"",E?Mt.inverted:"",M,u?Mt.pill:"",d?Mt.round:"",f?Mt.small:"",h),disabled:R,name:c??"",onClick:b,...g?{title:g}:{},style:{width:p},"data-error":y||null,"data-warning":w||null,"data-testid":S,to:_,tabIndex:T,children:[s&&v.jsx("span",{className:Mt.icon,children:v.jsx(Ae,{icon:s})}),l&&v.jsx("span",{className:Mt.icon,children:v.jsx(W$,{small:!f,tiny:f,dark:!n&&!t,colored:t})}),a]})})},q$="_actions_1t7vd_1",K$="_childComponent_1t7vd_11",o1={actions:q$,childComponent:K$},G$="_wrapper_gg13i_1",Y$="_layer_gg13i_5",X$="_layerContainer_gg13i_8",J$="_nested_gg13i_24",Z$="_fileInput_gg13i_36",Q$="_trigger_gg13i_41",ez="_middleAlignedInline_gg13i_50",tz="_heading_gg13i_56",nz="_headingIcon_gg13i_62",rz="_option_gg13i_74",oz="_active_gg13i_93",iz="_disabled_gg13i_98",sz="_selected_gg13i_102",az="_optionContent_gg13i_109",lz="_inline_gg13i_113",cz="_icon_gg13i_118",uz="_check_gg13i_119",dz="_label_gg13i_150",fz="_description_gg13i_161",hz="_arrow_gg13i_165",pz="_divider_gg13i_169",gz="_buttonLabel_gg13i_181",mz="_buttonCaret_gg13i_187",vz="_component_gg13i_191",yz="_right_gg13i_197",bz="_actions_gg13i_202",Oe={wrapper:G$,layer:Y$,layerContainer:X$,nested:J$,fileInput:Z$,trigger:Q$,middleAlignedInline:ez,heading:tz,headingIcon:nz,option:rz,active:oz,disabled:iz,selected:sz,optionContent:az,inline:lz,icon:cz,check:uz,label:dz,description:fz,arrow:hz,divider:pz,buttonLabel:gz,buttonCaret:mz,component:vz,right:yz,actions:bz},xz=({label:e,onClick:t,icon:n,testId:r})=>v.jsxs("div",{onClick:o=>o.stopPropagation(),className:Oe.heading,"data-testid":r,children:[e,v.jsx("span",{className:Oe.headingIcon,onClick:t,children:n})]}),wz=()=>v.jsx("hr",{className:Oe.divider}),Sz=({actions:e,label:t,url:n,onClick:r,description:o,icon:i,selected:s,closeOnOptionClick:a,close:l,disabled:c,inline:u,title:d,upload:f,onChange:h=We.noop,testId:p,component:g="a"})=>{const m=y=>{if(y.stopPropagation(),c){y.preventDefault();return}f||(a&&(l==null||l()),r==null||r(y))},b=y=>{const{files:w}=(y==null?void 0:y.target)??{};if(w){const S={...y,target:{...y.target,value:w,name:y.target.name,files:w}};h==null||h(S),l==null||l()}};return v.jsxs(g,{href:n,to:n,className:oe(Oe.option,c?Oe.disabled:"",u?Oe.inline:"",s?Oe==null?void 0:Oe.selected:""),onClick:m,"data-testid":p,children:[i?v.jsx("span",{className:Oe.icon,children:v.jsx(Ae,{icon:i})}):null,v.jsxs("div",{className:Oe.optionContent,children:[f&&v.jsx("input",{type:"file",className:Oe.fileInput,onChange:b}),v.jsx("span",{className:Oe.label,title:`${d||t}`,children:t}),v.jsx("span",{className:Oe.description,children:o})]}),v.jsxs("div",{className:Oe.right,children:[s&&v.jsx("span",{className:Oe.check,children:v.jsx(Ae,{icon:Ce.CHECK})}),!!(e!=null&&e.length)&&v.jsx("div",{className:Oe.actions,children:v.jsx(Vi,{actions:e})})]})]})};var Jn=(e=>(e.HEADING="Heading",e.DIVIDER="Divider",e.OPTION="Option",e.MENU="Menu",e))(Jn||{}),jc=(e=>(e.FALSE="false",e.RIGHT="right",e.DOWN="down",e))(jc||{});const Cz=({section:e,closeOnOptionClick:t,close:n,tree:r,path:o,maxHeight:i})=>{var s,a;const l=x.useContext(ht);switch(e.type){case Jn.HEADING:return v.jsx(xz,{label:(e==null?void 0:e.label)??"",onClick:e.onClick,icon:e.icon,testId:e.testId});case Jn.DIVIDER:return v.jsx(wz,{});case Jn.OPTION:return v.jsx(Sz,{actions:e==null?void 0:e.actions,label:(e==null?void 0:e.label)??"",url:e==null?void 0:e.url,onClick:e==null?void 0:e.onClick,description:e==null?void 0:e.description,icon:e==null?void 0:e.icon,selected:e==null?void 0:e.selected,closeOnOptionClick:t,close:n,disabled:(e==null?void 0:e.disabled)||l,inline:e==null?void 0:e.inline,title:e==null?void 0:e.title,upload:e==null?void 0:e.upload,onChange:e==null?void 0:e.onChange,testId:e==null?void 0:e.testId,component:e==null?void 0:e.component});case Jn.MENU:const c=!!((a=(s=e==null?void 0:e.menu)==null?void 0:s.sections)!=null&&a.find(u=>u==null?void 0:u.selected));return v.jsx(vk,{menu:e.menu,selected:c,title:e.title,closeOnOptionClick:t,isNested:!0,closeParent:n,tree:r,path:o,maxHeight:i,testId:e.testId});default:return null}},Ez=e=>e.includes("[")?e.substr(0,e.lastIndexOf("[")):e,kz=(e,t)=>`${e}.sections[${t}]`.replace(/^\./,""),Oz=e=>`${e}.close`.replace(/^\./,""),Tz=(e,t)=>We.get(e,Ez(t),[]),_z=(e,t,n)=>We.set(e,Oz(t),n),hk=({sections:e,isNested:t,width:n,closeOnOptionClick:r,close:o=()=>{},tree:i,path:s,maxHeight:a,showAllButton:l,testId:c})=>{var u;if(x.isValidElement(e))return v.jsx(v.Fragment,{children:e});const[d,f]=x.useState(!(l!=null&&l.visible)),h=e,p=((u=l==null?void 0:l.additionalSections)==null?void 0:u.map(b=>({...b,closeOnOptionClick:r,visible:!0})))??[],g=h.length>4?[{type:Jn.OPTION,label:d?(l==null?void 0:l.showLessTitle)||"Show less":(l==null?void 0:l.showAllTitle)||"Show all",onClick:()=>f(!d),visible:!0,closeOnOptionClick:!1}]:[],m=l!=null&&l.visible?h.map((b,y)=>d||y<=3?{...b,visible:!0,closeOnOptionClick:r}:b).concat(g,p).filter(b=>b==null?void 0:b.visible):h.map(b=>({...b,closeOnOptionClick:r}));return v.jsx("div",{className:oe(Oe.layer,t?Oe.nested:null),style:{maxWidth:n,maxHeight:a},"data-testid":c,children:v.jsx("ul",{children:m.map((b,y)=>v.jsx("li",{children:v.jsx(Cz,{section:b,closeOnOptionClick:b.closeOnOptionClick,close:o,tree:i,path:kz(s,y),maxHeight:a})},y))})})},pk=(e,t=!1)=>({auto:!0,preferX:"right",preferY:"bottom",placement:e||(t?"right-start":"bottom-start")}),ft=e=>We.isString(e)||We.isNumber(e)||x.isValidElement(e),Mz=e=>Array.isArray(e)?"array":typeof e,Dz="_wrapper_nwprz_1",Rz="_badge_nwprz_5",Iz="_label_nwprz_11",Nz="_dark_nwprz_23",Pz="_light_nwprz_26",Az="_small_nwprz_29",Lz="_dot_nwprz_33",jz="_hasChildren_nwprz_39",Ho={wrapper:Dz,badge:Rz,label:Iz,dark:Nz,light:Pz,small:Az,dot:Lz,hasChildren:jz},$z=e=>{const t=e.substring(1),n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n>>0&255;return .2126*r+.7152*o+.0722*i<128},ll=({children:e,color:t="",title:n=null,dot:r=!1,margin:o=null,small:i=!1})=>{const s=!(n===null&&r===!1);return v.jsxs("div",{className:Ho.wrapper,children:[s&&v.jsx("sup",{className:oe(Ho.badge,$z(t)?Ho.dark:Ho.light,n!==null?Ho.label:Ho.dot,i?Ho.small:"",e?Ho.hasChildren:""),style:{background:t||void 0,margin:o||void 0},children:n}),e]})},zz=({trigger:e,label:t,colored:n,small:r,width:o,disabled:i,groupOrder:s,loading:a,error:l,warning:c,active:u,tabIndex:d})=>{const f=x.useContext(ht),h=e===di.BUTTON?t:e===di.DROP_DOWN_BUTTON?v.jsxs("span",{className:Oe.middleAlignedInline,children:[v.jsx("span",{className:Oe.buttonLabel,children:t}),v.jsx("span",{className:Oe.buttonCaret,children:v.jsx(Ae,{icon:Ce.CHEVRON_DOWN})})]}):null;return v.jsx("div",{className:oe(Oe.trigger,i||f?Oe.disabled:null),style:{width:o},children:v.jsx(ln,{label:h,colored:n,small:r,width:o,groupOrder:s,onClick:()=>{},loading:a,disabled:i,error:l,warning:c,active:u,tabIndex:d})})},Bz=({label:e,title:t,carat:n,disabled:r,isOpen:o,selected:i})=>{let s;return t?s=t:(typeof e=="string"||typeof e=="number")&&(s=String(e)),v.jsxs("div",{className:oe(Oe.trigger,r?Oe.disabled:null,o?Oe.active:null,i?Oe==null?void 0:Oe.selected:null),children:[v.jsx("span",{className:Oe.label,title:s,children:e}),n&&n===jc.RIGHT?v.jsx("span",{className:Oe.arrow,children:v.jsx(Ae,{icon:Ce.CHEVRON_RIGHT})}):n&&n===jc.DOWN?v.jsx("span",{className:Oe.arrow,children:v.jsx(Ae,{icon:Ce.CHEVRON_DOWN})}):null]})},Fz=({component:e,disabled:t,testId:n})=>v.jsx("div",{className:oe(Oe.component,t?Oe.disabled:null),"data-testid":n,children:e}),Hz=({tooltip:e,error:t,warning:n,children:r})=>!ft(e)&&!ft(t)&&!ft(n)?v.jsx(v.Fragment,{children:r}):v.jsx(hn,{error:!!t,warning:!!n,text:e||t||n,display:"inline-block",children:r}),gk=U.forwardRef(({isDisabled:e,badgeTitle:t,badgeDot:n,loading:r,width:o,trigger:i,label:s,title:a,onClickTrigger:l,colored:c,small:u,isNested:d,contextMenu:f,component:h,groupOrder:p,fullHeight:g,isOpen:m,error:b,warning:y,tooltip:w,testId:S,selected:C,tabIndex:E,...k},_)=>{const T=i===di.BUTTON||i===di.DROP_DOWN_BUTTON?v.jsx(zz,{trigger:i,label:s??"",colored:c,small:u,width:o,disabled:e,groupOrder:p,loading:r,error:b,warning:y,active:m,tabIndex:E}):i===di.TEXT?v.jsx(Bz,{label:s??"",title:a,disabled:e,carat:f?void 0:d?jc.RIGHT:jc.DOWN,isOpen:m,selected:C}):i===di.COMPONENT?v.jsx(Fz,{component:h,disabled:e}):null,D=!d&&(t||n)?v.jsx(ll,{title:t,dot:n,small:!n,children:T}):T;return v.jsx("div",{ref:_,className:Oe.wrapper,style:o?{width:o}:{...g&&{height:"100%",display:"flex"}},onClick:O=>{O.stopPropagation(),O.preventDefault(),l()},"data-error":b||null,"data-warning":y||null,"data-testid":S,children:v.jsx(Hz,{tooltip:w,error:b,warning:y,children:D})})}),mk=e=>{const{sections:t}=e;return!x.isValidElement(t)&&(!Array.isArray(t)||t.every(n=>We.isEmpty(n)))},Vz=({sections:e,width:t,placement:n,possiblePlacements:r,closeOnOptionClick:o,closeParent:i,tree:s,path:a,groupOrder:l,overflowContainer:c,maxHeight:u,testId:d})=>{const{hasMousePosition:f,resetMousePosition:h,handleMouseEvent:p,trigger:g}=X4(),m=h,b=f,{layerProps:y,renderLayer:w}=mu({isOpen:b,trigger:g,...pk(n),possiblePlacements:r,ResizeObserver:kh,onOutsideClick:m,overflowContainer:c});return[b&&w(v.jsx("div",{...y,children:v.jsx(hk,{isNested:!1,width:t,sections:e,closeOnOptionClick:o,close:i||m,tree:s,path:a,maxHeight:u,testId:d&&`${d}-layer`})})),p]},Wz=({menu:e,width:t,disabled:n=!1,closeOnOptionClick:r=!0,closeParent:o,tree:i,path:s,groupOrder:a,testId:l})=>{const c=x.useContext(ht),{label:u,trigger:d,fullHeightTrigger:f,colored:h,small:p,component:g,placement:m,possiblePlacements:b=["bottom-start","top-start"]}=e,[y,w]=Vz({sections:e.sections,width:t,placement:m,possiblePlacements:b,closeOnOptionClick:r,closeParent:o,tree:i,path:s,groupOrder:a,overflowContainer:!0,maxHeight:void 0,testId:l}),S=n||mk(e)||c;return v.jsxs("div",{onContextMenu:w,"data-testid":l,children:[v.jsx(gk,{width:t,fullHeight:f,isDisabled:S,trigger:d,label:u,onClickTrigger:()=>{},colored:h,small:p,isNested:!0,component:g,contextMenu:!0,groupOrder:a}),y]})},vk=({menu:e,width:t,disabled:n=!1,badgeTitle:r,badgeDot:o=!1,loading:i=!1,isNested:s=!1,closeOnOptionClick:a=!0,closeParent:l,tree:c,path:u,groupOrder:d,overflowContainer:f=!0,maxHeight:h,testId:p,open:g,setOpen:m,tooltip:b,error:y,warning:w,selected:S,tabIndex:C})=>{const E=x.useContext(ht),{label:k,title:_,trigger:T,fullHeightTrigger:D,colored:O,small:M,sections:R,component:I,placement:N,showAllButton:$,possiblePlacements:A=["bottom-start","top-start"]}=e,[z,F]=We.isBoolean(g)&&We.isFunction(m)?[g,m]:x.useState(!1),V=()=>F(!1),ee=()=>F(!0),{triggerProps:X,layerProps:W,renderLayer:L}=mu({isOpen:z,...pk(N,s),possiblePlacements:A,ResizeObserver:kh,onOutsideClick:V,overflowContainer:f,onParentClose:V}),P=n||mk(e)||E;_z(c,u,V);const j=()=>{if(!P){if(z){V();return}Tz(c,u).forEach(Y=>{Y.close&&Y.close()}),ee()}};return v.jsxs(v.Fragment,{children:[v.jsx(gk,{ref:X.ref,isDisabled:P,badgeTitle:r,badgeDot:o,loading:i,width:t,fullHeight:D,trigger:T,label:k,title:_,onClickTrigger:j,colored:O,small:M,isNested:s,component:I,groupOrder:d,isOpen:z,tooltip:b,error:y,warning:w,testId:p,selected:S,tabIndex:C}),z&&L(v.jsx("div",{...W,className:Oe.layerContainer,"data-testid":e.testId,onClick:Y=>Y.stopPropagation(),children:v.jsx(hk,{sections:R,isNested:s,width:t,closeOnOptionClick:a,close:l||V,tree:c,path:u,maxHeight:h,showAllButton:$,testId:p&&`${p}-layer`})}))]})},Uz=e=>e.contextMenu?v.jsx(Wz,{...e,tree:{},path:"",testId:e.testId}):v.jsx(vk,{...e,tree:{},path:"",testId:e.testId}),qz=e=>{const{subActions:t,subMenuIcon:n,primary:r,testId:o,tooltip:i}=e,s=v.jsx(ln,{colored:r?!0:li.MUTED,basic:!r,round:!0,small:!0,icon:n||Ce.MENU,testId:o,tooltip:i});if(t.length){const a={trigger:di.COMPONENT,component:s,sections:t.map(l=>({type:l.type??"Option",label:l.label,icon:l.icon,testId:l.testId,disabled:l.disabled,menu:l.menu,onClick:c=>{c.stopPropagation(),c.preventDefault(),We.isFunction(l.onClick)&&l.onClick(c)}}))};return v.jsx(Uz,{menu:a})}return null},Vi=e=>{const t=x.useContext(ht),{actions:n=[],closeLayer:r}=e;return v.jsx("div",{className:oe(o1.actions),children:n.map((o,i)=>{if(!((o==null?void 0:o.hidden)||!o||!Object.keys(o).length))return o.childComponent&&U.isValidElement(o.childComponent)?v.jsx("div",{"data-testid":o.testId,className:o1.childComponent,children:o.childComponent},i):o.subActions?v.jsx(qz,{subActions:o.subActions,primary:o.primary,subMenuIcon:o.icon,testId:o.testId,tooltip:o.tooltip},i):v.jsx(ln,{colored:o.primary?!0:"muted",round:!0,basic:!o.primary,disabled:o.disabled,small:!0,name:String(o.label),icon:o.icon?o.icon:null,onClick:a=>{r&&r(),a.stopPropagation(),a.preventDefault(),!(o.disabled||t)&&We.isFunction(o.onClick)&&o.onClick(a)},testId:o.testId,tooltip:o.tooltip},i)})})},Kz="_label_iu2wi_1",Gz="_buttonGroup_iu2wi_11",i1={label:Kz,buttonGroup:Gz},Dhe=e=>{const{basic:t=!1,items:n=[],header:r="",onSelected:o=()=>{},small:i=!1,value:s="",testId:a=void 0,disabled:l}=e,c=x.useContext(ht),u=(w,S,C,E,k)=>{w.preventDefault(),w.stopPropagation(),!(l||k||c)&&o(S,C,E)},d=(w,S)=>S==="string"?w:S==="object"?w.label:S==="array"?w[1]:null,f=(w,S)=>S==="string"?w:S==="object"?w.value??"":S==="array"?w[0]??"":"",h=(w,S,C)=>S==="object"&&"key"in w?w.key:C,p=(w,S)=>S==="object"?w.hidden:!1,g=(w,S)=>S==="object"?w.icon:void 0,m=(w,S,C)=>w==="object"?String(S)===String(s):C===s,b=()=>{if(r)return v.jsx("label",{className:i1.label,children:r})},y=()=>n.map((w,S)=>{const C=Mz(w),E=S===0?Vt.FIRST:S===n.length-1?Vt.LAST:Vt.MIDDLE,k=d(w,C),_=f(w,C),T=h(w,C,_),D=p(w,C),O=g(w,C),M=m(C,T,_),{error:R,maxTooltipWidth:I,testId:N,tooltip:$,warning:A}=w;return D?null:v.jsx(hn,{error:!!R,warning:!!A,text:$||R||A,maxWidth:I,display:"block",enabled:$&&ft($)||R&&ft(R)||A&&ft(A)||!1,children:v.jsx(ln,{active:M,basic:t,disabled:l||w.disabled,groupOrder:E,icon:O,label:k,onClick:z=>{u(z,T,_,typeof k=="string"?k:"",w.disabled||!1)},small:i,testId:N})},S)});return v.jsx("div",{children:v.jsxs("div",{children:[b(),v.jsx("div",{className:i1.buttonGroup,"data-testid":a,children:y()})]})})};var Sn=function(){return Sn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Sn.apply(this,arguments)};function hf(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var qe="-ms-",bc="-moz-",Ie="-webkit-",yk="comm",Th="rule",S0="decl",Yz="@import",bk="@keyframes",Xz="@layer",xk=Math.abs,C0=String.fromCharCode,wm=Object.assign;function Jz(e,t){return Nt(e,0)^45?(((t<<2^Nt(e,0))<<2^Nt(e,1))<<2^Nt(e,2))<<2^Nt(e,3):0}function wk(e){return e.trim()}function ho(e,t){return(e=t.exec(e))?e[0]:e}function we(e,t,n){return e.replace(t,n)}function Td(e,t,n){return e.indexOf(t,n)}function Nt(e,t){return e.charCodeAt(t)|0}function ja(e,t,n){return e.slice(t,n)}function Ur(e){return e.length}function Sk(e){return e.length}function ql(e,t){return t.push(e),e}function Zz(e,t){return e.map(t).join("")}function s1(e,t){return e.filter(function(n){return!ho(n,t)})}var _h=1,$a=1,Ck=0,er=0,dt=0,cl="";function Mh(e,t,n,r,o,i,s,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:_h,column:$a,length:s,return:"",siblings:a}}function Zo(e,t){return wm(Mh("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Qs(e){for(;e.root;)e=Zo(e.root,{children:[e]});ql(e,e.siblings)}function Qz(){return dt}function eB(){return dt=er>0?Nt(cl,--er):0,$a--,dt===10&&($a=1,_h--),dt}function Tr(){return dt=er<Ck?Nt(cl,er++):0,$a++,dt===10&&($a=1,_h++),dt}function vs(){return Nt(cl,er)}function _d(){return er}function Dh(e,t){return ja(cl,e,t)}function Sm(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tB(e){return _h=$a=1,Ck=Ur(cl=e),er=0,[]}function nB(e){return cl="",e}function $p(e){return wk(Dh(er-1,Cm(e===91?e+2:e===40?e+1:e)))}function rB(e){for(;(dt=vs())&&dt<33;)Tr();return Sm(e)>2||Sm(dt)>3?"":" "}function oB(e,t){for(;--t&&Tr()&&!(dt<48||dt>102||dt>57&&dt<65||dt>70&&dt<97););return Dh(e,_d()+(t<6&&vs()==32&&Tr()==32))}function Cm(e){for(;Tr();)switch(dt){case e:return er;case 34:case 39:e!==34&&e!==39&&Cm(dt);break;case 40:e===41&&Cm(e);break;case 92:Tr();break}return er}function iB(e,t){for(;Tr()&&e+dt!==57;)if(e+dt===84&&vs()===47)break;return"/*"+Dh(t,er-1)+"*"+C0(e===47?e:Tr())}function sB(e){for(;!Sm(vs());)Tr();return Dh(e,er)}function aB(e){return nB(Md("",null,null,null,[""],e=tB(e),0,[0],e))}function Md(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,g=1,m=1,b=1,y=0,w="",S=o,C=i,E=r,k=w;m;)switch(p=y,y=Tr()){case 40:if(p!=108&&Nt(k,d-1)==58){Td(k+=we($p(y),"&","&\f"),"&\f",xk(c?a[c-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:k+=$p(y);break;case 9:case 10:case 13:case 32:k+=rB(p);break;case 92:k+=oB(_d()-1,7);continue;case 47:switch(vs()){case 42:case 47:ql(lB(iB(Tr(),_d()),t,n,l),l);break;default:k+="/"}break;case 123*g:a[c++]=Ur(k)*b;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:b==-1&&(k=we(k,/\f/g,"")),h>0&&Ur(k)-d&&ql(h>32?l1(k+";",r,n,d-1,l):l1(we(k," ","")+";",r,n,d-2,l),l);break;case 59:k+=";";default:if(ql(E=a1(k,t,n,c,u,o,a,w,S=[],C=[],d,i),i),y===123)if(u===0)Md(k,t,E,E,S,i,d,a,C);else switch(f===99&&Nt(k,3)===110?100:f){case 100:case 108:case 109:case 115:Md(e,E,E,r&&ql(a1(e,E,E,0,0,o,a,w,o,S=[],d,C),C),o,C,d,a,r?S:C);break;default:Md(k,E,E,E,[""],C,0,a,C)}}c=u=h=0,g=b=1,w=k="",d=s;break;case 58:d=1+Ur(k),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&eB()==125)continue}switch(k+=C0(y),y*g){case 38:b=u>0?1:(k+="\f",-1);break;case 44:a[c++]=(Ur(k)-1)*b,b=1;break;case 64:vs()===45&&(k+=$p(Tr())),f=vs(),u=d=Ur(w=k+=sB(_d())),y++;break;case 45:p===45&&Ur(k)==2&&(g=0)}}return i}function a1(e,t,n,r,o,i,s,a,l,c,u,d){for(var f=o-1,h=o===0?i:[""],p=Sk(h),g=0,m=0,b=0;g<r;++g)for(var y=0,w=ja(e,f+1,f=xk(m=s[g])),S=e;y<p;++y)(S=wk(m>0?h[y]+" "+w:we(w,/&\f/g,h[y])))&&(l[b++]=S);return Mh(e,t,n,o===0?Th:a,l,c,u,d)}function lB(e,t,n,r){return Mh(e,t,n,yk,C0(Qz()),ja(e,2,-2),0,r)}function l1(e,t,n,r,o){return Mh(e,t,n,S0,ja(e,0,r),ja(e,r+1,-1),r,o)}function Ek(e,t,n){switch(Jz(e,t)){case 5103:return Ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ie+e+e;case 4789:return bc+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ie+e+bc+e+qe+e+e;case 5936:switch(Nt(e,t+11)){case 114:return Ie+e+qe+we(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ie+e+qe+we(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ie+e+qe+we(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ie+e+qe+e+e;case 6165:return Ie+e+qe+"flex-"+e+e;case 5187:return Ie+e+we(e,/(\w+).+(:[^]+)/,Ie+"box-$1$2"+qe+"flex-$1$2")+e;case 5443:return Ie+e+qe+"flex-item-"+we(e,/flex-|-self/g,"")+(ho(e,/flex-|baseline/)?"":qe+"grid-row-"+we(e,/flex-|-self/g,""))+e;case 4675:return Ie+e+qe+"flex-line-pack"+we(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ie+e+qe+we(e,"shrink","negative")+e;case 5292:return Ie+e+qe+we(e,"basis","preferred-size")+e;case 6060:return Ie+"box-"+we(e,"-grow","")+Ie+e+qe+we(e,"grow","positive")+e;case 4554:return Ie+we(e,/([^-])(transform)/g,"$1"+Ie+"$2")+e;case 6187:return we(we(we(e,/(zoom-|grab)/,Ie+"$1"),/(image-set)/,Ie+"$1"),e,"")+e;case 5495:case 3959:return we(e,/(image-set\([^]*)/,Ie+"$1$`$1");case 4968:return we(we(e,/(.+:)(flex-)?(.*)/,Ie+"box-pack:$3"+qe+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ie+e+e;case 4200:if(!ho(e,/flex-|baseline/))return qe+"grid-column-align"+ja(e,t)+e;break;case 2592:case 3360:return qe+we(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,o){return t=o,ho(r.props,/grid-\w+-end/)})?~Td(e+(n=n[t].value),"span",0)?e:qe+we(e,"-start","")+e+qe+"grid-row-span:"+(~Td(n,"span",0)?ho(n,/\d+/):+ho(n,/\d+/)-+ho(e,/\d+/))+";":qe+we(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ho(r.props,/grid-\w+-start/)})?e:qe+we(we(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return we(e,/(.+)-inline(.+)/,Ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ur(e)-1-t>6)switch(Nt(e,t+1)){case 109:if(Nt(e,t+4)!==45)break;case 102:return we(e,/(.+:)(.+)-([^]+)/,"$1"+Ie+"$2-$3$1"+bc+(Nt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Td(e,"stretch",0)?Ek(we(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return we(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,o,i,s,a,l,c){return qe+o+":"+i+c+(s?qe+o+"-span:"+(a?l:+l-+i)+c:"")+e});case 4949:if(Nt(e,t+6)===121)return we(e,":",":"+Ie)+e;break;case 6444:switch(Nt(e,Nt(e,14)===45?18:11)){case 120:return we(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ie+(Nt(e,14)===45?"inline-":"")+"box$3$1"+Ie+"$2$3$1"+qe+"$2box$3")+e;case 100:return we(e,":",":"+qe)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return we(e,"scroll-","scroll-snap-")+e}return e}function pf(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function cB(e,t,n,r){switch(e.type){case Xz:if(e.children.length)break;case Yz:case S0:return e.return=e.return||e.value;case yk:return"";case bk:return e.return=e.value+"{"+pf(e.children,r)+"}";case Th:if(!Ur(e.value=e.props.join(",")))return""}return Ur(n=pf(e.children,r))?e.return=e.value+"{"+n+"}":""}function uB(e){var t=Sk(e);return function(n,r,o,i){for(var s="",a=0;a<t;a++)s+=e[a](n,r,o,i)||"";return s}}function dB(e){return function(t){t.root||(t=t.return)&&e(t)}}function fB(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case S0:e.return=Ek(e.value,e.length,n);return;case bk:return pf([Zo(e,{value:we(e.value,"@","@"+Ie)})],r);case Th:if(e.length)return Zz(n=e.props,function(o){switch(ho(o,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Qs(Zo(e,{props:[we(o,/:(read-\w+)/,":"+bc+"$1")]})),Qs(Zo(e,{props:[o]})),wm(e,{props:s1(n,r)});break;case"::placeholder":Qs(Zo(e,{props:[we(o,/:(plac\w+)/,":"+Ie+"input-$1")]})),Qs(Zo(e,{props:[we(o,/:(plac\w+)/,":"+bc+"$1")]})),Qs(Zo(e,{props:[we(o,/:(plac\w+)/,qe+"input-$1")]})),Qs(Zo(e,{props:[o]})),wm(e,{props:s1(n,r)});break}return""})}}var hB={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},za=typeof process<"u"&&xn!==void 0&&(xn.REACT_APP_SC_ATTR||xn.SC_ATTR)||"data-styled",kk="active",Ok="data-styled-version",Rh="6.1.12",E0=`/*!sc*/
24
+ `,gf=typeof window<"u"&&"HTMLElement"in window,pB=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&xn!==void 0&&xn.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&xn.REACT_APP_SC_DISABLE_SPEEDY!==""?xn.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&xn.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&xn!==void 0&&xn.SC_DISABLE_SPEEDY!==void 0&&xn.SC_DISABLE_SPEEDY!==""&&xn.SC_DISABLE_SPEEDY!=="false"&&xn.SC_DISABLE_SPEEDY),Ih=Object.freeze([]),Ba=Object.freeze({});function gB(e,t,n){return n===void 0&&(n=Ba),e.theme!==n.theme&&e.theme||t||n.theme}var Tk=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),mB=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,vB=/(^-|-$)/g;function c1(e){return e.replace(mB,"-").replace(vB,"")}var yB=/(a)(d)/gi,Yu=52,u1=function(e){return String.fromCharCode(e+(e>25?39:97))};function Em(e){var t,n="";for(t=Math.abs(e);t>Yu;t=t/Yu|0)n=u1(t%Yu)+n;return(u1(t%Yu)+n).replace(yB,"$1-$2")}var zp,_k=5381,ya=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Mk=function(e){return ya(_k,e)};function bB(e){return Em(Mk(e)>>>0)}function xB(e){return e.displayName||e.name||"Component"}function Bp(e){return typeof e=="string"&&!0}var Dk=typeof Symbol=="function"&&Symbol.for,Rk=Dk?Symbol.for("react.memo"):60115,wB=Dk?Symbol.for("react.forward_ref"):60112,SB={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},CB={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ik={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},EB=((zp={})[wB]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zp[Rk]=Ik,zp);function d1(e){return("type"in(t=e)&&t.type.$$typeof)===Rk?Ik:"$$typeof"in e?EB[e.$$typeof]:SB;var t}var kB=Object.defineProperty,OB=Object.getOwnPropertyNames,f1=Object.getOwnPropertySymbols,TB=Object.getOwnPropertyDescriptor,_B=Object.getPrototypeOf,h1=Object.prototype;function Nk(e,t,n){if(typeof t!="string"){if(h1){var r=_B(t);r&&r!==h1&&Nk(e,r,n)}var o=OB(t);f1&&(o=o.concat(f1(t)));for(var i=d1(e),s=d1(t),a=0;a<o.length;++a){var l=o[a];if(!(l in CB||n&&n[l]||s&&l in s||i&&l in i)){var c=TB(t,l);try{kB(e,l,c)}catch{}}}}return e}function Fa(e){return typeof e=="function"}function k0(e){return typeof e=="object"&&"styledComponentId"in e}function ds(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function p1(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function $c(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function km(e,t,n){if(n===void 0&&(n=!1),!n&&!$c(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=km(e[r],t[r]);else if($c(t))for(var r in t)e[r]=km(e[r],t[r]);return e}function O0(e,t){Object.defineProperty(e,"toString",{value:t})}function vu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var MB=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,o=r.length,i=o;t>=i;)if((i<<=1)<0)throw vu(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var s=o;s<i;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(t+1),l=(s=0,n.length);s<l;s++)this.tag.insertRule(a,n[s])&&(this.groupSizes[t]++,a++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),o=r+n;this.groupSizes[t]=0;for(var i=r;i<o;i++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],o=this.indexOfGroup(t),i=o+r,s=o;s<i;s++)n+="".concat(this.tag.getRule(s)).concat(E0);return n},e}(),Dd=new Map,mf=new Map,Rd=1,Xu=function(e){if(Dd.has(e))return Dd.get(e);for(;mf.has(Rd);)Rd++;var t=Rd++;return Dd.set(e,t),mf.set(t,e),t},DB=function(e,t){Rd=t+1,Dd.set(e,t),mf.set(t,e)},RB="style[".concat(za,"][").concat(Ok,'="').concat(Rh,'"]'),IB=new RegExp("^".concat(za,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),NB=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},PB=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(E0),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var l=a.match(IB);if(l){var c=0|parseInt(l[1],10),u=l[2];c!==0&&(DB(u,c),NB(e,u,l[3]),e.getTag().insertRules(c,o)),o.length=0}else o.push(a)}}},g1=function(e){for(var t=document.querySelectorAll(RB),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(za)!==kk&&(PB(e,o),o.parentNode&&o.parentNode.removeChild(o))}};function AB(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Pk=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(a){var l=Array.from(a.querySelectorAll("style[".concat(za,"]")));return l[l.length-1]}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(za,kk),r.setAttribute(Ok,Rh);var s=AB();return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},LB=function(){function e(t){this.element=Pk(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,o=0,i=r.length;o<i;o++){var s=r[o];if(s.ownerNode===n)return s}throw vu(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e}(),jB=function(){function e(t){this.element=Pk(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),$B=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),m1=gf,zB={isServer:!gf,useCSSOMInjection:!pB},Ak=function(){function e(t,n,r){t===void 0&&(t=Ba),n===void 0&&(n={});var o=this;this.options=Sn(Sn({},zB),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&gf&&m1&&(m1=!1,g1(this)),O0(this,function(){return function(i){for(var s=i.getTag(),a=s.length,l="",c=function(d){var f=function(b){return mf.get(b)}(d);if(f===void 0)return"continue";var h=i.names.get(f),p=s.getGroup(d);if(h===void 0||!h.size||p.length===0)return"continue";var g="".concat(za,".g").concat(d,'[id="').concat(f,'"]'),m="";h!==void 0&&h.forEach(function(b){b.length>0&&(m+="".concat(b,","))}),l+="".concat(p).concat(g,'{content:"').concat(m,'"}').concat(E0)},u=0;u<a;u++)c(u);return l}(o)})}return e.registerId=function(t){return Xu(t)},e.prototype.rehydrate=function(){!this.server&&gf&&g1(this)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(Sn(Sn({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(n){var r=n.useCSSOMInjection,o=n.target;return n.isServer?new $B(o):r?new LB(o):new jB(o)}(this.options),new MB(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(Xu(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(Xu(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Xu(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),BB=/&/g,FB=/^\s*\/\/.*$/gm;function Lk(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=Lk(n.children,t)),n})}function HB(e){var t,n,r,o=Ba,i=o.options,s=i===void 0?Ba:i,a=o.plugins,l=a===void 0?Ih:a,c=function(f,h,p){return p.startsWith(n)&&p.endsWith(n)&&p.replaceAll(n,"").length>0?".".concat(t):f},u=l.slice();u.push(function(f){f.type===Th&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(BB,n).replace(r,c))}),s.prefix&&u.push(fB),u.push(cB);var d=function(f,h,p,g){h===void 0&&(h=""),p===void 0&&(p=""),g===void 0&&(g="&"),t=g,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var m=f.replace(FB,""),b=aB(p||h?"".concat(p," ").concat(h," { ").concat(m," }"):m);s.namespace&&(b=Lk(b,s.namespace));var y=[];return pf(b,uB(u.concat(dB(function(w){return y.push(w)})))),y};return d.hash=l.length?l.reduce(function(f,h){return h.name||vu(15),ya(f,h.name)},_k).toString():"",d}var VB=new Ak,Om=HB(),jk=U.createContext({shouldForwardProp:void 0,styleSheet:VB,stylis:Om});jk.Consumer;U.createContext(void 0);function v1(){return x.useContext(jk)}var WB=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=Om);var s=r.name+i.hash;o.hasNameForId(r.id,s)||o.insertRules(r.id,s,i(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,O0(this,function(){throw vu(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Om),this.name+t.hash},e}(),UB=function(e){return e>="A"&&e<="Z"};function y1(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;UB(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var $k=function(e){return e==null||e===!1||e===""},zk=function(e){var t,n,r=[];for(var o in e){var i=e[o];e.hasOwnProperty(o)&&!$k(i)&&(Array.isArray(i)&&i.isCss||Fa(i)?r.push("".concat(y1(o),":"),i,";"):$c(i)?r.push.apply(r,hf(hf(["".concat(o," {")],zk(i),!1),["}"],!1)):r.push("".concat(y1(o),": ").concat((t=o,(n=i)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in hB||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function ys(e,t,n,r){if($k(e))return[];if(k0(e))return[".".concat(e.styledComponentId)];if(Fa(e)){if(!Fa(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var o=e(t);return ys(o,t,n,r)}var i;return e instanceof WB?n?(e.inject(n,r),[e.getName(r)]):[e]:$c(e)?zk(e):Array.isArray(e)?Array.prototype.concat.apply(Ih,e.map(function(s){return ys(s,t,n,r)})):[e.toString()]}function qB(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Fa(n)&&!k0(n))return!1}return!0}var KB=Mk(Rh),GB=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&qB(t),this.componentId=n,this.baseHash=ya(KB,n),this.baseStyle=r,Ak.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))o=ds(o,this.staticRulesId);else{var i=p1(ys(this.rules,t,n,r)),s=Em(ya(this.baseHash,i)>>>0);if(!n.hasNameForId(this.componentId,s)){var a=r(i,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,a)}o=ds(o,s),this.staticRulesId=s}else{for(var l=ya(this.baseHash,r.hash),c="",u=0;u<this.rules.length;u++){var d=this.rules[u];if(typeof d=="string")c+=d;else if(d){var f=p1(ys(d,t,n,r));l=ya(l,f+u),c+=f}}if(c){var h=Em(l>>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(c,".".concat(h),void 0,this.componentId)),o=ds(o,h)}}return o},e}(),Bk=U.createContext(void 0);Bk.Consumer;var Fp={};function YB(e,t,n){var r=k0(e),o=e,i=!Bp(e),s=t.attrs,a=s===void 0?Ih:s,l=t.componentId,c=l===void 0?function(S,C){var E=typeof S!="string"?"sc":c1(S);Fp[E]=(Fp[E]||0)+1;var k="".concat(E,"-").concat(bB(Rh+E+Fp[E]));return C?"".concat(C,"-").concat(k):k}(t.displayName,t.parentComponentId):l,u=t.displayName,d=u===void 0?function(S){return Bp(S)?"styled.".concat(S):"Styled(".concat(xB(S),")")}(e):u,f=t.displayName&&t.componentId?"".concat(c1(t.displayName),"-").concat(t.componentId):t.componentId||c,h=r&&o.attrs?o.attrs.concat(a).filter(Boolean):a,p=t.shouldForwardProp;if(r&&o.shouldForwardProp){var g=o.shouldForwardProp;if(t.shouldForwardProp){var m=t.shouldForwardProp;p=function(S,C){return g(S,C)&&m(S,C)}}else p=g}var b=new GB(n,f,r?o.componentStyle:void 0);function y(S,C){return function(E,k,_){var T=E.attrs,D=E.componentStyle,O=E.defaultProps,M=E.foldedComponentIds,R=E.styledComponentId,I=E.target,N=U.useContext(Bk),$=v1(),A=E.shouldForwardProp||$.shouldForwardProp,z=gB(k,N,O)||Ba,F=function(P,j,Y){for(var re,se=Sn(Sn({},j),{className:void 0,theme:Y}),ie=0;ie<P.length;ie+=1){var _e=Fa(re=P[ie])?re(se):re;for(var Me in _e)se[Me]=Me==="className"?ds(se[Me],_e[Me]):Me==="style"?Sn(Sn({},se[Me]),_e[Me]):_e[Me]}return j.className&&(se.className=ds(se.className,j.className)),se}(T,k,z),V=F.as||I,ee={};for(var X in F)F[X]===void 0||X[0]==="$"||X==="as"||X==="theme"&&F.theme===z||(X==="forwardedAs"?ee.as=F.forwardedAs:A&&!A(X,V)||(ee[X]=F[X]));var W=function(P,j){var Y=v1(),re=P.generateAndInjectStyles(j,Y.styleSheet,Y.stylis);return re}(D,F),L=ds(M,R);return W&&(L+=" "+W),F.className&&(L+=" "+F.className),ee[Bp(V)&&!Tk.has(V)?"class":"className"]=L,ee.ref=_,x.createElement(V,ee)}(w,S,C)}y.displayName=d;var w=U.forwardRef(y);return w.attrs=h,w.componentStyle=b,w.displayName=d,w.shouldForwardProp=p,w.foldedComponentIds=r?ds(o.foldedComponentIds,o.styledComponentId):"",w.styledComponentId=f,w.target=r?o.target:e,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(S){this._foldedDefaultProps=r?function(C){for(var E=[],k=1;k<arguments.length;k++)E[k-1]=arguments[k];for(var _=0,T=E;_<T.length;_++)km(C,T[_],!0);return C}({},o.defaultProps,S):S}}),O0(w,function(){return".".concat(w.styledComponentId)}),i&&Nk(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function b1(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var x1=function(e){return Object.assign(e,{isCss:!0})};function Fk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Fa(e)||$c(e))return x1(ys(b1(Ih,hf([e],t,!0))));var r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?ys(r):x1(ys(b1(r,t)))}function Tm(e,t,n){if(n===void 0&&(n=Ba),!t)throw vu(1,t);var r=function(o){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return e(t,n,Fk.apply(void 0,hf([o],i,!1)))};return r.attrs=function(o){return Tm(e,t,Sn(Sn({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},r.withConfig=function(o){return Tm(e,t,Sn(Sn({},n),o))},r}var Hk=function(e){return Tm(YB,e)},T0=Hk;Tk.forEach(function(e){T0[e]=Hk(e)});const XB=Fk`
25
+ scrollbar-width: none;
26
+ -ms-overflow-style: none;
27
+ &::-webkit-scrollbar {
28
+ display: none;
29
+ }
30
+ `;T0.div`
31
+ position: relative; // for react-laag
32
+ display: flex;
33
+ flex-direction: column;
34
+ min-width: 0;
35
+ flex-basis: ${e=>e.$width||"auto"};
36
+ flex-grow: ${e=>!e.$width&&e.$flex?"1":"0"};
37
+ flex-shrink: ${e=>e.$width||!e.$flex?"0":"1"};
38
+ overflow: ${e=>e.$scroll?"auto":"initial"};
39
+ background: ${e=>e.$background};
40
+ border-left: ${e=>e.$borderLeft===!0?"1px solid var(--color-border)":e.$borderLeft};
41
+ border-right: ${e=>e.$borderRight===!0?"1px solid var(--color-border)":e.$borderRight};
42
+ padding: ${e=>e.$spacing?`0 calc(${e.$spacing} / 2)`:"0"};
43
+ ${e=>!e.$showScrollbar&&XB}
44
+
45
+ @media (max-width: 992px) {
46
+ ${e=>e.$widthTablet&&`flex-basis: ${e.$widthTablet};`}
47
+ }
48
+
49
+ @media (max-width: 575px) {
50
+ ${e=>e.$widthMobile&&`flex-basis: ${e.$widthMobile};`}
51
+ }
52
+
53
+ > .inner {
54
+ flex-basis: 100%;
55
+ position: relative;
56
+ z-index: 0;
57
+ min-height: 0;
58
+ display: ${e=>e.$flexbox&&!e.$scroll?"flex":"block"};
59
+ ${e=>e.$flexbox&&"flex-direction: column;"}
60
+ padding: ${e=>e.$padding===!0?"var(--padding)":e.$padding};
61
+ }
62
+ `;const JB="_divider_2bfzh_1",ZB="_alignLeft_2bfzh_12",QB="_alignRight_2bfzh_15",_m={divider:JB,alignLeft:ZB,alignRight:QB},eF="_bold_11ofj_1",tF="_center_11ofj_4",nF="_muted_11ofj_7",rF="_faint_11ofj_10",oF="_success_11ofj_13",iF="_warning_11ofj_16",sF="_error_11ofj_19",aF="_small_11ofj_22",lF="_link_11ofj_25",jr={bold:eF,center:tF,muted:nF,faint:rF,success:oF,warning:iF,error:sF,small:aF,link:lF},bs=({children:e,bold:t=!1,center:n=!1,error:r=!1,faint:o=!1,link:i=!1,muted:s=!1,onClick:a,small:l=!1,success:c=!1,warning:u=!1})=>v.jsx("span",{className:oe(t&&jr.bold,n&&jr.center,r&&jr.error,o&&jr.faint,i&&jr.link,s&&jr.muted,a&&jr.clickable,l&&jr.small,c&&jr.success,u&&jr.warning),onClick:a,children:e}),cF=e=>{switch(e){case Xt.LEFT:return _m.alignLeft;case Xt.RIGHT:return _m.alignRight;default:return""}},Rhe=({children:e,margin:t="var(--padding)",color:n="var(--color-border)",align:r=Xt.CENTER})=>v.jsx("div",{className:`${_m.divider} ${cF(r)}`,style:{marginTop:t,marginBottom:t,"--color":n},children:typeof e=="string"?v.jsx(bs,{muted:!0,children:e}):e}),uF="_heading_yhdiy_1",dF="_top_yhdiy_10",fF="_icons_yhdiy_20",Hp={heading:uF,top:dF,icons:fF},Vk=({children:e,helpText:t,onClick:n,onClickHelp:r,onIconClick:o,icon:i,libraryIcon:s,marginBottom:a,top:l=!1,testId:c})=>{const u=!!t||!!r;return v.jsxs("div",{className:oe(Hp.heading,l?Hp.top:""),style:{marginBottom:a},onClick:n,"data-testid":c,children:[e,v.jsxs("div",{className:Hp.icons,children:[i&&v.jsx(Er,{onClick:o,icon:i}),u&&v.jsx(Er,{text:t,onClick:r}),s&&v.jsx(Er,{text:(s==null?void 0:s.tooltip)??"",onClick:s.onClick,icon:Ce.LIBRARY})]})]})},hF="_inline_1f40p_90",pF="_left_1f40p_93",gF="_right_1f40p_96",mF="_fixed_1f40p_99",vF="_border_1f40p_111",yF="_shadow_1f40p_117",bF="_drawerContent_1f40p_120",xF="_isResizing_1f40p_132",wF="_toggleButton_1f40p_143",SF="_top_1f40p_156",CF="_bottom_1f40p_159",EF="_toggleButtonOpen_1f40p_162",kF="_tabs_1f40p_165",OF="_tab_1f40p_165",TF="_active_1f40p_197",_F="_disabled_1f40p_222",MF="_tabsContent_1f40p_229",DF="_resizeHandle_1f40p_235",yt={inline:hF,left:pF,right:gF,fixed:mF,border:vF,shadow:yF,drawerContent:bF,isResizing:xF,toggleButton:wF,top:SF,bottom:CF,toggleButtonOpen:EF,tabs:kF,tab:OF,active:TF,disabled:_F,tabsContent:MF,resizeHandle:DF},RF=({badge:e,children:t})=>e?v.jsx(ll,{small:!0,margin:4,title:e.toString(),children:t}):v.jsx(v.Fragment,{children:t}),IF=({tabs:e,activeTab:t,open:n,background:r,handleTabClick:o,width:i,testId:s})=>v.jsxs(v.Fragment,{children:[v.jsx("div",{className:yt.tabs,children:e.map((a,l)=>v.jsx("div",{className:oe(yt.tab,t===l&&n?yt.active:"",a.disabled?yt.disabled:""),style:{background:r},onClick:a.disabled?void 0:()=>o(l),"data-testid":s&&`${s}-icon-${l}`,children:v.jsx(RF,{badge:a.badge,children:a.icon})},l))}),e.map((a,l)=>{const c=t===l;return v.jsx("div",{style:{width:typeof i=="number"?`${i}px`:i},className:yt.tabsContent,"data-testid":s&&`${s}-content-${l}`,children:c&&n&&a.content},l)})]});var _0={exports:{}},yu={},Nh={exports:{}},Wk={};function Uk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Uk(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function w1(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Uk(e))&&(r&&(r+=" "),r+=t);return r}const NF=Object.freeze(Object.defineProperty({__proto__:null,clsx:w1,default:w1},Symbol.toStringTag,{value:"Module"})),PF=KE(NF);var ot={},to={};Object.defineProperty(to,"__esModule",{value:!0});to.dontSetMe=zF;to.findInArray=AF;to.int=$F;to.isFunction=LF;to.isNum=jF;function AF(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function LF(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function jF(e){return typeof e=="number"&&!isNaN(e)}function $F(e){return parseInt(e,10)}function zF(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.browserPrefixToKey=Kk;zs.browserPrefixToStyle=BF;zs.default=void 0;zs.getPrefix=qk;const Vp=["Moz","Webkit","O","ms"];function qk(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Vp.length;r++)if(Kk(t,Vp[r])in n)return Vp[r];return""}function Kk(e,t){return t?"".concat(t).concat(FF(e)):e}function BF(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function FF(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}zs.default=qk();Object.defineProperty(ot,"__esModule",{value:!0});ot.addClassName=Xk;ot.addEvent=WF;ot.addUserSelectStyles=tH;ot.createCSSTransform=JF;ot.createSVGTransform=ZF;ot.getTouch=QF;ot.getTouchIdentifier=eH;ot.getTranslation=M0;ot.innerHeight=GF;ot.innerWidth=YF;ot.matchesSelector=Yk;ot.matchesSelectorAndParentsTo=VF;ot.offsetXYFromParent=XF;ot.outerHeight=qF;ot.outerWidth=KF;ot.removeClassName=Jk;ot.removeEvent=UF;ot.removeUserSelectStyles=nH;var zn=to,S1=HF(zs);function Gk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Gk=function(r){return r?n:t})(e)}function HF(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Gk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Ju="";function Yk(e,t){return Ju||(Ju=(0,zn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,zn.isFunction)(e[n])})),(0,zn.isFunction)(e[Ju])?e[Ju](t):!1}function VF(e,t,n){let r=e;do{if(Yk(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function WF(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function UF(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function qF(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,zn.int)(n.borderTopWidth),t+=(0,zn.int)(n.borderBottomWidth),t}function KF(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,zn.int)(n.borderLeftWidth),t+=(0,zn.int)(n.borderRightWidth),t}function GF(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,zn.int)(n.paddingTop),t-=(0,zn.int)(n.paddingBottom),t}function YF(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,zn.int)(n.paddingLeft),t-=(0,zn.int)(n.paddingRight),t}function XF(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function JF(e,t){const n=M0(e,t,"px");return{[(0,S1.browserPrefixToKey)("transform",S1.default)]:n}}function ZF(e,t){return M0(e,t,"")}function M0(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function QF(e,t){return e.targetTouches&&(0,zn.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,zn.findInArray)(e.changedTouches,n=>t===n.identifier)}function eH(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function tH(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
63
+ `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
64
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Xk(e.body,"react-draggable-transparent-selection")}function nH(e){if(e)try{if(e.body&&Jk(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function Xk(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Jk(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var no={};Object.defineProperty(no,"__esModule",{value:!0});no.canDragX=iH;no.canDragY=sH;no.createCoreData=lH;no.createDraggableData=cH;no.getBoundPosition=rH;no.getControlPosition=aH;no.snapToGrid=oH;var In=to,ba=ot;function rH(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:uH(r);const o=D0(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,In.int)(u.paddingLeft)+(0,In.int)(c.marginLeft),top:-o.offsetTop+(0,In.int)(u.paddingTop)+(0,In.int)(c.marginTop),right:(0,ba.innerWidth)(l)-(0,ba.outerWidth)(o)-o.offsetLeft+(0,In.int)(u.paddingRight)-(0,In.int)(c.marginRight),bottom:(0,ba.innerHeight)(l)-(0,ba.outerHeight)(o)-o.offsetTop+(0,In.int)(u.paddingBottom)-(0,In.int)(c.marginBottom)}}return(0,In.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,In.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,In.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,In.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function oH(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function iH(e){return e.props.axis==="both"||e.props.axis==="x"}function sH(e){return e.props.axis==="both"||e.props.axis==="y"}function aH(e,t,n){const r=typeof t=="number"?(0,ba.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=D0(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,ba.offsetXYFromParent)(r||e,i,n.props.scale)}function lH(e,t,n){const r=!(0,In.isNum)(e.lastX),o=D0(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function cH(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function uH(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function D0(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Ph={},Ah={};Object.defineProperty(Ah,"__esModule",{value:!0});Ah.default=dH;function dH(){}Object.defineProperty(Ph,"__esModule",{value:!0});Ph.default=void 0;var Wp=hH(U),yn=R0(fu),fH=R0(nE),Ut=ot,Vo=no,Up=to,Dl=R0(Ah);function R0(e){return e&&e.__esModule?e:{default:e}}function Zk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Zk=function(r){return r?n:t})(e)}function hH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Zk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function on(e,t,n){return t=pH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pH(e){var t=gH(e,"string");return typeof t=="symbol"?t:String(t)}function gH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const fr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Wo=fr.mouse,Lh=class extends Wp.Component{constructor(){super(...arguments),on(this,"dragging",!1),on(this,"lastX",NaN),on(this,"lastY",NaN),on(this,"touchIdentifier",null),on(this,"mounted",!1),on(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Ut.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Ut.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Ut.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Vo.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Vo.createCoreData)(this,s,a);(0,Dl.default)("DraggableCore: handleDragStart: %j",l),(0,Dl.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ut.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Ut.addEvent)(r,Wo.move,this.handleDrag),(0,Ut.addEvent)(r,Wo.stop,this.handleDragStop))}),on(this,"handleDrag",t=>{const n=(0,Vo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Vo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Vo.createCoreData)(this,r,o);if((0,Dl.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),on(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Vo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Vo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Vo.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Ut.removeUserSelectStyles)(a.ownerDocument),(0,Dl.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Dl.default)("DraggableCore: Removing handlers"),(0,Ut.removeEvent)(a.ownerDocument,Wo.move,this.handleDrag),(0,Ut.removeEvent)(a.ownerDocument,Wo.stop,this.handleDragStop))}),on(this,"onMouseDown",t=>(Wo=fr.mouse,this.handleDragStart(t))),on(this,"onMouseUp",t=>(Wo=fr.mouse,this.handleDragStop(t))),on(this,"onTouchStart",t=>(Wo=fr.touch,this.handleDragStart(t))),on(this,"onTouchEnd",t=>(Wo=fr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Ut.addEvent)(t,fr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Ut.removeEvent)(n,fr.mouse.move,this.handleDrag),(0,Ut.removeEvent)(n,fr.touch.move,this.handleDrag),(0,Ut.removeEvent)(n,fr.mouse.stop,this.handleDragStop),(0,Ut.removeEvent)(n,fr.touch.stop,this.handleDragStop),(0,Ut.removeEvent)(t,fr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ut.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:fH.default.findDOMNode(this)}render(){return Wp.cloneElement(Wp.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ph.default=Lh;on(Lh,"displayName","DraggableCore");on(Lh,"propTypes",{allowAnyClick:yn.default.bool,children:yn.default.node.isRequired,disabled:yn.default.bool,enableUserSelectHack:yn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:yn.default.arrayOf(yn.default.number),handle:yn.default.string,cancel:yn.default.string,nodeRef:yn.default.object,onStart:yn.default.func,onDrag:yn.default.func,onStop:yn.default.func,onMouseDown:yn.default.func,scale:yn.default.number,className:Up.dontSetMe,style:Up.dontSetMe,transform:Up.dontSetMe});on(Lh,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(U),n=u(fu),r=u(nE),o=u(PF),i=ot,s=no,a=to,l=u(Ph),c=u(Ah);function u(y){return y&&y.__esModule?y:{default:y}}function d(y){if(typeof WeakMap!="function")return null;var w=new WeakMap,S=new WeakMap;return(d=function(C){return C?S:w})(y)}function f(y,w){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var S=d(w);if(S&&S.has(y))return S.get(y);var C={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in y)if(k!=="default"&&Object.prototype.hasOwnProperty.call(y,k)){var _=E?Object.getOwnPropertyDescriptor(y,k):null;_&&(_.get||_.set)?Object.defineProperty(C,k,_):C[k]=y[k]}return C.default=y,S&&S.set(y,C),C}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var w=1;w<arguments.length;w++){var S=arguments[w];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(y[C]=S[C])}return y},h.apply(this,arguments)}function p(y,w,S){return w=g(w),w in y?Object.defineProperty(y,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[w]=S,y}function g(y){var w=m(y,"string");return typeof w=="symbol"?w:String(w)}function m(y,w){if(typeof y!="object"||y===null)return y;var S=y[Symbol.toPrimitive];if(S!==void 0){var C=S.call(y,w);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(y)}class b extends t.Component{static getDerivedStateFromProps(w,S){let{position:C}=w,{prevPropsPosition:E}=S;return C&&(!E||C.x!==E.x||C.y!==E.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:E}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(w){super(w),p(this,"onDragStart",(S,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(S,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(S,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const E=(0,s.createDraggableData)(this,C),k={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:T,y:D}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[O,M]=(0,s.getBoundPosition)(this,k.x,k.y);k.x=O,k.y=M,k.slackX=this.state.slackX+(T-k.x),k.slackY=this.state.slackY+(D-k.y),E.x=k.x,E.y=k.y,E.deltaX=k.x-this.state.x,E.deltaY=k.y-this.state.y}if(this.props.onDrag(S,E)===!1)return!1;this.setState(k)}),p(this,"onDragStop",(S,C)=>{if(!this.state.dragging||this.props.onStop(S,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:T,y:D}=this.props.position;k.x=T,k.y=D}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,S;return(w=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:S,children:C,defaultPosition:E,defaultClassName:k,defaultClassNameDragging:_,defaultClassNameDragged:T,position:D,positionOffset:O,scale:M,...R}=this.props;let I={},N=null;const A=!!!D||this.state.dragging,z=D||E,F={x:(0,s.canDragX)(this)&&A?this.state.x:z.x,y:(0,s.canDragY)(this)&&A?this.state.y:z.y};this.state.isElementSVG?N=(0,i.createSVGTransform)(F,O):I=(0,i.createCSSTransform)(F,O);const V=(0,o.default)(C.props.className||"",k,{[_]:this.state.dragging,[T]:this.state.dragged});return t.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:V,style:{...C.props.style,...I},transform:N}))}}e.default=b,p(b,"displayName","Draggable"),p(b,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),p(b,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Wk);const{default:Qk,DraggableCore:mH}=Wk;Nh.exports=Qk;Nh.exports.default=Qk;Nh.exports.DraggableCore=mH;var vH=Nh.exports,I0={};I0.__esModule=!0;I0.cloneElement=CH;var yH=bH(U);function bH(e){return e&&e.__esModule?e:{default:e}}function C1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function E1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C1(Object(n),!0).forEach(function(r){xH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xH(e,t,n){return t=wH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wH(e){var t=SH(e,"string");return typeof t=="symbol"?t:String(t)}function SH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CH(e,t){return t.style&&e.props.style&&(t.style=E1(E1({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),yH.default.cloneElement(e,t)}var bu={};bu.__esModule=!0;bu.resizableProps=void 0;var be=EH(fu);function EH(e){return e&&e.__esModule?e:{default:e}}var kH={axis:be.default.oneOf(["both","x","y","none"]),className:be.default.string,children:be.default.element.isRequired,draggableOpts:be.default.shape({allowAnyClick:be.default.bool,cancel:be.default.string,children:be.default.node,disabled:be.default.bool,enableUserSelectHack:be.default.bool,offsetParent:be.default.node,grid:be.default.arrayOf(be.default.number),handle:be.default.string,nodeRef:be.default.object,onStart:be.default.func,onDrag:be.default.func,onStop:be.default.func,onMouseDown:be.default.func,scale:be.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=be.default.number).isRequired.apply(i,n)}return be.default.number.apply(be.default,n)},handle:be.default.oneOfType([be.default.node,be.default.func]),handleSize:be.default.arrayOf(be.default.number),lockAspectRatio:be.default.bool,maxConstraints:be.default.arrayOf(be.default.number),minConstraints:be.default.arrayOf(be.default.number),onResizeStop:be.default.func,onResizeStart:be.default.func,onResize:be.default.func,resizeHandles:be.default.arrayOf(be.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:be.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=be.default.number).isRequired.apply(i,n)}return be.default.number.apply(be.default,n)}};bu.resizableProps=kH;yu.__esModule=!0;yu.default=void 0;var Rl=DH(U),OH=vH,TH=I0,_H=bu,MH=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function eO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(eO=function(o){return o?n:t})(e)}function DH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=eO(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mm.apply(this,arguments)}function RH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(n),!0).forEach(function(r){IH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IH(e,t,n){return t=NH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NH(e){var t=PH(e,"string");return typeof t=="symbol"?t:String(t)}function PH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Dm(e,t)}function Dm(e,t){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Dm(e,t)}var N0=function(e){AH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var h=o,p=i,g=this.slack||[0,0],m=g[0],b=g[1];return o+=m,i+=b,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[m+(h-o),b+(p-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var p=i[0],g=i[i.length-1],m=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var b=m.left-s.lastHandleRect.left;u+=b}if(p==="n"){var y=m.top-s.lastHandleRect.top;d+=y}}s.lastHandleRect=m,g==="w"&&(u=-u),p==="n"&&(d=-d);var w=s.props.width+(f?u/s.props.transformScale:0),S=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(w,S);w=C[0],S=C[1];var E=w!==s.props.width||S!==s.props.height,k=typeof s.props[o]=="function"?s.props[o]:null,_=o==="onResize"&&!E;k&&!_&&(a.persist==null||a.persist(),k(a,{node:c,size:{width:w,height:S},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Rl.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=qp({ref:i},a?{}:{handleAxis:o});return Rl.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=RH(i,MH);return(0,TH.cloneElement)(s,qp(qp({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var f,h=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=Rl.createRef();return Rl.createElement(OH.DraggableCore,Mm({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(Rl.Component);yu.default=N0;N0.propTypes=_H.resizableProps;N0.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var jh={};jh.__esModule=!0;jh.default=void 0;var Kp=BH(U),LH=tO(fu),jH=tO(yu),$H=bu,zH=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function tO(e){return e&&e.__esModule?e:{default:e}}function nO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(nO=function(o){return o?n:t})(e)}function BH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=nO(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Rm(){return Rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rm.apply(this,arguments)}function O1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O1(Object(n),!0).forEach(function(r){FH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FH(e,t,n){return t=HH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HH(e){var t=VH(e,"string");return typeof t=="symbol"?t:String(t)}function VH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function UH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Im(e,t)}function Im(e,t){return Im=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Im(e,t)}var rO=function(e){UH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var p=o.resizeHandles,g=o.style,m=o.transformScale,b=WH(o,zH);return Kp.createElement(jH.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:m,width:this.state.width},Kp.createElement("div",Rm({},b,{style:vf(vf({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Kp.Component);jh.default=rO;rO.propTypes=vf(vf({},$H.resizableProps),{},{children:LH.default.element});_0.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var qH=_0.exports.Resizable=yu.default;_0.exports.ResizableBox=jh.default;const Nm=35,Zu=240,KH=x.forwardRef((e,t)=>{const{handleAxis:n,...r}=e;return v.jsx("div",{ref:t,className:yt.resizeHandle,...r,children:v.jsx(Ae,{icon:Ce.DRAG})})}),GH=({children:e=null,width:t=400,right:n=!1,onResize:r,setOpen:o})=>{const[i,s]=x.useState(!1),a=window.innerWidth/2,l=(c,{size:u})=>{r&&r(u.width)};return r?v.jsx(qH,{width:We.toNumber(t),height:100,minConstraints:[Nm,1/0],maxConstraints:[a,1/0],onResize:l,handle:v.jsx(KH,{}),resizeHandles:n?["w"]:["e"],axis:"x",className:i?yt.isResizing:"",onResizeStart:()=>{o&&o(!0),r&&r(t),s(!0)},onResizeStop:()=>{s(!1),typeof t=="number"&&t<Nm+50&&o&&o(!1)},children:e}):v.jsx(v.Fragment,{children:e})},YH=({background:e="var(--color-background-raised)",fixed:t=!1,open:n=!1,setOpen:r,right:o=!1,width:i=400,closedWidth:s=0,shadow:a=!1,top:l=0,button:c=null,buttonAnimate:u=!0,buttonPosition:d=b0.BOTTOM,border:f=!1,children:h=null,tabs:p,defaultTabIndex:g=0,activeTab:m,setActiveTab:b,testId:y,onResize:w,getActiveTab:S,onClose:C,onOpen:E})=>{const k=c===!0,_=!k&&x.isValidElement(c),[T,D]=r?[n,r]:k||p?x.useState(n):[n,()=>{}],[O,M]=x.useState(g),R=r?n:T,I=r||D,N=b!==void 0?m:O,$=b||M,A=Array.isArray(i)?i[N||0]:i,z=R?A:p?Nm:s,F=V=>{const ee=X=>{p&&X&&X(p[V])};N===V&&R&&I?(ee(C),I(!1)):!R&&I&&(ee(E),I(!0),w&&(W=>{let L;if(Array.isArray(W)?L=W[N||0]:L=W,typeof L=="number"&&L<Zu)w(Zu);else if(typeof L=="string"){const P=parseInt(L,10);!isNaN(P)&&P<Zu&&w(Zu)}})(i)),$(V),ee(S)};return v.jsx(GH,{width:z,onResize:w,setOpen:I,right:o,children:v.jsxs("div",{className:oe(yt.drawer,a?yt.shadow:"",t?yt.fixed:yt.inline,o?yt.right:yt.left),style:{top:l},children:[v.jsx("div",{className:oe(yt.drawerContent,f&&yt.border),style:{background:e,borderColor:typeof f=="string"?f:void 0,width:z},children:p?v.jsx(IF,{width:A,testId:y,tabs:p,open:R,activeTab:N||0,background:e,handleTabClick:F}):v.jsx("div",{style:{width:A},children:h})}),c&&v.jsx("span",{className:oe(yt.toggleButton,T&&(k||_&&u)?yt.toggleButtonOpen:"",d==="top"?yt.top:yt.bottom),children:_?c:v.jsx(ln,{onClick:I?()=>I(!R):void 0,round:!0,icon:o?Ce.CHEVRON_RIGHT:Ce.CHEVRON_LEFT})})]})})},XH="_inputGroup_biuoa_1",JH={inputGroup:XH},ZH=e=>x.isValidElement(e)&&typeof e.type=="string",QH=({children:e,small:t=!1,width:n="100%"})=>{const r=Array.isArray(e)?e.filter(i=>x.isValidElement(i)):[e],o=r.map((i,s)=>{const a=ZH(i),{groupOrder:l}=a?{groupOrder:null}:i.props,c=r.length,u=s===0,d=s===c-1,h=l||(!c||c===1?null:u?Vt.FIRST:d?Vt.LAST:Vt.MIDDLE);return a?i:v.jsx(x.Fragment,{children:U.cloneElement(i,{groupOrder:h,small:t})},s)});return v.jsx("div",{className:oe(JH.inputGroup),style:{width:n},children:o})},e3="_input_1285q_1",t3="_isInTable_1285q_100",n3="_small_1285q_124",r3="_right_1285q_170",o3="_groupOrderFirst_1285q_173",i3="_groupOrderMiddle_1285q_174",s3="_groupOrderLast_1285q_175",Qi={input:e3,isInTable:t3,small:n3,right:r3,groupOrderFirst:o3,groupOrderMiddle:i3,groupOrderLast:s3},P0=x.forwardRef(({error:e=null,tooltip:t=null,isInTable:n,width:r=void 0,small:o=!1,onChange:i=We.noop,placeholder:s="",value:a="",onKeyPress:l=()=>{},onFocus:c=()=>{},onBlur:u=()=>{},onPaste:d=()=>{},selectOnFocus:f=!0,name:h=void 0,type:p="text",tabIndex:g=0,disabled:m=!1,right:b=!1,warning:y=null,groupOrder:w=null,maxTooltipWidth:S=void 0,testId:C=void 0,size:E=null},k)=>{const _=x.useContext(ht),T=(()=>{if(w)switch(w){case Vt.FIRST:return Qi.groupOrderFirst;case Vt.LAST:return Qi.groupOrderLast;default:return Qi.groupOrderMiddle}return""})(),D=r||(E?"auto":"100%"),O=M=>{c(M),f&&setTimeout(()=>M.target.select(),0)};return v.jsx("div",{style:{width:D},className:T,children:v.jsx(hn,{error:!!e,warning:!!y,text:t||e||y,enabled:t&&ft(t)||e&&ft(e)||y&&ft(y)||!1,maxWidth:S,display:"block",children:v.jsx("input",{ref:k,type:p||"text",size:E||20,placeholder:s??"",value:a??"",onChange:i,onKeyPress:l,onFocus:O,onBlur:u,onPaste:d,name:h,tabIndex:g,autoComplete:"off",disabled:m||_,className:oe(Qi.input,b?Qi.right:"",o?Qi.small:"",n?Qi.isInTable:""),style:{width:D},"data-error":e||null,"data-warning":y||null,"data-testid":C})})})}),a3="_label_18pfe_1",l3="_labelLeft_18pfe_5",c3="_icons_18pfe_13",Gp={label:a3,labelLeft:l3,icons:c3},u3=({label:e=null,width:t="auto",helpText:n="",helpTextMaxWidth:r="300px",onClickHelp:o=void 0,lock:i={visible:!1,active:!1,onClick:()=>{},tooltip:"",testId:void 0},info:s,libraryIcon:a,labelLeft:l=!1})=>v.jsx("div",{className:oe(Gp.label,l?Gp.labelLeft:""),children:v.jsxs("label",{style:{width:t||""},children:[e,v.jsxs("div",{className:Gp.icons,children:[(n||o)&&v.jsx(Er,{text:n,onClick:o,maxWidth:r}),s&&v.jsx(Er,{text:s,icon:Ce.INFO}),i&&i.visible&&i.onClick&&v.jsx(Er,{onClick:i.onClick,icon:i.active?Ce.LOCK:Ce.UNLOCK,active:i.active,testId:i.testId}),a&&v.jsx(Er,{text:(a==null?void 0:a.tooltip)??"",onClick:a.onClick,icon:Ce.LIBRARY})]})]})}),d3="_field_1xoss_1",f3="_labelLeft_1xoss_5",h3="_fieldInput_1xoss_9",Yp={field:d3,labelLeft:f3,fieldInput:h3},Nhe=({label:e,labelLeft:t=!1,labelWidth:n="auto",children:r,helpText:o,helpTextMaxWidth:i="300px",onClickHelp:s,lock:a={visible:!1,active:!1,onClick:()=>{},tooltip:"",testId:void 0},info:l,libraryIcon:c,testId:u})=>v.jsxs("div",{className:oe(Yp.field,t?Yp.labelLeft:""),"data-testid":u,children:[(e||t)&&v.jsx(u3,{label:e,width:n,helpText:o,helpTextMaxWidth:i,onClickHelp:s,lock:a,info:l,libraryIcon:c,labelLeft:t}),v.jsx("div",{className:Yp.fieldInput,children:r})]}),Phe=({alignItems:e="initial",justifyContent:t="initial",direction:n="initial",height:r="initial",children:o=null,wrap:i=!0,gap:s=!1})=>v.jsx("div",{style:{display:"flex",flexDirection:n,alignItems:e,justifyContent:t,height:typeof r=="number"?`${r}px`:r,flexWrap:i?"wrap":"nowrap",gap:s===!1?0:s===!0?"var(--padding)":typeof s=="number"?`${s}px`:s},children:o}),p3="_formRow_odewu_1",g3={formRow:p3},Ahe=({children:e})=>v.jsx("div",{className:g3.formRow,children:e}),m3=e=>typeof e=="boolean"?e?"20px":"0px":typeof e=="number"?`${e}px`:e||"initial",Il=e=>typeof e=="number"?`${e}px`:e||"initial";T0.div`
65
+ display: grid;
66
+ gap: ${e=>m3(e.$gap)};
67
+ grid-template-rows: ${e=>Il(e.$rows)};
68
+ grid-template-columns: ${e=>Il(e.$columns)};
69
+ height: ${e=>Il(e.$height)};
70
+
71
+ @media (max-width: 992px) {
72
+ ${e=>e.$columnsTablet&&`grid-template-columns: ${Il(e.$columnsTablet)};`}
73
+ }
74
+
75
+ @media (max-width: 575px) {
76
+ ${e=>e.$columnsMobile&&`grid-template-columns: ${Il(e.$columnsMobile)};`}
77
+ }
78
+ `;const v3="_addon_b4w53_1",y3="_small_b4w53_12",b3="_groupOrderFirst_b4w53_16",x3="_groupOrderMiddle_b4w53_17",w3="_groupOrderLast_b4w53_21",Nl={addon:v3,small:y3,groupOrderFirst:b3,groupOrderMiddle:x3,groupOrderLast:w3},S3=({children:e,groupOrder:t,small:n=!1})=>{const r=(()=>{if(t)switch(t){case Vt.FIRST:return Nl.groupOrderFirst;case Vt.LAST:return Nl.groupOrderLast;default:return Nl.groupOrderMiddle}return""})();return v.jsx("span",{className:oe(Nl.addon,r,n?Nl.small:""),children:e})},C3="_item_1wss1_87",E3="_header_1wss1_90",k3="_headerTitle_1wss1_90",O3="_heading_1wss1_91",T3="_itemHeader_1wss1_91",_3="_stickyHeader_1wss1_98",M3="_title_1wss1_109",D3="_name_1wss1_115",R3="_iconTooltipMargin_1wss1_119",I3="_bold_1wss1_122",N3="_toggleNarrow_1wss1_133",P3="_drag_1wss1_151",A3="_action_1wss1_202",L3="_active_1wss1_205",j3="_disabled_1wss1_225",$3="_label_1wss1_236",z3="_details_1wss1_247",B3="_metadata_1wss1_248",F3="_itemContent_1wss1_256",H3="_indentIcon_1wss1_263",V3="_expandIcon_1wss1_268",W3="_expanded_1wss1_275",U3="_right_1wss1_278",q3="_actions_1wss1_286",Te={item:C3,header:E3,headerTitle:k3,heading:O3,itemHeader:T3,stickyHeader:_3,title:M3,name:D3,iconTooltipMargin:R3,bold:I3,toggleNarrow:N3,drag:P3,action:A3,active:L3,disabled:j3,label:$3,details:z3,metadata:B3,itemContent:F3,indentIcon:H3,expandIcon:V3,expanded:W3,right:U3,actions:q3},K3=({toggleNarrow:e,onClickToggleNarrow:t})=>e?v.jsx("a",{className:Te.toggleNarrow,onClick:t,children:v.jsx(Ae,{icon:Ce.CHEVRON_LEFT})}):null;x.forwardRef(({name:e,actions:t=[],toggleNarrow:n=!1,onToggleNarrow:r=()=>{},stickyHeader:o},i)=>v.jsxs("div",{ref:i,className:oe(Te.header,o?Te.stickyHeader:""),children:[v.jsx(K3,{toggleNarrow:n,onClickToggleNarrow:r}),e&&v.jsx("div",{className:Te.headerTitle,children:v.jsx(Vk,{top:!0,marginBottom:0,children:e})}),v.jsx("div",{className:Te.right,children:v.jsx("div",{className:Te.actions,children:v.jsx(Vi,{actions:t})})})]}));function G3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const $h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ul(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function A0(e){return"nodeType"in e}function pn(e){var t,n;return e?ul(e)?e:A0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function L0(e){const{Document:t}=pn(e);return e instanceof t}function xu(e){return ul(e)?!1:e instanceof pn(e).HTMLElement}function oO(e){return e instanceof pn(e).SVGElement}function dl(e){return e?ul(e)?e.document:A0(e)?L0(e)?e:xu(e)||oO(e)?e.ownerDocument:document:document:document}const tr=$h?x.useLayoutEffect:x.useEffect;function zh(e){const t=x.useRef(e);return tr(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Y3(){const e=x.useRef(null),t=x.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function zc(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return tr(()=>{n.current!==e&&(n.current=e)},t),n}function wu(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function yf(e){const t=zh(e),n=x.useRef(null),r=x.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function bf(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let Xp={};function Su(e,t){return x.useMemo(()=>{if(t)return t;const n=Xp[e]==null?0:Xp[e]+1;return Xp[e]=n,e+"-"+n},[e,t])}function iO(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=i[l];u!=null&&(i[l]=u+e*c)}return i},{...t})}}const Ea=iO(1),xf=iO(-1);function X3(e){return"clientX"in e&&"clientY"in e}function Bh(e){if(!e)return!1;const{KeyboardEvent:t}=pn(e.target);return t&&e instanceof t}function J3(e){if(!e)return!1;const{TouchEvent:t}=pn(e.target);return t&&e instanceof t}function wf(e){if(J3(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return X3(e)?{x:e.clientX,y:e.clientY}:null}const So=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[So.Translate.toString(e),So.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),T1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Z3(e){return e.matches(T1)?e:e.querySelector(T1)}const Q3={display:"none"};function eV(e){let{id:t,value:n}=e;return U.createElement("div",{id:t,style:Q3},n)}function tV(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return U.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function nV(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const sO=x.createContext(null);function rV(e){const t=x.useContext(sO);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function oV(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const iV={draggable:`
79
+ To pick up a draggable item, press the space bar.
80
+ While dragging, use the arrow keys to move the item.
81
+ Press space again to drop the item in its new position, or press escape to cancel.
82
+ `},sV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function aV(e){let{announcements:t=sV,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=iV}=e;const{announce:i,announcement:s}=nV(),a=Su("DndLiveRegion"),[l,c]=x.useState(!1);if(x.useEffect(()=>{c(!0)},[]),rV(x.useMemo(()=>({onDragStart(d){let{active:f}=d;i(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&i(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;i(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;i(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;i(t.onDragCancel({active:f,over:h}))}}),[i,t])),!l)return null;const u=U.createElement(U.Fragment,null,U.createElement(eV,{id:r,value:o.draggable}),U.createElement(tV,{id:a,announcement:s}));return n?xr.createPortal(u,n):u}var xt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xt||(xt={}));function Sf(){}const Mr=Object.freeze({x:0,y:0});function lV(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cV(e,t){const n=wf(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function uV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function dV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function fV(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _1(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const hV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=_1(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=lV(_1(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(uV)};function pV(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,c=e.width*e.height,u=s*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const gV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=pV(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(dV)};function mV(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aO(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Mr}function vV(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const yV=vV(1);function lO(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function bV(e,t,n){const r=lO(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const xV={ignoreTransform:!1};function fl(e,t){t===void 0&&(t=xV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=pn(e).getComputedStyle(e);c&&(n=bV(n,c,u))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function M1(e){return fl(e,{ignoreTransform:!0})}function wV(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function SV(e,t){return t===void 0&&(t=pn(e).getComputedStyle(e)),t.position==="fixed"}function CV(e,t){t===void 0&&(t=pn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function j0(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(L0(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!xu(o)||oO(o)||n.includes(o))return n;const i=pn(e).getComputedStyle(o);return o!==e&&CV(o,i)&&n.push(o),SV(o,i)?n:r(o.parentNode)}return e?r(e):n}function cO(e){const[t]=j0(e,1);return t??null}function Jp(e){return!$h||!e?null:ul(e)?e:A0(e)?L0(e)||e===dl(e).scrollingElement?window:xu(e)?e:null:null}function uO(e){return ul(e)?e.scrollX:e.scrollLeft}function dO(e){return ul(e)?e.scrollY:e.scrollTop}function Pm(e){return{x:uO(e),y:dO(e)}}var Pt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pt||(Pt={}));function fO(e){return!$h||!e?!1:e===document.scrollingElement}function hO(e){const t={x:0,y:0},n=fO(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const EV={x:.2,y:.2};function kV(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=EV);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=hO(e),h={x:0,y:0},p={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+g.height?(h.y=Pt.Backward,p.y=r*Math.abs((t.top+g.height-i)/g.height)):!u&&l>=t.bottom-g.height&&(h.y=Pt.Forward,p.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!f&&a>=t.right-g.width?(h.x=Pt.Forward,p.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&s<=t.left+g.width&&(h.x=Pt.Backward,p.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:h,speed:p}}function OV(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function pO(e){return e.reduce((t,n)=>Ea(t,Pm(n)),Mr)}function TV(e){return e.reduce((t,n)=>t+uO(n),0)}function _V(e){return e.reduce((t,n)=>t+dO(n),0)}function gO(e,t){if(t===void 0&&(t=fl),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);cO(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const MV=[["x",["left","right"],TV],["y",["top","bottom"],_V]];class $0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=j0(n),o=pO(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of MV)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[i]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function DV(e){const{EventTarget:t}=pn(e);return e instanceof t?e:dl(e)}function Zp(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Gn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Gn||(Gn={}));function D1(e){e.preventDefault()}function RV(e){e.stopPropagation()}var Ne;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Ne||(Ne={}));const mO={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter]},IV=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ne.Right:return{...n,x:n.x+25};case Ne.Left:return{...n,x:n.x-25};case Ne.Down:return{...n,y:n.y+25};case Ne.Up:return{...n,y:n.y-25}}};class vO{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xc(dl(n)),this.windowListeners=new xc(pn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&gO(r),n(Mr)}handleKeyDown(t){if(Bh(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=mO,coordinateGetter:s=IV,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:Mr;this.referenceCoordinates||(this.referenceCoordinates=u);const d=s(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=xf(d,u),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const g of p){const m=t.code,{isTop:b,isRight:y,isLeft:w,isBottom:S,maxScroll:C,minScroll:E}=hO(g),k=OV(g),_={x:Math.min(m===Ne.Right?k.right-k.width/2:k.right,Math.max(m===Ne.Right?k.left:k.left+k.width/2,d.x)),y:Math.min(m===Ne.Down?k.bottom-k.height/2:k.bottom,Math.max(m===Ne.Down?k.top:k.top+k.height/2,d.y))},T=m===Ne.Right&&!y||m===Ne.Left&&!w,D=m===Ne.Down&&!S||m===Ne.Up&&!b;if(T&&_.x!==d.x){const O=g.scrollLeft+f.x,M=m===Ne.Right&&O<=C.x||m===Ne.Left&&O>=E.x;if(M&&!f.y){g.scrollTo({left:O,behavior:a});return}M?h.x=g.scrollLeft-O:h.x=m===Ne.Right?g.scrollLeft-C.x:g.scrollLeft-E.x,h.x&&g.scrollBy({left:-h.x,behavior:a});break}else if(D&&_.y!==d.y){const O=g.scrollTop+f.y,M=m===Ne.Down&&O<=C.y||m===Ne.Up&&O>=E.y;if(M&&!f.x){g.scrollTo({top:O,behavior:a});return}M?h.y=g.scrollTop-O:h.y=m===Ne.Down?g.scrollTop-C.y:g.scrollTop-E.y,h.y&&g.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Ea(xf(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}vO.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=mO,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function R1(e){return!!(e&&"distance"in e)}function I1(e){return!!(e&&"delay"in e)}class z0{constructor(t,n,r){var o;r===void 0&&(r=DV(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=dl(s),this.documentListeners=new xc(this.document),this.listeners=new xc(r),this.windowListeners=new xc(pn(s)),this.initialCoordinates=(o=wf(i))!=null?o:Mr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.DragStart,D1),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),this.windowListeners.add(Gn.ContextMenu,D1),this.documentListeners.add(Gn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(I1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(R1(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Gn.Click,RV,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=wf(t))!=null?n:Mr,c=xf(o,l);if(!r&&a){if(R1(a)){if(a.tolerance!=null&&Zp(c,a.tolerance))return this.handleCancel();if(Zp(c,a.distance))return this.handleStart()}return I1(a)&&Zp(c,a.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const NV={move:{name:"pointermove"},end:{name:"pointerup"}};class yO extends z0{constructor(t){const{event:n}=t,r=dl(n.target);super(t,NV,r)}}yO.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const PV={move:{name:"mousemove"},end:{name:"mouseup"}};var Am;(function(e){e[e.RightClick=2]="RightClick"})(Am||(Am={}));class AV extends z0{constructor(t){super(t,PV,dl(t.event.target))}}AV.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Am.RightClick?!1:(r==null||r({event:n}),!0)}}];const Qp={move:{name:"touchmove"},end:{name:"touchend"}};class LV extends z0{constructor(t){super(t,Qp)}static setup(){return window.addEventListener(Qp.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Qp.move.name,t)};function t(){}}}LV.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var wc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wc||(wc={}));var Cf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Cf||(Cf={}));function jV(e){let{acceleration:t,activator:n=wc.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Cf.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=zV({delta:d,disabled:!i}),[p,g]=Y3(),m=x.useRef({x:0,y:0}),b=x.useRef({x:0,y:0}),y=x.useMemo(()=>{switch(n){case wc.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case wc.DraggableRect:return o}},[n,o,l]),w=x.useRef(null),S=x.useCallback(()=>{const E=w.current;if(!E)return;const k=m.current.x*b.current.x,_=m.current.y*b.current.y;E.scrollBy(k,_)},[]),C=x.useMemo(()=>a===Cf.TreeOrder?[...c].reverse():c,[a,c]);x.useEffect(()=>{if(!i||!c.length||!y){g();return}for(const E of C){if((r==null?void 0:r(E))===!1)continue;const k=c.indexOf(E),_=u[k];if(!_)continue;const{direction:T,speed:D}=kV(E,_,y,t,f);for(const O of["x","y"])h[O][T[O]]||(D[O]=0,T[O]=0);if(D.x>0||D.y>0){g(),w.current=E,p(S,s),m.current=D,b.current=T;return}}m.current={x:0,y:0},b.current={x:0,y:0},g()},[t,S,r,g,i,s,JSON.stringify(y),JSON.stringify(h),p,c,C,u,JSON.stringify(f)])}const $V={x:{[Pt.Backward]:!1,[Pt.Forward]:!1},y:{[Pt.Backward]:!1,[Pt.Forward]:!1}};function zV(e){let{delta:t,disabled:n}=e;const r=bf(t);return wu(o=>{if(n||!r||!o)return $V;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Pt.Backward]:o.x[Pt.Backward]||i.x===-1,[Pt.Forward]:o.x[Pt.Forward]||i.x===1},y:{[Pt.Backward]:o.y[Pt.Backward]||i.y===-1,[Pt.Forward]:o.y[Pt.Forward]||i.y===1}}},[n,t,r])}function BV(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return wu(o=>{var i;return t===null?null:(i=r??o)!=null?i:null},[r,t])}function FV(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Bc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Bc||(Bc={}));var Lm;(function(e){e.Optimized="optimized"})(Lm||(Lm={}));const N1=new Map;function HV(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=x.useState(null),{frequency:a,measure:l,strategy:c}=o,u=x.useRef(e),d=m(),f=zc(d),h=x.useCallback(function(b){b===void 0&&(b=[]),!f.current&&s(y=>y===null?b:y.concat(b.filter(w=>!y.includes(w))))},[f]),p=x.useRef(null),g=wu(b=>{if(d&&!n)return N1;if(!b||b===N1||u.current!==e||i!=null){const y=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){y.set(w.id,w.rect.current);continue}const S=w.node.current,C=S?new $0(l(S),S):null;w.rect.current=C,C&&y.set(w.id,C)}return y}return b},[e,i,n,d,l]);return x.useEffect(()=>{u.current=e},[e]),x.useEffect(()=>{d||h()},[n,d]),x.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),x.useEffect(()=>{d||typeof a!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},a))},[a,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:i!=null};function m(){switch(c){case Bc.Always:return!1;case Bc.BeforeDragging:return n;default:return!n}}}function B0(e,t){return wu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function VV(e,t){return B0(e,t)}function WV(e){let{callback:t,disabled:n}=e;const r=zh(t),o=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return x.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Fh(e){let{callback:t,disabled:n}=e;const r=zh(t),o=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return x.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function UV(e){return new $0(fl(e),e)}function P1(e,t,n){t===void 0&&(t=UV);const[r,o]=x.useReducer(a,null),i=WV({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),s=Fh({callback:o});return tr(()=>{o(),e?(s==null||s.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),i==null||i.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u}}function qV(e){const t=B0(e);return aO(e,t)}const A1=[];function KV(e){const t=x.useRef(e),n=wu(r=>e?r&&r!==A1&&e&&t.current&&e.parentNode===t.current.parentNode?r:j0(e):A1,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function GV(e){const[t,n]=x.useState(null),r=x.useRef(e),o=x.useCallback(i=>{const s=Jp(i.target);s&&n(a=>a?(a.set(s,Pm(s)),new Map(a)):null)},[]);return x.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const c=Jp(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,Pm(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=Jp(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ea(i,s),Mr):pO(e):Mr,[e,t])}function L1(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==Mr;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xf(e,n.current):Mr}function YV(e){x.useEffect(()=>{if(!$h)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function XV(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function bO(e){return x.useMemo(()=>e?wV(e):null,[e])}const eg=[];function JV(e,t){t===void 0&&(t=fl);const[n]=e,r=bO(n?pn(n):null),[o,i]=x.useReducer(a,eg),s=Fh({callback:i});return e.length>0&&o===eg&&i(),tr(()=>{e.length?e.forEach(l=>s==null?void 0:s.observe(l)):(s==null||s.disconnect(),i())},[e]),o;function a(){return e.length?e.map(l=>fO(l)?r:new $0(t(l),l)):eg}}function xO(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return xu(t)?t:e}function ZV(e){let{measure:t}=e;const[n,r]=x.useState(null),o=x.useCallback(c=>{for(const{target:u}of c)if(xu(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),i=Fh({callback:o}),s=x.useCallback(c=>{const u=xO(c);i==null||i.disconnect(),u&&(i==null||i.observe(u)),r(u?t(u):null)},[t,i]),[a,l]=yf(s);return x.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const QV=[{sensor:yO,options:{}},{sensor:vO,options:{}}],e5={current:{}},Id={draggable:{measure:M1},droppable:{measure:M1,strategy:Bc.WhileDragging,frequency:Lm.Optimized},dragOverlay:{measure:fl}};class Sc extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const t5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Sc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Sf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Id,measureDroppableContainers:Sf,windowRect:null,measuringScheduled:!1},wO={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Sf,draggableNodes:new Map,over:null,measureDroppableContainers:Sf},Cu=x.createContext(wO),SO=x.createContext(t5);function n5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Sc}}}function r5(e,t){switch(t.type){case xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xt.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case xt.DragEnd:case xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Sc(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case xt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Sc(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case xt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Sc(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function o5(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=x.useContext(Cu),i=bf(r),s=bf(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!Bh(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=Z3(u);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function CO(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function i5(e){return x.useMemo(()=>({draggable:{...Id.draggable,...e==null?void 0:e.draggable},droppable:{...Id.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Id.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function s5(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=x.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;tr(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=aO(u,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=cO(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const Hh=x.createContext({...Mr,scaleX:1,scaleY:1});var oi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(oi||(oi={}));const a5=x.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=QV,collisionDetection:d=gV,measuring:f,modifiers:h,...p}=t;const g=x.useReducer(r5,void 0,n5),[m,b]=g,[y,w]=oV(),[S,C]=x.useState(oi.Uninitialized),E=S===oi.Initialized,{draggable:{active:k,nodes:_,translate:T},droppable:{containers:D}}=m,O=k?_.get(k):null,M=x.useRef({initial:null,translated:null}),R=x.useMemo(()=>{var pt;return k!=null?{id:k,data:(pt=O==null?void 0:O.data)!=null?pt:e5,rect:M}:null},[k,O]),I=x.useRef(null),[N,$]=x.useState(null),[A,z]=x.useState(null),F=zc(p,Object.values(p)),V=Su("DndDescribedBy",s),ee=x.useMemo(()=>D.getEnabled(),[D]),X=i5(f),{droppableRects:W,measureDroppableContainers:L,measuringScheduled:P}=HV(ee,{dragging:E,dependencies:[T.x,T.y],config:X.droppable}),j=BV(_,k),Y=x.useMemo(()=>A?wf(A):null,[A]),re=Sp(),se=VV(j,X.draggable.measure);s5({activeNode:k?_.get(k):null,config:re.layoutShiftCompensation,initialRect:se,measure:X.draggable.measure});const ie=P1(j,X.draggable.measure,se),_e=P1(j?j.parentElement:null),Me=x.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ot=D.getNodeFor((n=Me.current.over)==null?void 0:n.id),Ue=ZV({measure:X.dragOverlay.measure}),it=(r=Ue.nodeRef.current)!=null?r:j,st=E?(o=Ue.rect)!=null?o:ie:null,jt=!!(Ue.nodeRef.current&&Ue.rect),lr=qV(jt?null:ie),_n=bO(it?pn(it):null),Bn=KV(E?Ot??j:null),Fn=JV(Bn),Po=CO(h,{transform:{x:T.x-lr.x,y:T.y-lr.y,scaleX:1,scaleY:1},activatorEvent:A,active:R,activeNodeRect:ie,containerNodeRect:_e,draggingNodeRect:st,over:Me.current.over,overlayNodeRect:Ue.rect,scrollableAncestors:Bn,scrollableAncestorRects:Fn,windowRect:_n}),Gi=Y?Ea(Y,T):null,ro=GV(Bn),Ks=L1(ro),Yi=L1(ro,[ie]),Hn=Ea(Po,Ks),$t=st?yV(st,Po):null,oo=R&&$t?d({active:R,collisionRect:$t,droppableRects:W,droppableContainers:ee,pointerCoordinates:Gi}):null,zt=fV(oo,"id"),[Wt,Pr]=x.useState(null),xl=jt?Po:Ea(Po,Yi),zu=mV(xl,(i=Wt==null?void 0:Wt.rect)!=null?i:null,ie),Bu=x.useCallback((pt,en)=>{let{sensor:tn,options:Mn}=en;if(I.current==null)return;const nn=_.get(I.current);if(!nn)return;const Dn=pt.nativeEvent,mn=new tn({active:I.current,activeNode:nn,event:Dn,options:Mn,context:Me,onStart(vn){const Lo=I.current;if(Lo==null)return;const Vn=_.get(Lo);if(!Vn)return;const{onDragStart:Gs}=F.current,Xi={active:{id:Lo,data:Vn.data,rect:M}};xr.unstable_batchedUpdates(()=>{Gs==null||Gs(Xi),C(oi.Initializing),b({type:xt.DragStart,initialCoordinates:vn,active:Lo}),y({type:"onDragStart",event:Xi})})},onMove(vn){b({type:xt.DragMove,coordinates:vn})},onEnd:Ao(xt.DragEnd),onCancel:Ao(xt.DragCancel)});xr.unstable_batchedUpdates(()=>{$(mn),z(pt.nativeEvent)});function Ao(vn){return async function(){const{active:Vn,collisions:Gs,over:Xi,scrollAdjustedTranslate:Cl}=Me.current;let jo=null;if(Vn&&Cl){const{cancelDrop:Ji}=F.current;jo={activatorEvent:Dn,active:Vn,collisions:Gs,delta:Cl,over:Xi},vn===xt.DragEnd&&typeof Ji=="function"&&await Promise.resolve(Ji(jo))&&(vn=xt.DragCancel)}I.current=null,xr.unstable_batchedUpdates(()=>{b({type:vn}),C(oi.Uninitialized),Pr(null),$(null),z(null);const Ji=vn===xt.DragEnd?"onDragEnd":"onDragCancel";if(jo){const Ke=F.current[Ji];Ke==null||Ke(jo),y({type:Ji,event:jo})}})}}},[_]),wp=x.useCallback((pt,en)=>(tn,Mn)=>{const nn=tn.nativeEvent,Dn=_.get(Mn);if(I.current!==null||!Dn||nn.dndKit||nn.defaultPrevented)return;const mn={active:Dn};pt(tn,en.options,mn)===!0&&(nn.dndKit={capturedBy:en.sensor},I.current=Mn,Bu(tn,en))},[_,Bu]),wl=FV(u,wp);YV(u),tr(()=>{ie&&S===oi.Initializing&&C(oi.Initialized)},[ie,S]),x.useEffect(()=>{const{onDragMove:pt}=F.current,{active:en,activatorEvent:tn,collisions:Mn,over:nn}=Me.current;if(!en||!tn)return;const Dn={active:en,activatorEvent:tn,collisions:Mn,delta:{x:Hn.x,y:Hn.y},over:nn};xr.unstable_batchedUpdates(()=>{pt==null||pt(Dn),y({type:"onDragMove",event:Dn})})},[Hn.x,Hn.y]),x.useEffect(()=>{const{active:pt,activatorEvent:en,collisions:tn,droppableContainers:Mn,scrollAdjustedTranslate:nn}=Me.current;if(!pt||I.current==null||!en||!nn)return;const{onDragOver:Dn}=F.current,mn=Mn.get(zt),Ao=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,vn={active:pt,activatorEvent:en,collisions:tn,delta:{x:nn.x,y:nn.y},over:Ao};xr.unstable_batchedUpdates(()=>{Pr(Ao),Dn==null||Dn(vn),y({type:"onDragOver",event:vn})})},[zt]),tr(()=>{Me.current={activatorEvent:A,active:R,activeNode:j,collisionRect:$t,collisions:oo,droppableRects:W,draggableNodes:_,draggingNode:it,draggingNodeRect:st,droppableContainers:D,over:Wt,scrollableAncestors:Bn,scrollAdjustedTranslate:Hn},M.current={initial:st,translated:$t}},[R,j,oo,$t,_,it,st,W,D,Wt,Bn,Hn]),jV({...re,delta:T,draggingRect:$t,pointerCoordinates:Gi,scrollableAncestors:Bn,scrollableAncestorRects:Fn});const Sl=x.useMemo(()=>({active:R,activeNode:j,activeNodeRect:ie,activatorEvent:A,collisions:oo,containerNodeRect:_e,dragOverlay:Ue,draggableNodes:_,droppableContainers:D,droppableRects:W,over:Wt,measureDroppableContainers:L,scrollableAncestors:Bn,scrollableAncestorRects:Fn,measuringConfiguration:X,measuringScheduled:P,windowRect:_n}),[R,j,ie,A,oo,_e,Ue,_,D,W,Wt,L,Bn,Fn,X,P,_n]),Fu=x.useMemo(()=>({activatorEvent:A,activators:wl,active:R,activeNodeRect:ie,ariaDescribedById:{draggable:V},dispatch:b,draggableNodes:_,over:Wt,measureDroppableContainers:L}),[A,wl,R,ie,b,V,_,Wt,L]);return U.createElement(sO.Provider,{value:w},U.createElement(Cu.Provider,{value:Fu},U.createElement(SO.Provider,{value:Sl},U.createElement(Hh.Provider,{value:zu},c)),U.createElement(o5,{disabled:(a==null?void 0:a.restoreFocus)===!1})),U.createElement(aV,{...a,hiddenTextDescribedById:V}));function Sp(){const pt=(N==null?void 0:N.autoScrollEnabled)===!1,en=typeof l=="object"?l.enabled===!1:l===!1,tn=E&&!pt&&!en;return typeof l=="object"?{...l,enabled:tn}:{enabled:tn}}}),l5=x.createContext(null),j1="button",c5="Droppable";function u5(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Su(c5),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=x.useContext(Cu),{role:h=j1,roleDescription:p="draggable",tabIndex:g=0}=o??{},m=(l==null?void 0:l.id)===t,b=x.useContext(m?Hh:l5),[y,w]=yf(),[S,C]=yf(),E=XV(s,t),k=zc(n);tr(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:S,data:k}),()=>{const T=d.get(t);T&&T.key===i&&d.delete(t)}),[d,t]);const _=x.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":m&&h===j1?!0:void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[r,h,g,m,p,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:_,isDragging:m,listeners:r?void 0:E,node:y,over:f,setNodeRef:w,setActivatorNodeRef:C,transform:b}}function EO(){return x.useContext(SO)}const d5="Droppable",f5={timeout:25};function h5(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Su(d5),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=x.useContext(Cu),u=x.useRef({disabled:n}),d=x.useRef(!1),f=x.useRef(null),h=x.useRef(null),{disabled:p,updateMeasurementsFor:g,timeout:m}={...f5,...o},b=zc(g??r),y=x.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),h.current=null},m)},[m]),w=Fh({callback:y,disabled:p||!s}),S=x.useCallback((_,T)=>{w&&(T&&(w.unobserve(T),d.current=!1),_&&w.observe(_))},[w]),[C,E]=yf(S),k=zc(t);return x.useEffect(()=>{!w||!C.current||(w.disconnect(),d.current=!1,w.observe(C.current))},[C,w]),tr(()=>(a({type:xt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:f,data:k}}),()=>a({type:xt.UnregisterDroppable,key:i,id:r})),[r]),x.useEffect(()=>{n!==u.current.disabled&&(a({type:xt.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:f,isOver:(l==null?void 0:l.id)===r,node:C,over:l,setNodeRef:E}}function p5(e){let{animation:t,children:n}=e;const[r,o]=x.useState(null),[i,s]=x.useState(null),a=bf(n);return!n&&!r&&a&&o(a),tr(()=>{if(!i)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,r,i]),U.createElement(U.Fragment,null,n,r?x.cloneElement(r,{ref:s}):null)}const g5={x:0,y:0,scaleX:1,scaleY:1};function m5(e){let{children:t}=e;return U.createElement(Cu.Provider,{value:wO},U.createElement(Hh.Provider,{value:g5},t))}const v5={position:"fixed",touchAction:"none"},y5=e=>Bh(e)?"transform 250ms ease":void 0,b5=x.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:u=y5}=e;if(!a)return null;const d=o?c:{...c,scaleX:1,scaleY:1},f={...v5,width:a.width,height:a.height,top:a.top,left:a.left,transform:So.Transform.toString(d),transformOrigin:o&&r?cV(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return U.createElement(n,{className:s,style:f,ref:t},i)}),x5=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))n.node.style.setProperty(l,c);s!=null&&s.active&&n.node.classList.remove(s.active)}},w5=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:So.Transform.toString(t)},{transform:So.Transform.toString(n)}]},S5={duration:250,easing:"ease",keyframes:w5,sideEffects:x5({styles:{active:{opacity:"0"}}})};function C5(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return zh((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=xO(s);if(!c)return;const{transform:u}=pn(s).getComputedStyle(s),d=lO(u);if(!d)return;const f=typeof t=="function"?t:E5(t);return gO(l,o.draggable.measure),f({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function E5(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...S5,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},d={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-u.x,y:l.y-u.y,...d},h=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:f}}),[p]=h,g=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;const m=r==null?void 0:r({active:s,dragOverlay:a,...c}),b=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{m==null||m(),y()}})}}let $1=0;function k5(e){return x.useMemo(()=>{if(e!=null)return $1++,$1},[e])}const O5=U.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:g,dragOverlay:m,over:b,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:S,windowRect:C}=EO(),E=x.useContext(Hh),k=k5(d==null?void 0:d.id),_=CO(s,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:m.rect,over:b,overlayNodeRect:m.rect,scrollableAncestors:w,scrollableAncestorRects:S,transform:E,windowRect:C}),T=B0(f),D=C5({config:r,draggableNodes:p,droppableContainers:g,measuringConfiguration:y}),O=T?m.setRef:void 0;return U.createElement(m5,null,U.createElement(p5,{animation:D},d&&k?U.createElement(b5,{key:k,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:T,style:{zIndex:c,...o},transform:_},n):null))});function kO(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function T5(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Qu(e){return e!==null&&e>=0}function _5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function M5(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const OO=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=kO(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},ed={scaleX:1,scaleY:1},D5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const c=i[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...ed}:null}const l=R5(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...ed}:o<n&&o>=s?{x:0,y:a.height+l,...ed}:{x:0,y:0,...ed}};function R5(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const TO="Sortable",_O=U.createContext({activeIndex:-1,containerId:TO,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:OO,disabled:{draggable:!1,droppable:!1}});function I5(e){let{children:t,id:n,items:r,strategy:o=OO,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=EO(),d=Su(TO,n),f=a.rect!==null,h=x.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),p=s!=null,g=s?h.indexOf(s.id):-1,m=c?h.indexOf(c.id):-1,b=x.useRef(h),y=!_5(h,b.current),w=m!==-1&&g===-1||y,S=M5(i);tr(()=>{y&&p&&u(h)},[y,h,p,u]),x.useEffect(()=>{b.current=h},[h]);const C=x.useMemo(()=>({activeIndex:g,containerId:d,disabled:S,disableTransforms:w,items:h,overIndex:m,useDragOverlay:f,sortedRects:T5(h,l),strategy:o}),[g,d,S.draggable,S.droppable,w,h,m,l,f,o]);return U.createElement(_O.Provider,{value:C},t)}const N5=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return kO(n,r,o).indexOf(t)},P5=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},A5={duration:200,easing:"ease"},MO="transform",L5=So.Transition.toString({property:MO,duration:0,easing:"linear"}),j5={roleDescription:"sortable"};function $5(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=x.useState(null),a=x.useRef(n);return tr(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const c=fl(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,o]),x.useEffect(()=>{i&&s(null)},[i]),i}function DO(e){let{animateLayoutChanges:t=P5,attributes:n,disabled:r,data:o,getNewIndex:i=N5,id:s,strategy:a,resizeObserverConfig:l,transition:c=A5}=e;const{items:u,containerId:d,activeIndex:f,disabled:h,disableTransforms:p,sortedRects:g,overIndex:m,useDragOverlay:b,strategy:y}=x.useContext(_O),w=z5(r,h),S=u.indexOf(s),C=x.useMemo(()=>({sortable:{containerId:d,index:S,items:u},...o}),[d,o,S,u]),E=x.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:k,node:_,isOver:T,setNodeRef:D}=h5({id:s,data:C,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:O,activatorEvent:M,activeNodeRect:R,attributes:I,setNodeRef:N,listeners:$,isDragging:A,over:z,setActivatorNodeRef:F,transform:V}=u5({id:s,data:C,attributes:{...j5,...n},disabled:w.draggable}),ee=G3(D,N),X=!!O,W=X&&!p&&Qu(f)&&Qu(m),L=!b&&A,P=L&&W?V:null,Y=W?P??(a??y)({rects:g,activeNodeRect:R,activeIndex:f,overIndex:m,index:S}):null,re=Qu(f)&&Qu(m)?i({id:s,items:u,activeIndex:f,overIndex:m}):S,se=O==null?void 0:O.id,ie=x.useRef({activeId:se,items:u,newIndex:re,containerId:d}),_e=u!==ie.current.items,Me=t({active:O,containerId:d,isDragging:A,isSorting:X,id:s,index:S,items:u,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:c,wasDragging:ie.current.activeId!=null}),Ot=$5({disabled:!Me,index:S,node:_,rect:k});return x.useEffect(()=>{X&&ie.current.newIndex!==re&&(ie.current.newIndex=re),d!==ie.current.containerId&&(ie.current.containerId=d),u!==ie.current.items&&(ie.current.items=u)},[X,re,d,u]),x.useEffect(()=>{if(se===ie.current.activeId)return;if(se&&!ie.current.activeId){ie.current.activeId=se;return}const it=setTimeout(()=>{ie.current.activeId=se},50);return()=>clearTimeout(it)},[se]),{active:O,activeIndex:f,attributes:I,data:C,rect:k,index:S,newIndex:re,items:u,isOver:T,isSorting:X,isDragging:A,listeners:$,node:_,overIndex:m,over:z,setNodeRef:ee,setActivatorNodeRef:F,setDroppableNodeRef:D,setDraggableNodeRef:N,transform:Ot??Y,transition:Ue()};function Ue(){if(Ot||_e&&ie.current.newIndex===S)return L5;if(!(L&&!Bh(M)||!c)&&(X||Me))return So.Transition.toString({...c,property:MO})}}function z5(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Ne.Down,Ne.Right,Ne.Up,Ne.Left;const B5=({label:e})=>e?v.jsx("span",{className:Te.label,children:v.jsx(ll,{color:e.color,title:e.value,small:e.small})}):null,RO=({name:e,icon:t,testId:n})=>{const r=t&&v.jsx(Ae,{icon:t.icon,color:t.color||"#db2828"});return v.jsxs("span",{className:oe(Te.name,Te.bold),"data-testid":n,children:[e,t&&t.tooltip&&t.tooltip.text?v.jsx("span",{className:Te.iconTooltipMargin,children:v.jsx(hn,{text:t.tooltip.text,maxWidth:"350px",children:r})}):t&&t.icon&&v.jsx("span",{className:Te.iconTooltipMargin,children:r})]})},F5=({item:e})=>{const{name:t,icon:n,details:r,metadata:o,invalid:i,testId:s}=e;let a=v.jsx(RO,{name:t,icon:n,testId:s&&`${s}-name`});return i&&(a=v.jsx(ll,{small:!0,margin:"-2px",title:"!",children:a})),v.jsxs("span",{className:Te.title,children:[a,r&&v.jsx("span",{className:Te.details,"data-testid":s&&`${s}-details`,children:r}),o&&v.jsx("span",{className:Te.metadata,"data-testid":s&&`${s}-metadata`,children:o})]})},IO=({item:e})=>e.metaCount!==void 0?v.jsx(ll,{color:"rgba(0,0,0,0.25)",title:e.metaCount}):null,H5=({item:e,expanding:t})=>{const n=r=>{r.preventDefault(),r.stopPropagation()};return t&&e.active&&e.content?v.jsx("div",{className:Te.itemContent,onClick:n,children:e.content}):null},V5=x.forwardRef(({item:e,index:t},n)=>{const r=x.useContext(ht),{actions:o,disabled:i,expanded:s,onClick:a,title:l,name:c,icon:u,testId:d}=e;return v.jsx("div",{ref:f=>{n&&"current"in n&&Array.isArray(n.current)&&t!==void 0&&(n.current[t]=f)},"data-testid":d??null,className:oe(Te.item,Te.heading,i||r?Te.disabled:"",a?Te.action:""),onClick:f=>{a&&a(f)},title:l,children:v.jsx("div",{children:v.jsxs("div",{className:Te.itemHeader,children:[typeof s=="boolean"&&v.jsx("div",{className:oe(Te.expandIcon,s&&Te.expanded),children:v.jsx(Ae,{icon:Ce.CHEVRON_RIGHT})}),v.jsx(RO,{name:c,icon:u}),v.jsxs("div",{className:Te.right,children:[v.jsx(IO,{item:e}),!(i||r)&&o&&v.jsx("div",{className:Te.actions,children:v.jsx(Vi,{actions:e.actions??[]})})]})]})})})});x.forwardRef(({item:e,index:t,expanding:n,invokeEditOnRowClick:r,draggable:o},i)=>{const s=x.useContext(ht),a=(u,d,f,h,p,g)=>{const m=d.actions&&d.actions.find(S=>{var C;return S.label&&((C=String(S.label))==null?void 0:C.toLowerCase())==="edit"}),b=!!(m||d.url||d.onClick),y=d.level&&d.level>1?(d.level-1)*20:0,w=d.component||"a";return v.jsx(w,{href:d.url,to:d.url,ref:g,style:f,className:oe(Te.item,d.active?Te.active:"",d.disabled||s?Te.disabled:"",b?Te.action:""),onClick:S=>{if(r&&m&&m.onClick&&m.onClick(S,d.id),d.onClick)return d.onClick(S)},"data-id":u,title:d.title,"data-testid":d.testId,children:v.jsxs("div",{ref:S=>{i&&"current"in i&&Array.isArray(i.current)&&u!==void 0&&(i.current[u]=S)},style:{paddingLeft:y},children:[v.jsxs("div",{className:Te.itemHeader,children:[o&&v.jsx("div",{className:Te.drag,...h,...p,children:v.jsx(Ae,{icon:Ce.DRAG})}),d.level&&d.level>0?v.jsx("div",{className:Te.indentIcon,children:v.jsx(Ae,{icon:Ce.INDENT})}):null,v.jsx(B5,{label:d.label}),v.jsx(F5,{item:d}),v.jsxs("div",{className:Te.right,children:[v.jsx(IO,{item:d}),!(d.disabled||s)&&d.actions&&v.jsx("div",{className:Te.actions,children:v.jsx(Vi,{actions:d.actions})})]})]}),v.jsx(H5,{item:d,expanding:n})]})},u)},l=(u,d)=>{const{attributes:f,listeners:h,setNodeRef:p,transform:g,transition:m,isDragging:b}=DO({id:u.toString(),animateLayoutChanges:()=>!1}),y={transform:So.Translate.toString(g),transition:m,opacity:b?0:1};return a(u,d,y,f,h,p)};return e.type==="Heading"?v.jsx(V5,{ref:i,item:e,index:t},t):o?l(t,e):a(t,e)});function ea(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,p)=>r[p]!==h)))return o;r=u;let f;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(f=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-f)*100)/100,g=p/16,m=(b,y)=>{for(b=String(b);b.length<y;)b=" "+b;return b};console.info(`%c⏱ ${m(p,5)} /${m(h,5)} ms`,`
83
+ font-size: .6rem;
84
+ font-weight: bold;
85
+ color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function tg(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const W5=(e,t)=>Math.abs(e-t)<1,U5=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},q5=e=>e,K5=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},G5=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(n.getBoundingClientRect())});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},z1={passive:!0},Y5=typeof window>"u"?!0:"onscrollend"in window,X5=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&Y5?()=>{}:U5(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=e.options;o=u?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,c)},a=s(!0),l=s(!1);return l(),n.addEventListener("scroll",a,z1),n.addEventListener("scrollend",l,z1),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},J5=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Z5=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Q5{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{this._measureElement(i.target,i)})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:q5,rangeExtractor:K5,onChange:()=>{},measureElement:J5,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ea(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=ea(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=ea(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=f?f.end+this.options.gap:r+o,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),m=h+g,b=f?f.lane:u%this.options.lanes;c[u]={index:u,start:h,size:g,end:m,key:d,lane:b}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ea(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,o)=>this.range=n.length>0&&r>0?eW({measurements:n,outerSize:r,scrollOffset:o}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=ea(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,o,i)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ea(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return tg(r[NO(0,r.length-1,o=>tg(r[o]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(n<=i?r="start":n>=i+o?r="end":r="start"),r==="start"?n=n:r==="end"?n=n-o:r==="center"&&(n=n-o/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-o;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=tg(this.getOffsetForIndex(n,a));W5(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const NO=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function eW({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=NO(0,r,a=>e[a].start,n);let s=i;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:i,endIndex:s}}const tW=typeof document<"u"?x.useLayoutEffect:x.useEffect;function nW(e){const t=x.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?xr.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=x.useState(()=>new Q5(n));return r.setOptions(n),x.useEffect(()=>r._didMount(),[]),tW(()=>r._willUpdate()),r}function rW(e){return nW({observeElementRect:G5,observeElementOffset:X5,scrollToFn:Z5,...e})}const oW="_container_1okhq_83",iW="_block_1okhq_101",sW="_info_1okhq_104",aW="_success_1okhq_108",lW="_warning_1okhq_112",cW="_error_1okhq_116",uW="_content_1okhq_120",dW="_heading_1okhq_124",fW="_icon_1okhq_131",hW="_dismiss_1okhq_139",pW="_absolute_1okhq_143",gW="_legendToggle_1okhq_155",mW="_detailsText_1okhq_165",vW="_footer_1okhq_169",It={container:oW,block:iW,info:sW,success:aW,warning:lW,error:cW,content:uW,heading:dW,icon:fW,dismiss:hW,absolute:pW,legendToggle:gW,detailsText:mW,footer:vW};var Zn=(e=>(e.INFO="Info",e.SUCCESS="Success",e.WARNING="Warning",e.ERROR="Error",e))(Zn||{}),F0=(e=>(e.TOGGLE_DETAILS="TOGGLE_DETAILS",e))(F0||{});const yW=({type:e,onClose:t,isInToast:n,testId:r})=>v.jsx("div",{className:oe(It.dismiss,n?It.absolute:"",e===Zn.INFO?It.info:e===Zn.SUCCESS?It.success:e===Zn.WARNING?It.warning:e===Zn.ERROR?It.error:null),children:v.jsx(Ae,{icon:Ce.CLOSE,onClick:t,testId:r})}),bW=(e,t)=>{switch(t.type){case F0.TOGGLE_DETAILS:return{...e,detailsVisible:!e.detailsVisible};default:return e}},xW=({details:e,visible:t,dispatch:n})=>v.jsxs("div",{children:[v.jsx("div",{className:oe(It.legendToggle),onClick:n,children:t?"Hide details":"Show details"}),t?v.jsx("div",{className:It.detailsText,children:e}):null]}),wW=({type:e})=>{switch(e){case Zn.SUCCESS:return v.jsx(Ae,{icon:Ce.SUCCESS,size:16});case Zn.WARNING:return v.jsx(Ae,{icon:Ce.WARNING,size:16});case Zn.ERROR:return v.jsx(Ae,{icon:Ce.ERROR,size:16});default:return v.jsx(Ae,{icon:Ce.INFO,size:16})}},Lhe=({message:e})=>{const{visible:t,type:n=Zn.INFO,icon:r,heading:o,content:i,details:s,detailsVisible:a=!1,footer:l,withDismiss:c,onClose:u,width:d,maxHeight:f}=e,h={detailsVisible:a},[p,g]=x.useReducer(bW,h);return v.jsx(v.Fragment,{children:t?v.jsxs("div",{className:oe(It.container,d?It.block:null,n===Zn.SUCCESS?It.success:n===Zn.WARNING?It.warning:n===Zn.ERROR?It.error:It.info),style:{width:d,maxHeight:f},children:[v.jsx("div",{children:r?v.jsx("div",{className:It.icon,children:v.jsx(wW,{type:n})}):null}),v.jsxs("div",{className:It.content,children:[o?v.jsx("div",{className:It.heading,children:o}):null,v.jsx("div",{children:i}),s?v.jsx(xW,{details:s,visible:p.detailsVisible,dispatch:()=>g({type:F0.TOGGLE_DETAILS})}):null,!!l&&v.jsx("div",{className:It.footer,children:l})]}),c?v.jsx(yW,{type:n,onClose:u}):null]}):null})},jhe=({id:e,children:t})=>{const n=document.querySelector(`#${e}`),[r,o]=x.useState(!1);return x.useLayoutEffect(()=>{r||o(!0)},[e]),n?xr.createPortal(t,n):null},SW="_select_sl2b5_77",CW="_isInTable_sl2b5_121",EW="_unSelected_sl2b5_133",kW="_small_sl2b5_174",OW="_right_sl2b5_182",TW="_groupOrderFirst_sl2b5_193",_W="_groupOrderMiddle_sl2b5_194",MW="_groupOrderLast_sl2b5_198",Uo={select:SW,isInTable:CW,unSelected:EW,small:kW,right:OW,groupOrderFirst:TW,groupOrderMiddle:_W,groupOrderLast:MW},DW=({disabled:e=!1,error:t=null,warning:n=null,tooltip:r=null,options:o,onChange:i=We.noop,onFocus:s=We.noop,onBlur:a=We.noop,right:l=!1,small:c=!1,tabIndex:u=0,selectedOption:d,width:f=null,groupOrder:h,testId:p,isInTable:g=!1,clearable:m,placeholder:b,hasNonExistentValue:y,maxTooltipWidth:w,borderRadius:S})=>{const C=x.useContext(ht),E=d===null||(d==null?void 0:d.value)===null?"unselected":d==null?void 0:d.value,k=E==="unselected",_=(E==="unselected"||m?[v.jsx("option",{value:"unselected",disabled:!m,hidden:!m,children:b||"Select..."},"unselected")]:[]).concat(y?[v.jsx("option",{value:d==null?void 0:d.value,disabled:e||C,children:d==null?void 0:d.label},"selectedNonExistentValue")]:[]).concat(o.map((D,O)=>v.jsx("option",{value:D.value,"data-testid":D.testId,children:D.label},O))),T=(()=>{if(h)switch(h){case Vt.FIRST:return Uo.groupOrderFirst;case Vt.LAST:return Uo.groupOrderLast;default:return Uo.groupOrderMiddle}return""})();return v.jsx(hn,{error:!!t,warning:!!n,text:r||t||n,enabled:r&&ft(r)||t&&ft(t)||n&&ft(n)||!1,maxWidth:w,children:v.jsx("select",{className:oe(Uo.select,k?Uo.unSelected:"",l?Uo.right:"",c?Uo.small:"",g?Uo.isInTable:"",T),style:{width:f||"",borderRadius:S||""},onChange:D=>{const{value:O}=D.target;let M;O==="unselected"?M={value:null}:M=o.find(I=>String(I.value)===String(O))||{value:null},i(D,M)},onFocus:s,onBlur:a,tabIndex:u,value:E,disabled:e||C,"data-error":t||null,"data-warning":n||null,"data-testid":p,children:_})})};var PO={exports:{}};(function(e,t){(function(n,r){e.exports=r(U,fu)})(window,function(n,r){return function(o){var i={};function s(a){if(i[a])return i[a].exports;var l=i[a]={i:a,l:!1,exports:{}};return o[a].call(l.exports,l,l.exports,s),l.l=!0,l.exports}return s.m=o,s.c=i,s.d=function(a,l,c){s.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:c})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,l){if(1&l&&(a=s(a)),8&l||4&l&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),2&l&&typeof a!="string")for(var u in a)s.d(c,u,(function(d){return a[d]}).bind(null,u));return c},s.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(l,"a",l),l},s.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},s.p="",s(s.s=0)}([function(o,i,s){Object.defineProperty(i,"__esModule",{value:!0});var a=s(1);Object.defineProperty(i,"default",{enumerable:!0,get:function(){return function(l){return l&&l.__esModule?l:{default:l}}(a).default}}),o.exports=i.default},function(o,i,s){Object.defineProperty(i,"__esModule",{value:!0});var a=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var b=arguments[m];for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(g[y]=b[y])}return g},l=function(){function g(m,b){for(var y=0;y<b.length;y++){var w=b[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,b,y){return b&&g(m.prototype,b),y&&g(m,y),m}}(),c=f(s(2)),u=f(s(3)),d=s(4);function f(g){return g&&g.__esModule?g:{default:g}}var h=[],p=function(g){function m(b){(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m);var y=function(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!S||typeof S!="object"&&typeof S!="function"?w:S}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b));return y.handleKeyboardEvent=y.handleKeyboardEvent.bind(y),y.registerExclusiveHandler=y.registerExclusiveHandler.bind(y),y.deregisterExclusiveHandler=y.deregisterExclusiveHandler.bind(y),y}return function(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}(m,c.default.Component),l(m,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyboardEvent,!1),document.addEventListener("keyup",this.handleKeyboardEvent,!1),document.addEventListener("keypress",this.handleKeyboardEvent,!1);var b=this.props,y=b.isExclusive,w=b.isDisabled;y&&!w&&this.registerExclusiveHandler()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyboardEvent,!1),document.removeEventListener("keyup",this.handleKeyboardEvent,!1),document.removeEventListener("keypress",this.handleKeyboardEvent,!1),this.deregisterExclusiveHandler()}},{key:"componentDidUpdate",value:function(b){var y=b.isExclusive,w=b.isDisabled;(this.props.isExclusive!==y||this.props.isDisabled!==w)&&(this.props.isExclusive&&!this.props.isDisabled?this.registerExclusiveHandler():this.deregisterExclusiveHandler())}},{key:"registerExclusiveHandler",value:function(){this.deregisterExclusiveHandler(),h.unshift(this)}},{key:"deregisterExclusiveHandler",value:function(){var b=this;h.includes(this)&&(h=h.filter(function(y){return y!==b}))}},{key:"handleKeyboardEvent",value:function(b){var y=this.props,w=y.isDisabled,S=y.handleKeys,C=y.onKeyEvent,E=y.handleEventType,k=y.children,_=y.handleFocusableElements;if(w||E!==b.type||h.length>0&&h[0]!==this)return!1;var T=b.target===document.body||_,D=this.childrenContainer&&this.childrenContainer.contains(b.target);if(!(k?D:T))return!1;var O=(0,d.findMatchedKey)(b,S);return!!O&&(C(O,b),!0)}},{key:"render",value:function(){var b=this,y=this.props.children,w=Object.assign({},this.props),S=!0,C=!1,E=void 0;try{for(var k,_=Object.keys(m.propTypes)[Symbol.iterator]();!(S=(k=_.next()).done);S=!0)delete w[k.value]}catch(T){C=!0,E=T}finally{try{!S&&_.return&&_.return()}finally{if(C)throw E}}return y?c.default.createElement("span",a({ref:function(T){b.childrenContainer=T}},w),y):null}}]),m}();i.default=p,p.propTypes={handleKeys:u.default.array,handleEventType:u.default.oneOf(["keydown","keyup","keypress"]),handleFocusableElements:u.default.bool,onKeyEvent:u.default.func,isDisabled:u.default.bool,isExclusive:u.default.bool,children:u.default.any},p.defaultProps={handleKeys:[],handleFocusableElements:!1,handleEventType:"keydown",onKeyEvent:function(){return null}},o.exports=i.default},function(o,i){o.exports=n},function(o,i){o.exports=r},function(o,i,s){function a(y,w,S){return w in y?Object.defineProperty(y,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[w]=S,y}Object.defineProperty(i,"__esModule",{value:!0}),i.matchKeyEvent=b,i.findMatchedKey=function(y,w){var S=w.map(function(C){var E=C.toLowerCase(),k=m[E];return k||[C]}).reduce(function(C,E){return C.concat(E)},[]).find(function(C){return b(y,C)});return!S&&w.includes("all")&&(S="other"),S};var l={backspace:[8],del:[46],delete:[46],ins:[45],insert:[45],tab:[9],enter:[13],return:[13],esc:[27],space:[32],pageup:[33],pagedown:[34],end:[35],home:[36],left:[37],up:[38],right:[39],down:[40],shift:[16],ctrl:[17],alt:[18],cap:[20],num:[144],clear:[12],meta:[91],";":[186,59],"=":[187,61],",":[188,44],"-":[189,45,173,109],minus:[189,45,173,109],".":[190,110],"/":[191,111],"`":[192],"[":[219],"\\":[220],"]":[221],"*":[106],"+":[107],plus:[107],"'":[222],quote:[222]},c=Object.keys(l).reduce(function(y,w){return Object.assign(y,a({},w.toUpperCase(),l[w]))},{}),u="0123456789".split("").reduce(function(y,w,S){return Object.assign(y,a({},w,[S+48,S+96]))},{}),d="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(y,w,S){return Object.assign(y,a({},w.toLowerCase(),[S+65]),a({},w,[S+65]))},{}),f="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19".split(",").reduce(function(y,w,S){return Object.assign(y,a({},"f"+w,[S+112]))},{}),h={control:"ctrl",ctrl:"ctrl",shift:"shift",meta:"meta",cmd:"meta",command:"meta",option:"alt",alt:"alt"},p=i.AllKeys=Object.assign({},l,c,u,d,f),g=Object.assign({},u,d),m={all:Object.keys(p),alphanumeric:Object.keys(g),numeric:Object.keys(u),alphabetic:Object.keys(d),function:Object.keys(f)};function b(y,w){var S=y.which||y.keyCode,C=y.type,E=Object.keys(h).filter(function(I){return y[I+"Key"]}).sort(),k=w.toLowerCase().trim(),_=k==="+"?["+"]:k.split(/\s?\+\s?/),T=_.pop(),D=p[T],O=_;if(C==="keypress")return w==String.fromCharCode(S).toLowerCase();if(O.length===0&&E.length===0)return D.indexOf(S)>=0;if(O.length>0&&E.length>0){var M=O.map(function(I){return h[I]}).sort(),R=M.length===E.length&&M.every(function(I,N){return E[N]===I});return D.indexOf(S)>=0&&R}return O.length==0&&E.length===1&&T===E[0]}}])})})(PO);var RW=PO.exports;const AO=_o(RW),LO=()=>{const e=x.useRef(null);return[e,()=>{e.current&&e.current.focus()}]},jO=()=>{const[e,t]=x.useState(!1),n=x.useRef(!0);return x.useEffect(()=>()=>{n.current=!1},[]),x.useEffect(()=>{(async()=>{document.fonts&&await document.fonts.ready.then(()=>{n.current&&t(!0)})})()},[]),e};function B1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var F1=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function IW(e,t){return!!(e===t||F1(e)&&F1(t))}function NW(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!IW(e[n],t[n]))return!1;return!0}function Nd(e,t){t===void 0&&(t=NW);var n,r=[],o,i=!1;function s(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&n===this&&t(a,r)||(o=e.apply(this,a),i=!0,n=this,r=a),o}return s}var PW=typeof performance=="object"&&typeof performance.now=="function",H1=PW?function(){return performance.now()}:function(){return Date.now()};function V1(e){cancelAnimationFrame(e.id)}function AW(e,t){var n=H1();function r(){H1()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var ng=-1;function W1(e){if(e===void 0&&(e=!1),ng===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),ng=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ng}var ta=null;function U1(e){if(e===void 0&&(e=!1),ta===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?ta="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?ta="negative":ta="positive-ascending"),document.body.removeChild(t),ta}return ta}var LW=150,jW=function(t,n){return t};function $W(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.validateProps;return t=function(u){ZE(d,u);function d(h){var p;return p=u.call(this,h)||this,p._instanceProps=l(p.props,B1(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:B1(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=Nd(function(g,m,b,y){return p.props.onItemsRendered({overscanStartIndex:g,overscanStopIndex:m,visibleStartIndex:b,visibleStopIndex:y})}),p._callOnScroll=void 0,p._callOnScroll=Nd(function(g,m,b){return p.props.onScroll({scrollDirection:g,scrollOffset:m,scrollUpdateWasRequested:b})}),p._getItemStyle=void 0,p._getItemStyle=function(g){var m=p.props,b=m.direction,y=m.itemSize,w=m.layout,S=p._getItemStyleCache(y,w,b),C;if(S.hasOwnProperty(g))C=S[g];else{var E=n(p.props,g,p._instanceProps),k=o(p.props,g,p._instanceProps),_=b==="horizontal"||w==="horizontal",T=b==="rtl",D=_?E:0;S[g]=C={position:"absolute",left:T?void 0:D,right:T?D:void 0,top:_?0:E,height:_?"100%":k,width:_?k:"100%"}}return C},p._getItemStyleCache=void 0,p._getItemStyleCache=Nd(function(g,m,b){return{}}),p._onScrollHorizontal=function(g){var m=g.currentTarget,b=m.clientWidth,y=m.scrollLeft,w=m.scrollWidth;p.setState(function(S){if(S.scrollOffset===y)return null;var C=p.props.direction,E=y;if(C==="rtl")switch(U1()){case"negative":E=-y;break;case"positive-descending":E=w-b-y;break}return E=Math.max(0,Math.min(E,w-b)),{isScrolling:!0,scrollDirection:S.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(g){var m=g.currentTarget,b=m.clientHeight,y=m.scrollHeight,w=m.scrollTop;p.setState(function(S){if(S.scrollOffset===w)return null;var C=Math.max(0,Math.min(w,y-b));return{isScrolling:!0,scrollDirection:S.scrollOffset<C?"forward":"backward",scrollOffset:C,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(g){var m=p.props.outerRef;p._outerRef=g,typeof m=="function"?m(g):m!=null&&typeof m=="object"&&m.hasOwnProperty("current")&&(m.current=g)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&V1(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=AW(p._resetIsScrolling,LW)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}d.getDerivedStateFromProps=function(p,g){return zW(p,g),c(p),null};var f=d.prototype;return f.scrollTo=function(p){p=Math.max(0,p),this.setState(function(g){return g.scrollOffset===p?null:{scrollDirection:g.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},f.scrollToItem=function(p,g){g===void 0&&(g="auto");var m=this.props,b=m.itemCount,y=m.layout,w=this.state.scrollOffset;p=Math.max(0,Math.min(p,b-1));var S=0;if(this._outerRef){var C=this._outerRef;y==="vertical"?S=C.scrollWidth>C.clientWidth?W1():0:S=C.scrollHeight>C.clientHeight?W1():0}this.scrollTo(i(this.props,p,g,w,this._instanceProps,S))},f.componentDidMount=function(){var p=this.props,g=p.direction,m=p.initialScrollOffset,b=p.layout;if(typeof m=="number"&&this._outerRef!=null){var y=this._outerRef;g==="horizontal"||b==="horizontal"?y.scrollLeft=m:y.scrollTop=m}this._callPropsCallbacks()},f.componentDidUpdate=function(){var p=this.props,g=p.direction,m=p.layout,b=this.state,y=b.scrollOffset,w=b.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var S=this._outerRef;if(g==="horizontal"||m==="horizontal")if(g==="rtl")switch(U1()){case"negative":S.scrollLeft=-y;break;case"positive-ascending":S.scrollLeft=y;break;default:var C=S.clientWidth,E=S.scrollWidth;S.scrollLeft=E-C-y;break}else S.scrollLeft=y;else S.scrollTop=y}this._callPropsCallbacks()},f.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&V1(this._resetIsScrollingTimeoutId)},f.render=function(){var p=this.props,g=p.children,m=p.className,b=p.direction,y=p.height,w=p.innerRef,S=p.innerElementType,C=p.innerTagName,E=p.itemCount,k=p.itemData,_=p.itemKey,T=_===void 0?jW:_,D=p.layout,O=p.outerElementType,M=p.outerTagName,R=p.style,I=p.useIsScrolling,N=p.width,$=this.state.isScrolling,A=b==="horizontal"||D==="horizontal",z=A?this._onScrollHorizontal:this._onScrollVertical,F=this._getRangeToRender(),V=F[0],ee=F[1],X=[];if(E>0)for(var W=V;W<=ee;W++)X.push(x.createElement(g,{data:k,key:T(W,k),index:W,isScrolling:I?$:void 0,style:this._getItemStyle(W)}));var L=r(this.props,this._instanceProps);return x.createElement(O||M||"div",{className:m,onScroll:z,ref:this._outerRefSetter,style:Di({position:"relative",height:y,width:N,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},R)},x.createElement(S||C||"div",{children:X,ref:w,style:{height:A?"100%":L,pointerEvents:$?"none":void 0,width:A?L:"100%"}}))},f._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var g=this._getRangeToRender(),m=g[0],b=g[1],y=g[2],w=g[3];this._callOnItemsRendered(m,b,y,w)}}if(typeof this.props.onScroll=="function"){var S=this.state,C=S.scrollDirection,E=S.scrollOffset,k=S.scrollUpdateWasRequested;this._callOnScroll(C,E,k)}},f._getRangeToRender=function(){var p=this.props,g=p.itemCount,m=p.overscanCount,b=this.state,y=b.isScrolling,w=b.scrollDirection,S=b.scrollOffset;if(g===0)return[0,0,0,0];var C=s(this.props,S,this._instanceProps),E=a(this.props,C,S,this._instanceProps),k=!y||w==="backward"?Math.max(1,m):1,_=!y||w==="forward"?Math.max(1,m):1;return[Math.max(0,C-k),Math.max(0,Math.min(g-1,E+_)),C,E]},d}(x.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var zW=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},BW=$W({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,o,i,s){var a=t.direction,l=t.height,c=t.itemCount,u=t.itemSize,d=t.layout,f=t.width,h=a==="horizontal"||d==="horizontal",p=h?f:l,g=Math.max(0,c*u-p),m=Math.min(g,n*u),b=Math.max(0,n*u-p+u+s);switch(r==="smart"&&(o>=b-p&&o<=m+p?r="auto":r="center"),r){case"start":return m;case"end":return b;case"center":{var y=Math.round(b+(m-b)/2);return y<Math.ceil(p/2)?0:y>g+Math.floor(p/2)?g:y}case"auto":default:return o>=b&&o<=m?o:o<b?b:m}},getStartIndexForOffset:function(t,n){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,r){var o=t.direction,i=t.height,s=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,u=o==="horizontal"||l==="horizontal",d=n*a,f=u?c:i,h=Math.ceil((f+r-d)/a);return Math.max(0,Math.min(s-1,n+h-1))},initInstanceProps:function(t){},validateProps:function(t){t.itemSize}});const FW="_layerContainer_dw2pp_1",HW="_layer_dw2pp_1",VW="_small_dw2pp_23",WW="_heading_dw2pp_26",UW="_option_dw2pp_27",qW="_message_dw2pp_28",KW="_focused_dw2pp_64",GW="_selected_dw2pp_68",YW="_disabled_dw2pp_71",XW="_check_dw2pp_75",JW="_optionContent_dw2pp_92",ZW="_label_dw2pp_97",QW="_icon_dw2pp_104",e2="_details_dw2pp_109",Kt={layerContainer:FW,layer:HW,small:VW,heading:WW,option:UW,message:qW,focused:KW,selected:GW,disabled:YW,check:XW,optionContent:JW,label:ZW,icon:QW,details:e2},t2=({label:e})=>v.jsx("div",{onClick:t=>t.stopPropagation(),className:Kt.heading,children:e}),n2=({details:e,label:t,icon:n,disabled:r=!1,selected:o=!1,focused:i=!1,onSelectOption:s,actions:a,closeLayer:l,testId:c})=>v.jsxs("div",{className:oe(Kt.option,r?Kt.disabled:"",o?Kt==null?void 0:Kt.selected:"",i?Kt.focused:""),onClick:!r&&s?s:void 0,"data-testid":c,children:[v.jsx("div",{className:Kt.optionContent,children:v.jsxs("span",{className:Kt.label,title:t,children:[t,n&&v.jsx("span",{className:Kt.icon,children:n})]})}),e&&v.jsx("div",{className:oe(Kt.details),children:v.jsx(bs,{faint:!0,children:e})}),!!(a!=null&&a.length)&&v.jsx("div",{className:oe(Kt.actions),children:v.jsx(Vi,{actions:a,closeLayer:l})}),v.jsx("span",{className:Kt.check,children:o?v.jsx(Ae,{icon:Ce.CHECK}):null})]}),r2=({section:e,selected:t,focused:n,onSelectOption:r,closeLayer:o})=>{const i=x.useContext(ht);switch(e.type){case Jn.HEADING:return v.jsx(t2,{label:e.label});case Jn.OPTION:default:return v.jsx(n2,{closeLayer:o,actions:e.actions,label:e.label,details:e.details,icon:e.icon,disabled:e.disabled||i,selected:t,focused:n,onSelectOption:r,testId:e.testId})}},jm=(e,t)=>{const r=document.createElement("canvas").getContext("2d");return r?(r.font=t,r.measureText(e).width):0},$O="13px",zO="12px",o2="Roobert",i2="sans-serif",s2=12,a2=8,l2=30,c2=24,u2=5,d2=3,f2=1,h2=2,q1=10,BO=(e=!1,t=!1)=>`${e?zO:$O} ${t?o2:i2}`,p2=(e=!1,t=!1)=>(e?a2:s2)+(e?c2:l2)+(t?17:0),K1=(e,t,n,r)=>{const o=BO(t,n),i=r?jm(r,o):0,s=Math.ceil(e.reduce((l,c)=>{var u;const d=(((u=c==null?void 0:c.actions)==null?void 0:u.length)??0)*24,f=c.icon?parseInt(t?zO:$O)+7:0,h=`${c.label} ${c.details||""}`,p=jm(h,o)+d+f;return l=p>l?p:l,l},i)),a=p2(t,!0);return s+a},g2=(e,t,n)=>{const r=BO(!0,n),o=jm(e.label,r),i=(t?d2:u2)*2+f2*2+h2;return Math.ceil(o+i)},m2=({listRef:e,isMulti:t,sections:n,selectedOptions:r,onSelectOption:o,focusedOptionIndex:i,width:s,small:a,firstSelectedOptionIndex:l,closeLayer:c,testId:u})=>{x.useEffect(()=>{l!=null&&e.current!==null&&typeof e.current.scrollToItem=="function"&&e.current.scrollToItem(l,"start")},[l,e]);const d=a?24:30;return v.jsx("div",{"data-testid":u,className:oe(Kt.layer,a&&Kt.small),children:n.length?v.jsx(BW,{ref:e,height:n.length<q1?d*n.length:d*q1,itemCount:n.length,itemSize:d,width:s,children:({index:f,style:h})=>{var p;return v.jsx("div",{style:h,children:v.jsx(r2,{closeLayer:c,section:n[f],selected:t&&n[f].type!==Jn.HEADING&&Array.isArray(r)?r==null?void 0:r.some(g=>{var m;return g&&(g==null?void 0:g.value)===((m=n==null?void 0:n[f])==null?void 0:m.value)}):!Array.isArray(r)&&((p=n==null?void 0:n[f])==null?void 0:p.value)===(r==null?void 0:r.value),focused:i===f,onSelectOption:g=>o(g,n[f])})})}}):v.jsx("ul",{children:v.jsx("li",{children:v.jsx("div",{className:Kt.message,style:{width:s},children:"No matches"})})})})},v2="_trigger_7uwhv_77",y2="_isInTable_7uwhv_93",b2="_input_7uwhv_1",x2="_isOpen_7uwhv_114",w2="_disabled_7uwhv_156",S2="_icons_7uwhv_162",C2="_clearAll_7uwhv_169",E2="_iconOpen_7uwhv_170",k2="_small_7uwhv_181",O2="_triggerInputContainer_7uwhv_189",T2="_right_7uwhv_198",_2="_multiOptions_7uwhv_211",M2="_multiOption_7uwhv_211",D2="_focus_7uwhv_253",R2="_selectedSingleValue_7uwhv_257",I2="_placeHolder_7uwhv_258",N2="_groupOrderFirst_7uwhv_297",P2="_groupOrderMiddle_7uwhv_298",A2="_groupOrderLast_7uwhv_302",L2="_detailedLabel_7uwhv_307",at={trigger:v2,isInTable:y2,input:b2,isOpen:x2,disabled:w2,icons:S2,clearAll:C2,iconOpen:E2,small:k2,triggerInputContainer:O2,right:T2,multiOptions:_2,multiOption:M2,focus:D2,selectedSingleValue:R2,placeHolder:I2,groupOrderFirst:N2,groupOrderMiddle:P2,groupOrderLast:A2,detailedLabel:L2},j2=({selectedOptions:e,small:t,width:n,testId:r})=>{const o=jO(),[i,s]=x.useState([]),[a,l]=x.useState([]);return x.useEffect(()=>{let c=[],u=[],d=0;e.forEach((f,h)=>{d+=g2(f,t,o),h===e.length-1&&d<n||d<n-24?c.push(f):u.push(f)}),s(c),l(u)},[e,o,n]),v.jsxs("div",{className:at.multiOptions,"data-testid":r&&`${r}-value`,children:[i.filter(c=>c&&c.label).map((c,u)=>v.jsx("span",{className:at.multiOption,onClick:d=>{d.stopPropagation()},children:c.label},u)),a.length>0&&v.jsx(hn,{text:a.map((c,u)=>v.jsx("div",{children:c.label},u)),display:"inline-flex",children:v.jsx("span",{className:at.multiOption,children:i.length?`+${a.length}`:`${a.length} items`})})]})},$2=({selectedOptions:e,searchable:t=!1,searchValue:n,onChange:r=We.noop,inputRef:o,error:i,placeholder:s="Select...",small:a,testId:l})=>{const c=x.useRef(null),u=Array.isArray(e),d=u?e.length>0:!!e,f=n?n.length+1:1,h=()=>{var p,g;const m=((p=c.current)==null?void 0:p.offsetWidth)||0,b=((g=o.current)==null?void 0:g.offsetWidth)||0;return m-b};return v.jsxs("div",{className:at.triggerInputContainer,ref:c,children:[d?u?v.jsx(j2,{selectedOptions:e,small:a,width:h(),testId:l}):v.jsx("span",{className:at.selectedSingleValue,"data-testid":l&&`${l}-value`,children:n!=null&&n.length?"":e==null?void 0:e.label}):v.jsx("span",{className:at.placeHolder,children:n!=null&&n.length?"":s}),t?v.jsx("input",{tabIndex:-1,ref:o,size:f,className:at.input,value:n,onChange:p=>r(p.target.value),"data-error":i||null,"data-testid":l&&`${l}-input`}):null]})},z2=({selectedOptions:e,searchValue:t,searchable:n,clearable:r,onClickTrigger:o,element:i,error:s,warning:a,tooltip:l,small:c,isInTable:u,disabled:d,onChangeSearch:f,onClickDeselect:h,onClickClear:p,tabIndex:g,isOpen:m,triggerRef:b,clearAllIsFocused:y,focusedSelectedOptionIndex:w,onFocus:S,onBlur:C,groupOrder:E,maxTooltipWidth:k,placeholder:_,right:T,testId:D})=>{var O;const[M,R]=LO(),I=Array.isArray(e)?e.length>0&&((O=e[0])==null?void 0:O.value):e==null?void 0:e.value,N=r&&I,$=(()=>{if(E)switch(E){case Vt.FIRST:return at.groupOrderFirst;case Vt.LAST:return at.groupOrderLast;default:return at.groupOrderMiddle}return""})(),A=!Array.isArray(e)&&(e!=null&&e.details)?{...e,label:v.jsxs("div",{className:oe(at.detailedLabel),children:[v.jsx(bs,{children:e.label}),v.jsx(bs,{muted:!0,children:e.details})]})}:e,z=v.jsxs(v.Fragment,{children:[i,v.jsxs("div",{ref:b,tabIndex:g,className:oe(at.trigger,m?at.isOpen:"",d?at.disabled:"",c?at.small:"",u?at.isInTable:"",T?at.right:"",$),onClick:F=>{F.stopPropagation(),requestAnimationFrame(()=>{o(F),typeof R=="function"&&R()})},onFocus:S,onBlur:C,"data-error":s||null,"data-warning":a||null,"data-testid":D,children:[v.jsx($2,{selectedOptions:A,placeholder:_,searchable:n,searchValue:t,inputRef:M,onChange:f,error:s,small:c,testId:D}),v.jsx("span",{className:at.icons,children:N?v.jsx("span",{className:oe(at.clearAll,y?at.focus:""),onClick:F=>{F.stopPropagation(),p&&p(F)},"data-testid":D&&`${D}-clear`,children:v.jsx(Ae,{icon:Ce.CLOSE})}):v.jsx("span",{className:oe(at.iconOpen),children:v.jsx(Ae,{icon:"chevron down"})})})]})]});return v.jsx(v.Fragment,{children:v.jsx(hn,{error:!!s,warning:!!a,text:l||s||a,enabled:l&&ft(l)||s&&ft(s)||a&&ft(a)||!1,maxWidth:k,children:z})})};var zr=(e=>(e.SET_VISIBLE_OPTIONS="SET_VISIBLE_OPTIONS",e.RESET_LAYER_FOCUS="RESET_LAYER_FOCUS",e.CLEAR_SEARCH="CLEAR_SEARCH",e.ON_CHANGE_SEARCH="ON_CHANGE_SEARCH",e.FOCUS_TRIGGER_INPUTS="FOCUS_TRIGGER_INPUTS",e.BLUR_TRIGGER_INPUTS="BLUR_TRIGGER_INPUTS",e.FOCUS_LAYER_OPTIONS="FOCUS_LAYER_OPTIONS",e.OPEN_LAYER="OPEN_LAYER",e.CLOSE_LAYER="CLOSE_LAYER",e))(zr||{});const FO={options:["none","clearAll"],currentIndex:0,currentOption:!1,clearAll:!1},B2=e=>e!==null?e+1:0,HO=(e,t)=>{const n=["none",...e.map((o,i)=>o.type!==Jn.HEADING?i:null).filter(o=>o!==null)],r=B2(t);return{options:n,currentIndex:r,current:n[r]}},F2=(e,t)=>{const n=e==="up"?-1:1,r=t.currentIndex+n,o=(r<0?t.options.length-1:r)%t.options.length,i=t.options[o];return{...t,currentIndex:o,current:i}},H2=(e,t,n)=>{const r=e==="left"?-1:1,o=t&&t.length?["none",...Array.from({length:t.length},(c,u)=>u),"clearAll"]:["none","clearAll"],i=n.currentIndex+r,s=(i<0?o.length-1:i)%o.length,a=o[s];return{options:o,currentIndex:s,currentOption:a,clearAll:a==="clearAll"}},G1=()=>FO,Y1=e=>({...e,currentIndex:0,current:"none"}),V2=(e,t)=>{switch(t.type){case zr.SET_VISIBLE_OPTIONS:return{...e,visibleOptions:t.options||[]};case zr.RESET_LAYER_FOCUS:return{...e,layerFocus:HO(t.options||[],t.firstSelectedOptionIndex||0)};case zr.CLEAR_SEARCH:return{...e,visibleOptions:t.options||[],searchValue:""};case zr.ON_CHANGE_SEARCH:{let r=[...(t.options||[]).filter(o=>(String(o.label)+(o.details?String(o.details):"")).toLowerCase().includes(String(t.value||"").toLowerCase()))];return t.createAble&&t.value&&t.value!==""&&r.push({label:`Create "${t.value}"`,value:t.value,createAble:!0}),{...e,searchValue:t.value,visibleOptions:r,layerFocus:Y1(e.layerFocus)}}case zr.FOCUS_TRIGGER_INPUTS:return{...e,triggerFocus:H2(t.direction||"right",t.selectedOptions||[],e.triggerFocus),layerFocus:Y1(e.layerFocus)};case zr.BLUR_TRIGGER_INPUTS:return{...e,triggerFocus:G1()};case zr.FOCUS_LAYER_OPTIONS:return t.nextLayerFocus?{...e,layerFocus:t.nextLayerFocus,triggerFocus:G1()}:e;case zr.OPEN_LAYER:return{...e,isLayerOpen:!0};case zr.CLOSE_LAYER:return{...e,isLayerOpen:!1};default:return e}},W2={auto:!0,possiblePlacements:["bottom-start","top-start"],placement:"bottom-start",preferX:"right",preferY:"bottom"};var Kn=(e=>(e.CLOSE_LAYER="CLOSE_LAYER",e.OPEN_LAYER="OPEN_LAYER",e.SET_VISIBLE_OPTIONS="SET_VISIBLE_OPTIONS",e.CLEAR_SEARCH="CLEAR_SEARCH",e.RESET_LAYER_FOCUS="RESET_LAYER_FOCUS",e.FOCUS_LAYER_OPTIONS="FOCUS_LAYER_OPTIONS",e.BLUR_TRIGGER_INPUTS="BLUR_TRIGGER_INPUTS",e.FOCUS_TRIGGER_INPUTS="FOCUS_TRIGGER_INPUTS",e.ON_CHANGE_SEARCH="ON_CHANGE_SEARCH",e))(Kn||{}),Wr=(e=>(e.RIGHT="right",e.LEFT="left",e.UP="up",e.DOWN="down",e.ENTER="enter",e.ESC="esc",e.TAB="tab",e))(Wr||{});const U2=({state:e,dispatch:t,options:n,setTriggerFocus:r,disabled:o,disabledContext:i,onCreate:s,onChange:a,selectedOptions:l,width:c,small:u,isFontLoaded:d,placeholder:f,firstSelectedOptionIndex:h,createAble:p,listRef:g,autoLayerWidth:m})=>{const b=()=>{e.isLayerOpen&&t({type:Kn.CLOSE_LAYER}),r()},y=()=>t({type:Kn.OPEN_LAYER}),w=x.useRef(!0);x.useEffect(()=>{w.current?w.current=!1:t({type:Kn.SET_VISIBLE_OPTIONS,options:n})},[n]);const S=(j,Y,re)=>{if(!(o||i)){if(re&&re(),Y){if(Y.createAble&&s)s(Y.value);else if(!Y.disabled)if(Array.isArray(l))if(l.some(ie=>ie.label===Y.label)){const ie=l.filter(_e=>_e.label!==Y.label);a&&a(j,ie)}else{const ie=[...l,Y];a&&a(j,ie)}else a&&a(j,Y)}t({type:Kn.CLEAR_SEARCH,options:n}),r()}},C=x.useCallback(()=>c?c!=="auto"?c:K1(n,u,d,f):"100%",[n,d]),E=x.useCallback(j=>m?Math.max(K1(n,u,d,f),j==null?void 0:j.width):j==null?void 0:j.width,[n,d]),{renderLayer:k,layerProps:_,triggerProps:T,triggerBounds:D}=mu({isOpen:(e==null?void 0:e.isLayerOpen)??!1,overflowContainer:!0,...W2,ResizeObserver,onOutsideClick:b,onParentClose:b}),O=()=>{if(!(o||i)){if(e.isLayerOpen){b();return}r(),t({type:Kn.RESET_LAYER_FOCUS,options:n,firstSelectedOptionIndex:h}),y()}},M=x.useRef(!0);x.useEffect(()=>{M.current?M.current=!1:e.isLayerOpen||t({type:Kn.CLEAR_SEARCH,options:n})},[e.isLayerOpen]);const R=(j,Y)=>{const re=l instanceof Array?l.filter(se=>se.value!==Y.value):null;a&&a(j,re)},I=j=>{const Y=l instanceof Array?[]:{value:null};a&&a(j,Y)},N=j=>t({type:Kn.ON_CHANGE_SEARCH,options:n,value:j,createAble:p}),$=()=>{y(),t({type:Kn.BLUR_TRIGGER_INPUTS})},A=j=>{g.current&&Number.isInteger(j)&&g.current.scrollToItem(j)},z=j=>{const Y=F2(j,e.layerFocus);t({type:Kn.FOCUS_LAYER_OPTIONS,nextLayerFocus:Y}),A(Y.current)},F=j=>{t({type:Kn.FOCUS_TRIGGER_INPUTS,ICustomSelectDirection:j,selectedOptions:l})},V=j=>I(j),ee=l&&l[e.triggerFocus.currentOption],X=j=>{R(j,l[e.triggerFocus.currentOption])},W=j=>{var Y;S(j,(Y=e==null?void 0:e.visibleOptions)==null?void 0:Y[e.layerFocus.current],b)},L=e.triggerFocus.clearAll;return{getTriggerWidth:C,onKeyEvent:(j,Y)=>{switch(j){case Wr.UP:{z(j);break}case Wr.DOWN:{e.isLayerOpen?z(j):$();break}case Wr.LEFT:case Wr.RIGHT:{F(j);break}case Wr.ENTER:{L?V(Y):ee?X(Y):W(Y);break}case Wr.ESC:{b();break}case Wr.TAB:{t({type:Kn.CLOSE_LAYER});break}}},clearAllIsFocused:L,triggerProps:T,onClickTrigger:O,onChangeSearch:N,onClickDeselectOption:R,onClickClearAll:I,renderLayer:k,layerProps:_,closeLayer:b,onSelectOption:S,getLayerWidth:E,triggerBounds:D}},q2=e=>{const{multi:t=!1,disabled:n=!1,error:r=null,warning:o=null,tooltip:i=null,options:s,selectedOptions:a,onCreate:l=null,placeholder:c="",small:u=!1,tabIndex:d=0,onFocus:f=()=>{},onBlur:h=()=>{},searchable:p=!0,clearable:g=!1,maxTooltipWidth:m,closeOnOptionActionClick:b,isInTable:y=!1,groupOrder:w,firstSelectedOptionIndex:S=0,right:C=!1,testId:E=void 0}=e,k=x.useContext(ht),_=l!==null,T=x.useRef(null),[D,O]=LO(),M=jO(),[R,I]=x.useReducer(V2,{options:s,firstSelectedOptionIndex:S},({options:se})=>({searchValue:"",visibleOptions:se,layerFocus:HO(se,S??0),triggerFocus:FO,isLayerOpen:!1})),{getTriggerWidth:N,onKeyEvent:$,clearAllIsFocused:A,triggerProps:z,onClickTrigger:F,onChangeSearch:V,onClickDeselectOption:ee,onClickClearAll:X,renderLayer:W,layerProps:L,closeLayer:P,onSelectOption:j,getLayerWidth:Y,triggerBounds:re}=U2({...e,state:R,dispatch:I,setTriggerFocus:O,disabledContext:k,isFontLoaded:M,createAble:_,listRef:T});return v.jsx("div",{style:{width:N()},children:v.jsxs(AO,{handleKeys:Object.values(Wr),onKeyEvent:$,children:[v.jsx(z2,{selectedOptions:a,searchValue:R.searchValue,isOpen:R.isLayerOpen,focusedSelectedOptionIndex:R.triggerFocus.currentOption,clearAllIsFocused:A,searchable:p,triggerRef:bm(D,z.ref),error:r,warning:o,tooltip:i,small:u,isInTable:y,disabled:n||k,clearable:g,tabIndex:d,onClickTrigger:F,onChangeSearch:V,onClickDeselect:ee,onClickClear:X,onFocus:f,onBlur:h,groupOrder:w,maxTooltipWidth:m,placeholder:c,right:C,testId:E}),R.isLayerOpen&&W(v.jsx("div",{...L,className:Kt.layerContainer,children:v.jsx(m2,{listRef:T,isMulti:t,sections:R.visibleOptions,selectedOptions:a,onSelectOption:(se,ie)=>{j(se,ie,t?void 0:P)},closeLayer:()=>{b&&P()},width:Y(re),small:u,focusedOptionIndex:R.layerFocus.current,firstSelectedOptionIndex:S??0,testId:E&&`${E}-layer`})}))]})})},Ef=e=>e==null||e==="",H0=e=>e instanceof Array,K2=(e,t)=>t&&Array.isArray(e)?e.map(n=>typeof n=="string"||typeof n=="number"?{label:n,value:n}:n):e,X1=(e,t)=>{if(t!==null&&typeof t=="object"&&t.hasOwnProperty("label")&&t.hasOwnProperty("value"))return t;{const n=t!==null&&typeof t=="object"&&t.hasOwnProperty("value")?t.value:t;return(Array.isArray(e)?e.filter(o=>o.type!==Jn.HEADING).find(o=>o.value==n):void 0)||(Ef(n)?void 0:{value:n,label:n})}},G2=(e,t)=>H0(t)?t.map(r=>X1(e,r)).filter(r=>r!==void 0):t===null?void 0:X1(e,t),Y2=e=>Array.isArray(e)&&e.some(t=>typeof t=="string"||typeof t=="number"),X2=(e,t)=>{const n=t instanceof Array?t.length?t[0]:null:t,r=n==null?null:typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:n.value,o=e.filter(i=>i.type!==Jn.HEADING).findIndex(i=>typeof i=="string"||typeof i=="number"?i==r:i.value==r);return o===-1?null:o},J2=(e,t)=>{const r=H0(t)?t:Ef(t)?[]:[t];return!(r!=null&&r.every(o=>(e==null?void 0:e.find(s=>(s==null?void 0:s.value)===(o==null?void 0:o.value)))!==void 0))},Z2=(e,t,n,r)=>{const o=Array.isArray(e)?e:[],i=H0(t),s=Y2(o),a=K2(o,s),l=n?X2(o,t):null,c=G2(a,t),u=r&&c!==void 0?J2(a,c):!1;return{options:a,selectedOptions:c,multi:i,simpleInputs:s,firstSelectedOptionIndex:l,hasNonExistentValue:u}},VO=e=>{const{name:t="",options:n=[],value:r,native:o=!1,onChange:i=We.noop,deprecatedEventHandler:s=!1,autoScroll:a=!0,warning:l,error:c,checkNonExistentValues:u=!0,closeOnOptionActionClick:d=!0,testId:f,disabled:h}=e,p=!o&&a===!0,{multi:g,simpleInputs:m,options:b,selectedOptions:y,firstSelectedOptionIndex:w,hasNonExistentValue:S}=Z2(n,r,p,u),C=!g,E=o&&C;o&&!C&&console.warn("Native select does not support provided props (see stories)");const k="Value no longer available for re-selection",_=S&&!h?l?v.jsxs("div",{children:[v.jsx("div",{children:k}),v.jsx("div",{children:l})]}):k:l,T=S&&c&&!h?v.jsxs("div",{children:[v.jsx("div",{children:k}),v.jsx("div",{children:c})]}):c,D=(O,M)=>{if(s){const R=g?M.map(I=>m?I.value:I):m?M.value:M;R&&i(R)}else{const R=!(O instanceof Event),I=g?M:M.value;if(R)O.target.name=t,O.target.value=I,g||(O.target.label=M.label),i(O);else{const N={...O,target:{...O.target,name:t,value:I,label:g?void 0:M.label}};i(N)}}};return E?v.jsx(DW,{...e,options:b,selectedOption:y,onChange:D,hasNonExistentValue:S,warning:_,error:T,testId:f}):v.jsx(q2,{...e,options:b,selectedOptions:y,onChange:D,multi:g,firstSelectedOptionIndex:w,warning:_,error:T,testId:f,closeOnOptionActionClick:d})},Q2=(e,t)=>t||e&&e.reduce((n,r)=>r!=null&&r.selected?Number(r==null?void 0:r.value):n,10)||10,e6=(e,t)=>{if(!t||!e)return 10;const{options:n,value:r}=t,o=Number(r);return o===0?1:Math.ceil(e/Q2(n,o))},J1=(e,t,n="Selected page must be a positive whole number between 1 and")=>{const r=`${n} ${t}`,o={valid:!0,error:null};return e===""?o:!e.match(/^\d+$/g)||parseInt(e)<=0||parseInt(e)>t?{valid:!1,error:r}:o},t6="_paginationContainer_1tmz4_1",n6={paginationContainer:t6},r6=({pagination:e})=>{const{rowCount:t,selectedPage:n,small:r,onSelectPage:o,rowsPerPage:i,errorMessageTemplate:s,testIds:a}=e,l=Number(i==null?void 0:i.value)===0,c=e6(t,i),[u,d]=x.useState(String(n));x.useEffect(()=>{d(String(n))},[n]);const{error:f}=J1(u,c,s),h=p=>{const{valid:g}=J1(p,c,s);d(p),g&&p!==""&&o&&o(Number(p))};return v.jsxs("div",{className:n6.paginationContainer,children:[i&&v.jsx("div",{style:{flexShrink:0},children:v.jsx(VO,{onChange:p=>{i.onChange&&i.onChange(p),h(String(1))},options:i.options,native:!!i.options,small:r,width:"auto",value:i.value})}),v.jsx(ln,{small:r,round:!0,basic:!0,icon:Ce.CHEVRON_DOUBLE_LEFT,onClick:()=>h(String(1)),disabled:l||n===1}),v.jsx(ln,{small:r,round:!0,basic:!0,icon:Ce.CHEVRON_LEFT,onClick:()=>h(String(Number(n)-1)),disabled:l||n===1}),v.jsxs(QH,{small:r,width:"auto",children:[v.jsx(P0,{right:!0,value:u,placeholder:String(n),onChange:p=>h(p.target.value),width:"50px",disabled:l||c<=1,error:f}),v.jsxs(S3,{children:["of ",c]})]}),v.jsx(ln,{small:r,round:!0,basic:!0,icon:Ce.CHEVRON_RIGHT,onClick:()=>h(String(Number(n)+1)),disabled:l||n===c}),v.jsx(ln,{small:r,round:!0,basic:!0,icon:Ce.CHEVRON_DOUBLE_RIGHT,onClick:()=>h(String(c)),disabled:l||n===c,testId:a==null?void 0:a.doubleRightBtn})]})},o6="_toggleBox_lhie5_1",i6="_fullWidthStyleFix_lhie5_8",s6="_dismiss_lhie5_13",td={toggleBox:o6,fullWidthStyleFix:i6,dismiss:s6},a6=({children:e,content:t,placement:n="top-center",closeOnOutsideClick:r=!0,fullWidth:o=!1,showCloseButton:i=!1,testId:s,disabled:a=!1,overflowContainer:l=!1,isOpen:c,onToggle:u})=>{const d=x.useContext(ht),[f,h]=c!==void 0?[c,u]:x.useState(!1),p=()=>{!a&&!d&&h&&h(!1)},g=()=>{a||d||h&&h(!f)};x.useEffect(()=>{(a||d)&&p()},[a,d]);const{renderLayer:m,arrowProps:b,layerProps:y,triggerProps:w}=mu({isOpen:f,placement:n,auto:!0,triggerOffset:6,onOutsideClick:r?p:void 0,ResizeObserver:kh,overflowContainer:l});return v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:w.ref,onClick:g,"data-testid":s,children:e}),f&&m(v.jsxs("div",{className:o?oe(td.toggleBox,td.fullWidthStyleFix):oe(td.toggleBox),...y,children:[v.jsxs("div",{children:[U.isValidElement(t)?U.cloneElement(t,{close:p}):t,i&&v.jsx("div",{className:td.dismiss,children:v.jsx(ln,{small:!0,round:!0,onClick:p,icon:Ce.CLOSE})})]}),v.jsx(fk,{...b,backgroundColor:"var(--color-background-layer)",borderColor:"var(--color-border)",borderWidth:1,size:6})]}))]})};var $m={exports:{}};(function(e,t){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var f=u.stack;return r(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){r(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return r(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})($m,$m.exports);var WO=$m.exports,Z1="ProseMirror-selectednode",V0="",fi="\0",Q1="__state_override__",l6={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},De=l6,Co=Symbol.for("__remirror__"),At=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))(At||{}),Be=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Be||{}),bn=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(bn||{}),Q=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(Q||{}),K=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(K||{}),c6=function(t){return u6(t)&&!d6(t)};function u6(e){return!!e&&typeof e=="object"}function d6(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||p6(e)}var f6=typeof Symbol=="function"&&Symbol.for,h6=f6?Symbol.for("react.element"):60103;function p6(e){return e.$$typeof===h6}function g6(e){return Array.isArray(e)?[]:{}}function Fc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ha(g6(e),e,t):e}function m6(e,t,n){return e.concat(t).map(function(r){return Fc(r,n)})}function v6(e,t){if(!t.customMerge)return Ha;var n=t.customMerge(e);return typeof n=="function"?n:Ha}function y6(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function ex(e){return Object.keys(e).concat(y6(e))}function UO(e,t){try{return t in e}catch{return!1}}function b6(e,t){return UO(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function x6(e,t,n){var r={};return n.isMergeableObject(e)&&ex(e).forEach(function(o){r[o]=Fc(e[o],n)}),ex(t).forEach(function(o){b6(e,o)||(UO(e,o)&&n.isMergeableObject(t[o])?r[o]=v6(o,n)(e[o],t[o],n):r[o]=Fc(t[o],n))}),r}function Ha(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||m6,n.isMergeableObject=n.isMergeableObject||c6,n.cloneUnlessOtherwiseSpecified=Fc;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):x6(e,t,n):Fc(t,n)}Ha.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Ha(r,o,n)},{})};var w6=Ha,S6=w6;const C6=_o(S6);var E6=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const k6=_o(E6);/*!
86
+ * isobject <https://github.com/jonschlinkert/isobject>
87
+ *
88
+ * Copyright (c) 2014-2017, Jon Schlinkert.
89
+ * Released under the MIT License.
90
+ */var qO=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*!
91
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
92
+ *
93
+ * Copyright (c) 2014-2017, Jon Schlinkert.
94
+ * Released under the MIT License.
95
+ */var O6=qO;function tx(e){return O6(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var T6=function(t){var n,r;return!(tx(t)===!1||(n=t.constructor,typeof n!="function")||(r=n.prototype,tx(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*!
96
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
97
+ *
98
+ * Copyright (c) 2015-2017, Jon Schlinkert.
99
+ * Released under the MIT License.
100
+ */var _6=T6,M6=function(t){return _6(t)||typeof t=="function"||Array.isArray(t)};/*!
101
+ * object.omit <https://github.com/jonschlinkert/object.omit>
102
+ *
103
+ * Copyright (c) 2014-2017, Jon Schlinkert.
104
+ * Released under the MIT License.
105
+ */var D6=M6,R6=function(t,n,r){if(!D6(t))return{};typeof n=="function"&&(r=n,n=[]),typeof n=="string"&&(n=[n]);for(var o=typeof r=="function",i=Object.keys(t),s={},a=0;a<i.length;a++){var l=i[a],c=t[l];(!n||n.indexOf(l)===-1&&(!o||r(c,l,t)))&&(s[l]=c)}return s};const KO=_o(R6);/*!
106
+ * object.pick <https://github.com/jonschlinkert/object.pick>
107
+ *
108
+ * Copyright (c) 2014-2015 Jon Schlinkert, contributors.
109
+ * Licensed under the MIT License
110
+ */var I6=qO,N6=function(t,n){if(!I6(t)&&typeof t!="function")return{};var r={};if(typeof n=="string")return n in t&&(r[n]=t[n]),r;for(var o=n.length,i=-1;++i<o;){var s=n[i];s in t&&(r[s]=t[s])}return r};const zm=_o(N6),GO=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,P6=/\S+/g;function A6(e,t){const n={parts:[],prefixes:[]},r=e.matchAll(t);let o=0;for(const s of r){if(typeof s.index!="number")continue;const a=s[0];n.parts.push(a);const l=e.slice(o,s.index).trim();n.prefixes.push(l),o=s.index+a.length}const i=e.slice(o).trim();return i&&(n.parts.push(""),n.prefixes.push(i)),n}function YO(e,t){const{keepSpecialCharacters:n=!1,keep:r,prefix:o=""}=t||{},i=e.trim().normalize("NFC"),s=i.includes(" "),l=A6(i,s?P6:GO);return l.parts.map((c,u)=>{let d=l.prefixes[u]||"",f=c;return n===!1&&(r&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${r.join("")}]`,"g"),"")),r||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),r&&(d=d.replace(new RegExp(`[^${r.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function L6(e){const t=e.matchAll(GO).next().value,n=t?t.index:0;return e.slice(0,n+1).toUpperCase()+e.slice(n+1).toLowerCase()}function XO(e,t){return YO(e,t).reduce((n,r)=>n+L6(r),"")}function nx(e,t){return YO(e,{...t,prefix:"-"}).join("").toLowerCase()}function rx(e,t,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(r=n,n=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];var h=this,p=Date.now()-s;if(i)return;function g(){s=Date.now(),n.apply(h,d)}function m(){o=void 0}r&&!o&&g(),a(),r===void 0&&p>e?g():t!==!0&&(o=setTimeout(r?m:g,r===void 0?e-p:e))}return c.cancel=l,c}function j6(e,t,n){return n===void 0?rx(e,t,!1):rx(e,n,t!==!1)}function Qe(e,t,n){const r=e[t];return JO(!Wh(r),n),r}function JO(e,t){if(!e)throw new $6(t)}var $6=class extends WO.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function wt(e){return Object.entries(e)}function kf(e){return Object.keys(e)}function Vh(e){return Object.values(e)}function Jr(e,t,n){return e.includes(t,n)}function le(e){return Object.assign(Object.create(null),e)}function ZO(e){return Object.prototype.toString.call(e)}function QO(e){return ZO(e).slice(8,-1)}function Eu(e,t){return n=>typeof n!==e?!1:t?t(n):!0}function W0(e){return t=>QO(t)===e}var Wh=Eu("undefined"),ge=Eu("string"),nr=Eu("number",e=>!Number.isNaN(e)),Xe=Eu("function");function z6(e){return e===null}function B6(e){return e===!0||e===!1}function Bs(e){if(QO(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function F6(e){return e==null||/^[bns]/.test(typeof e)}function Ri(e){return z6(e)||Wh(e)}function gn(e){return!Ri(e)&&(Xe(e)||Eu("object")(e))}var H6=W0("RegExp");function V6(e){return W0("Map")(e)}function W6(e){return W0("Set")(e)}function Of(e){return gn(e)&&!V6(e)&&!W6(e)&&Object.keys(e).length===0}var Et=Array.isArray;function Ii(e){return Et(e)&&e.length===0}function ox(e){return Et(e)&&e.length>0}function U0(e,t,n=r=>!!r){t.lastIndex=0;const r=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&r.push(i);while(n(i));return t.lastIndex=0,r}function Tf(){const e=Date.now(),t=Tf.last||e;return Tf.last=e>t?e:t+1}Tf.last=0;function _f(e=""){return`${e}${Tf().toString(36)}`}function U6(e){return KO(e,t=>!Wh(t))}function q6(e){if(!Bs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}function Hc(e,t=!1){const n=t?[...e].reverse():e,r=new Set(n);return t?[...r].reverse():[...r]}function eT(){}function K6(...e){return C6.all(e,{isMergeableObject:Bs})}function G6({min:e,max:t,value:n}){return n<e?e:n>t?t:n}function Va(e,t){return[...e].map((n,r)=>({value:n,index:r})).sort((n,r)=>t(n.value,r.value)||n.index-r.index).map(({value:n})=>n)}function Y6(e,t,n){try{if(ge(t)&&t in e)return e[t];Et(t)&&(t=`['${t.join("']['")}']`);let r=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(r=r[s||a||l||c],"")),r===void 0?n:r}catch{return n}}function X6(e,t){const n=q6(t);let r=n;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=r[i];if(s){if(Et(r)){const l=Number.parseInt(i.toString(),10);nr(l)&&r.splice(l,1)}else Reflect.deleteProperty(r,i);return n}if(F6(a))return n;a=Et(a)?[...a]:{...a},r[i]=a,r=a}return n}function J6(e){return t=>Y6(t,e)}function Z6(e,t,n=!1){const r=[],o=new Set,i=Xe(t)?t:J6(t),s=n?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),r.push(a))}return n?r.reverse():r}function tT(e,t){const n=Et(e)?e[0]:e;return nr(t)?n<=t?Array.from({length:t+1-n},(r,o)=>o+n):Array.from({length:n+1-t},(r,o)=>-1*o+n):Array.from({length:Math.abs(n)},(r,o)=>(n<0?-1:1)*o)}function ix(e,...t){const n=t.filter(nr);return e>=Math.min(...n)&&e<=Math.max(...n)}function nT(e){return Xe(e)?e():e}var rT="https://remirror.io/docs/errors",Q6={[K.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[K.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[K.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[K.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[K.MUTATION]:"Mutation of immutable value detected.",[K.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[K.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[K.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[K.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[K.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[K.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[K.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[K.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[K.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[K.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[K.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[K.INVALID_EXTENSION]:"The provided extension is invalid.",[K.INVALID_CONTENT]:"The content provided to the editor is not supported.",[K.INVALID_NAME]:"An invalid name was used for the extension.",[K.EXTENSION]:"An error occurred within an extension. More details should be made available.",[K.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[K.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[K.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[K.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[K.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[K.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[K.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[K.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[K.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[K.REACT_COMPONENTS]:"An error occurred within a remirror component.",[K.REACT_HOOKS]:"An error occurred within a remirror hook.",[K.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function eU(e){return ge(e)&&Jr(Vh(K),e)}function tU(e,t){const n=Q6[e],r=n?`${n}
111
+
112
+ `:"",o=t?`${t}
113
+
114
+ `:"";return`${r}${o}For more information visit ${rT}#${e.toLowerCase()}`}var oT=class extends WO.BaseError{constructor({code:e,message:t,disableLogging:n=!1}={}){const r=eU(e)?e:K.CUSTOM;super(tU(r,t)),this.errorCode=r,this.url=`${rT}#${r.toLowerCase()}`,n||console.error(this.message)}static create(e={}){return new oT(e)}};function fe(e,t){if(!e)throw oT.create(t)}function nU(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function fs(e,t={}){return e}function Bt(e){this.content=e}Bt.prototype={constructor:Bt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return o==-1?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Bt(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Bt(n)},addToStart:function(e,t){return new Bt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Bt(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(i==-1?o.length:i,0,t,n),new Bt(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Bt.from(e),e.size?new Bt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Bt.from(e),e.size?new Bt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Bt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Bt.from=function(e){if(e instanceof Bt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Bt(t)};function iT(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=iT(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function sT(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=sT(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class B{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new B(o,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],o=0;if(n>t)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new B(r,o)}cutByIndex(t,n){return t==n?B.empty:t==0&&n==this.content.length?this:new B(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new B(o,i)}addToStart(t){return new B([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new B(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];t(o,r,n),r+=o.nodeSize}}findDiffStart(t,n=0){return iT(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return sT(this,t,n,r)}findIndex(t,n=-1){if(t==0)return nd(0,t);if(t==this.size)return nd(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?nd(r+1,s):nd(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return B.empty;let n,r=0;for(let o=0;o<t.length;o++){let i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new B(n||t,r)}static from(t){if(!t)return B.empty;if(t instanceof B)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new B([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const rg={index:0,offset:0};function nd(e,t){return rg.index=e,rg.offset=t,rg}function Mf(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Mf(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Mf(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Pe=class Bm{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,o));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Mf(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Bm.none;if(t instanceof Bm)return[t];let n=t.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Pe.none=[];class Df extends Error{}class J{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=lT(this.content,t+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(t,n){return new J(aT(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return J.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new J(B.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new J(t,r,o)}}J.empty=new J(B.empty,0,0);function aT(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(aT(i.content,t-o-1,n-o-1)))}function lT(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let a=lT(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function rU(e,t,n){if(n.openStart>e.depth)throw new Df("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Df("Inconsistent open depths");return cT(e,t,n,0)}function cT(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=cT(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return ws(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=oU(n,e);return ws(i,dT(e,s,a,t,r))}else return ws(i,Rf(e,t,r))}function uT(e,t){if(!t.type.compatibleContent(e.type))throw new Df("Cannot join "+t.type.name+" onto "+e.type.name)}function Fm(e,t,n){let r=e.node(n);return uT(r,t.node(n)),r}function xs(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Cc(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(xs(e.nodeAfter,r),i++));for(let a=i;a<s;a++)xs(o.child(a),r);t&&t.depth==n&&t.textOffset&&xs(t.nodeBefore,r)}function ws(e,t){return e.type.checkContent(t),e.copy(t)}function dT(e,t,n,r,o){let i=e.depth>o&&Fm(e,t,o+1),s=r.depth>o&&Fm(n,r,o+1),a=[];return Cc(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(uT(i,s),xs(ws(i,dT(e,t,n,r,o+1)),a)):(i&&xs(ws(i,Rf(e,t,o+1)),a),Cc(t,n,o,a),s&&xs(ws(s,Rf(n,r,o+1)),a)),Cc(r,null,o,a),new B(a)}function Rf(e,t,n){let r=[];if(Cc(null,e,n,r),e.depth>n){let o=Fm(e,t,n+1);xs(ws(o,Rf(e,t,n+1)),r)}return Cc(t,null,n,r),new B(r)}function oU(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(B.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Wa{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)o+=r.child(i).nodeSize;return o}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Pe.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),o=t.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ms(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Wa(n,r,i)}static resolveCached(t,n){let r=sx.get(t);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else sx.set(t,r=new iU);let o=r.elts[r.i]=Wa.resolve(t,n);return r.i=(r.i+1)%sU,o}}class iU{constructor(){this.elts=[],this.i=0}}const sU=12,sx=new WeakMap;class Ms{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const aU=Object.create(null);let Ci=class Hm{constructor(t,n,r,o=Pe.none){this.type=t,this.attrs=n,this.marks=o,this.content=r||B.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,o=0){this.content.nodesBetween(t,n,r,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,o){return this.content.textBetween(t,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Mf(this.attrs,n||t.defaultAttrs||aU)&&Pe.sameSet(this.marks,r||Pe.none)}copy(t=null){return t==this.content?this:new Hm(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Hm(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return J.empty;let o=this.resolve(t),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new J(c,o.depth-s,i.depth-s)}replace(t,n,r){return rU(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(o==t||n.isText)return n;t-=o+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(t){return Wa.resolveCached(this,t)}resolveNoCache(t){return Wa.resolve(this,t)}rangeHasMark(t,n,r){let o=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),fT(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=B.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(t).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Pe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Pe.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=B.fromJSON(t,n.content),i=t.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ci.prototype.text=void 0;class If extends Ci{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):fT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new If(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new If(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function fT(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ds{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new lU(t,n);if(r.next==null)return Ds.empty;let o=hT(r);r.next&&r.err("Unexpected trailing text");let i=gU(pU(o));return mU(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(t.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return B.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(t)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o<r.next.length;o++)t.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),t.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return i}).join(`
115
+ `)}}Ds.empty=new Ds(!0);class lU{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function hT(e){let t=[];do t.push(cU(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function cU(e){let t=[];do t.push(uU(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function uU(e){let t=hU(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=dU(e,t);else break;return t}function ax(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function dU(e,t){let n=ax(e),r=n;return e.eat(",")&&(e.next!="}"?r=ax(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function fU(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function hU(e){if(e.eat("(")){let t=hT(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=fU(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function pU(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function pT(e,t){return t-e}function lx(e,t){let n=[];return r(t),n.sort(pT);function r(o){let i=e[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function gU(e){let t=Object.create(null);return n(lx(e,0));function n(r){let o=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);lx(e,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[r.join(",")]=new Ds(r.indexOf(e.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(pT);i.next.push({type:o[s][0],next:t[a.join(",")]||n(a)})}return i}}function mU(e,t){for(let n=0,r=[e];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function gT(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function mT(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(o===void 0){let i=e[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function vT(e,t,n,r){for(let o in t)if(!(o in e))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in e){let i=e[o];i.validate&&i.validate(t[o])}}function yT(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new yU(e,r,t[r]);return n}let Vm=class bT{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=yT(t,r.attrs),this.defaultAttrs=gT(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ds.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:mT(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ci(this,this.computeAttrs(t),B.from(n),Pe.setFrom(r))}createChecked(t=null,n,r){return n=B.from(n),this.checkContent(n),new Ci(this,this.computeAttrs(t),n,Pe.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=B.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(B.empty,!0);return i?new Ci(this,t,n.append(i),Pe.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){vT(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Pe.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,s)=>r[i]=new bT(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function vU(e,t,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}class yU{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vU(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ku{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=yT(t,o.attrs),this.excluded=null;let i=gT(this.attrs);this.instance=i?new Pe(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Pe(this,mT(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new ku(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){vT(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class bU{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Bt.from(t.nodes),n.marks=Bt.from(t.marks||{}),this.nodes=Vm.compile(this.spec.nodes,this),this.marks=ku.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Ds.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?cx(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:cx(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Vm){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new If(r,r.defaultAttrs,t,Pe.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Ci.fromJSON(this,t)}markFromJSON(t){return Pe.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function cx(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let a in e.marks){let l=e.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function xU(e){return e.tag!=null}function wU(e){return e.style!=null}class Ua{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(xU(o))this.tags.push(o);else if(wU(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=t.nodes[o.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new dx(this,n,!1);return r.addAll(t,Pe.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new dx(this,n,!0);return r.addAll(t,Pe.none,n.from,n.to),J.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(EU(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in t.marks){let i=t.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=fx(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=fx(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ua(t,Ua.schemaRules(t)))}}const xT={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},SU={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wT={ol:!0,ul:!0},Nf=1,Pf=2,Pd=4;function ux(e,t,n){return t!=null?(t?Nf:0)|(t==="full"?Pf:0):e&&e.whitespace=="pre"?Nf|Pf:n&-5}class rd{constructor(t,n,r,o,i,s){this.type=t,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Pe.none,this.match=i||(s&Pd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Nf)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=B.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!xT.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class dx{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=ux(null,n.preserveWhitespace,0)|(r?Pd:0);o?i=new rd(o.type,o.attrs,Pe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new rd(null,null,Pe.none,!0,null,s):i=new rd(t.schema.topNodeType,null,Pe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,o=this.top;if(o.options&Pf||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&Nf)o.options&Pf?r=r.replace(/\r\n?/g,`
116
+ `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],s=t.previousSibling;(!i||s&&s.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let o=t.nodeName.toLowerCase(),i;wT.hasOwnProperty(o)&&this.parser.normalizeLists&&CU(t);let s=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,r));if(s?s.ignore:SU.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(t=s.skip);let a,l=this.top,c=this.needsBlock;if(xT.hasOwnProperty(o))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);return}let u=s&&s.skip?n:this.readStyles(t,n);u&&this.addAll(t,u),a&&this.sync(l),this.needsBlock=c}else{let a=this.readStyles(t,n);a&&this.addElementByRule(t,s,a,s.consuming===!1?i:void 0)}}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
117
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(o)this.addElement(t,r,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r)}i&&this.sync(a)&&this.open--}addAll(t,n,r,o){let i=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=o==null?null:t.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,n);this.findAtPoint(t,i)}findPlace(t,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(t);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let i=Pe.none;for(let s of r.concat(t.marks))(o.type?o.type.allowsMarkType(s.type):hx(s.type,t.type))&&(i=s.addToSet(i));return o.content.push(t.mark(i)),!0}return!1}enter(t,n,r,o){let i=this.findPlace(t.create(n),r);return i&&(i=this.enterInner(t,n,r,!0,o)),i}enterInner(t,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=ux(t,i,s.options);s.options&Pd&&s.content.length==0&&(a|=Pd);let l=Pe.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):hx(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new rd(t,n,l,o,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&t.nodeType==1&&t.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function CU(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&wT.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function EU(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function fx(e){let t={};for(let n in e)t[n]=e[n];return t}function hx(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==t||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class Mo{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=og(n).createDocumentFragment());let o=r,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:o}=Ad(og(n),this.nodes[t.type.name](t),null,t.attrs);if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let o=t.marks.length-1;o>=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&Ad(og(r),o(t,n),null,t.attrs)}static renderSpec(t,n,r=null,o){return Ad(t,n,r,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Mo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=px(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return px(t.marks)}}function px(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function og(e){return e.document||window.document}const gx=new WeakMap;function kU(e){let t=gx.get(e);return t===void 0&&gx.set(e,t=OU(e)),t}function OU(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(e),t}function Ad(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let o=t[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=kU(r))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?e.createElementNS(n,o):e.createElement(o),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<t.length;d++){let f=t[d];if(f===0){if(d<t.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=Ad(e,f,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const ST=65535,CT=Math.pow(2,16);function TU(e,t){return e+t*CT}function mx(e){return e&ST}function _U(e){return(e-(e&ST))/CT}const ET=1,kT=2,Ld=4,OT=8;class Wm{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&OT)>0}get deletedBefore(){return(this.delInfo&(ET|Ld))>0}get deletedAfter(){return(this.delInfo&(kT|Ld))>0}get deletedAcross(){return(this.delInfo&Ld)>0}}class jn{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&jn.empty)return jn.empty}recover(t){let n=0,r=mx(t);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+_U(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>t)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:n:n,h=l+o+(f<0?0:u);if(r)return h;let p=t==(n<0?l:d)?null:TU(a/3,t-l),g=t==l?kT:t==d?ET:Ld;return(n<0?t!=l:t!=d)&&(g|=OT),new Wm(h,g,p)}o+=u-c}return r?t+o:new Wm(t+o,0,null)}touches(t,n){let r=0,o=mx(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];t(a,a+c,l,l+u),i+=u-c}}invert(){return new jn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?jn.empty:new jn(t<0?[0,-t,0]:[0,0,t])}}jn.empty=new jn([]);class ka{constructor(t=[],n,r=0,o=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=o}slice(t=0,n=this.maps.length){return new ka(this.maps,this.mirror,t,n)}copy(){return new ka(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let o=t.getMirror(n);this.appendMap(t.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new ka;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,t=a.pos}return r?t:new Wm(t,o,null)}}const ig=Object.create(null);class kt{getMap(){return jn.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ig[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in ig)throw new RangeError("Duplicate use of step JSON ID "+t);return ig[t]=n,n.prototype.jsonID=t,n}}class lt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new lt(t,null)}static fail(t){return new lt(null,t)}static fromReplace(t,n,r,o){try{return lt.ok(t.replace(n,r,o))}catch(i){if(i instanceof Df)return lt.fail(i.message);throw i}}}function q0(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(q0(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return B.fromArray(r)}class hi extends kt{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new J(q0(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return lt.fromReplace(t,this.from,this.to,i)}invert(){return new Kr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new hi(n.pos,r.pos,this.mark)}merge(t){return t instanceof hi&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new hi(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new hi(n.from,n.to,t.markFromJSON(n.mark))}}kt.jsonID("addMark",hi);class Kr extends kt{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new J(q0(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return lt.fromReplace(t,this.from,this.to,r)}invert(){return new hi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Kr(n.pos,r.pos,this.mark)}merge(t){return t instanceof Kr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Kr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Kr(n.from,n.to,t.markFromJSON(n.mark))}}kt.jsonID("removeMark",Kr);class pi extends kt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return lt.fromReplace(t,this.pos,this.pos+1,new J(B.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new pi(this.pos,n.marks[o]);return new pi(this.pos,this.mark)}}return new qa(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new pi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new pi(n.pos,t.markFromJSON(n.mark))}}kt.jsonID("addNodeMark",pi);class qa extends kt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return lt.fromReplace(t,this.pos,this.pos+1,new J(B.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new pi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new qa(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new qa(n.pos,t.markFromJSON(n.mark))}}kt.jsonID("removeNodeMark",qa);class Jt extends kt{constructor(t,n,r,o=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=o}apply(t){return this.structure&&Um(t,this.from,this.to)?lt.fail("Structure replace would overwrite content"):lt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new jn([this.from,this.to-this.from,this.slice.size])}invert(t){return new Jt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Jt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Jt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?J.empty:new J(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Jt(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?J.empty:new J(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Jt(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Jt(n.from,n.to,J.fromJSON(t,n.slice),!!n.structure)}}kt.jsonID("replace",Jt);class St extends kt{constructor(t,n,r,o,i,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Um(t,this.from,this.gapFrom)||Um(t,this.gapTo,this.to)))return lt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return lt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?lt.fromReplace(t,this.from,this.to,r):lt.fail("Content does not fit in gap")}getMap(){return new jn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new St(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new St(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new St(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(t,n.slice),n.insert,!!n.structure)}}kt.jsonID("replaceAround",St);function Um(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function MU(e,t,n,r){let o=[],i=[],s,a;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,t),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=h:o.push(s=new Kr(f,h,d[g])));a&&a.to==f?a.to=h:i.push(a=new hi(f,h,r))}}),o.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function DU(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof ku){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==i-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,t),to:c,step:i})}}}),o.forEach(s=>e.step(new Kr(s.from,s.to,s.style)))}function TT(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new Jt(a,u,J.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||e.step(new Kr(a,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new J(B.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Jt(a+f.index,a+f.index+f[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(B.empty,!0);e.replace(a,a,new J(l,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function RU(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function hl(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(r<e.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!RU(o,i,s))break}return null}function IU(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=B.empty,d=0;for(let p=i,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=B.from(r.node(p).copy(u)),d++):l--;let f=B.empty,h=0;for(let p=i,g=!1;p>n;p--)g||o.after(p+1)<o.end(p)?(g=!0,f=B.from(o.node(p).copy(f)),h++):c++;e.step(new St(l,c,s,a,new J(u.append(f),d,h),u.size-d,!0))}function K0(e,t,n=null,r=e){let o=NU(e,t),i=o&&PU(r,t);return i?o.map(vx).concat({type:t,attrs:n}).concat(i.map(vx)):null}function vx(e){return{type:e,attrs:null}}function NU(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}function PU(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function AU(e,t,n){let r=B.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new St(o,i,o,i,new J(r,0,0),n.length,!0))}function LU(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&zU(e.doc,e.mapping.slice(i).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?l=!1:!f&&h&&(l=!0)}l===!1&&$U(e,s,a,i),TT(e,e.mapping.slice(i).map(a,1),r,void 0,l===null);let c=e.mapping.slice(i),u=c.map(a,1),d=c.map(a+s.nodeSize,1);return e.step(new St(u,d,u+1,d-1,new J(B.from(r.create(o,null,s.marks)),0,0),1,!0)),l===!0&&jU(e,s,a,i),!1}})}function jU(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function $U(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+i);e.replaceWith(s,s+1,t.type.schema.text(`
118
+ `))}})}function zU(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function BU(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new St(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new J(B.from(s),0,0),1,!0))}function Oa(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function FU(e,t,n=1,r){let o=e.doc.resolve(t),i=B.empty,s=B.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=B.from(o.node(a).copy(i));let u=r&&r[c];s=B.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Jt(t,t,new J(i.append(s),n,n),!0))}function Ou(e,t){let n=e.resolve(t),r=n.index();return HU(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function HU(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function VU(e,t,n){let r=new Jt(t-n,t+n,J.empty,!0);e.step(r)}function WU(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function UU(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function G0(e,t,n=t,r=J.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return _T(o,i,r)?new Jt(t,n,r):new qU(o,i,r).fit()}function _T(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class qU{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=B.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new J(i,s,a);return t>-1?new St(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Jt(r.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=sg(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(B.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=sg(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new J(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=sg(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new J(Kl(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new J(Kl(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let h=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),m=d.matchType(g.type);if(!m)break;c++,(c>1||l==0||g.content.size)&&(d=m,u.push(MT(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=Gl(this.placed,n,B.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g<h;g++){let b=m.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),m=b.content}this.unplaced=p?t==0?J.empty:new J(Kl(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new J(Kl(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!ag(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=ag(t,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=ag(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Gl(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Gl(this.placed,this.depth,B.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=Gl(this.placed,this.frontier.length,n))}}function Kl(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Kl(e.firstChild.content,t-1,n)))}function Gl(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Gl(e.lastChild.content,t-1,n)))}function sg(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function MT(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,MT(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(B.empty,!0)))),e.copy(r)}function ag(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!KU(n,i.content,s)?a:null}function KU(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function GU(e){return e.spec.defining||e.spec.definingForContent}function YU(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(_T(o,i,r))return e.step(new Jt(t,n,r));let s=RT(o,e.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=GU(h.type);if(p&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<s.length;g++){let m=s[(g+l)%s.length],b=!0;m<0&&(b=!1,m=-m);let y=o.node(m-1),w=o.index(m-1);if(y.canReplaceWith(w,w,p.type,p.marks))return e.replace(o.before(m),b?i.after(m):n,new J(DT(r.content,0,r.openStart,h),h,r.openEnd))}}let d=e.steps.length;for(let f=s.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>d));f--){let h=s[f];h<0||(t=o.before(h),n=i.after(h))}}function DT(e,t,n,r,o){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(DT(i.content,t+1,n,r,i)))}if(t>r){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(B.empty,!0))}return e}function XU(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=WU(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new J(B.from(r),0,0))}function JU(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=RT(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return e.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function RT(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class Ta extends kt{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return lt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return lt.fromReplace(t,this.pos,this.pos+1,new J(B.from(o),0,n.isLeaf?0:1))}getMap(){return jn.empty}invert(t){return new Ta(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ta(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ta(n.pos,n.attr,n.value)}}kt.jsonID("attr",Ta);class Vc extends kt{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return lt.ok(r)}getMap(){return jn.empty}invert(t){return new Vc(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Vc(n.attr,n.value)}}kt.jsonID("docAttr",Vc);let Ka=class extends Error{};Ka=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ka.prototype=Object.create(Error.prototype);Ka.prototype.constructor=Ka;Ka.prototype.name="TransformError";class ZU{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ka}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ka(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=J.empty){let o=G0(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new J(B.from(r),0,0))}delete(t,n){return this.replace(t,n,J.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return YU(this,t,n,r),this}replaceRangeWith(t,n,r){return XU(this,t,n,r),this}deleteRange(t,n){return JU(this,t,n),this}lift(t,n){return IU(this,t,n),this}join(t,n=1){return VU(this,t,n),this}wrap(t,n){return AU(this,t,n),this}setBlockType(t,n=t,r,o=null){return LU(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return BU(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new Ta(t,n,r)),this}setDocAttribute(t,n){return this.step(new Vc(t,n)),this}addNodeMark(t,n){return this.step(new pi(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Pe)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new qa(t,n)),this}split(t,n=1,r){return FU(this,t,n,r),this}addMark(t,n,r){return MU(this,t,n,r),this}removeMark(t,n,r){return DU(this,t,n,r),this}clearIncompatible(t,n,r){return TT(this,t,n,r),this}}const lg=Object.create(null);class Ee{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new QU(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=J.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(i);t.replaceRange(u.map(l.pos),u.map(c.pos),a?J.empty:n),a==0&&xx(t,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=t.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),xx(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let o=t.parent.inlineContent?new ye(t):ua(t.node(0),t.parent,t.pos,t.index(),n,r);if(o)return o;for(let i=t.depth-1;i>=0;i--){let s=n<0?ua(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):ua(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new En(t.node(0))}static atStart(t){return ua(t,t,0,0,1)||new En(t)}static atEnd(t){return ua(t,t,t.content.size,t.childCount,-1)||new En(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=lg[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in lg)throw new RangeError("Duplicate use of selection JSON ID "+t);return lg[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ye.between(this.$anchor,this.$head).getBookmark()}}Ee.prototype.visible=!0;class QU{constructor(t,n){this.$from=t,this.$to=n}}let yx=!1;function bx(e){!yx&&!e.parent.inlineContent&&(yx=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ye extends Ee{constructor(t,n=t){bx(t),bx(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ee.near(r);let o=t.resolve(n.map(this.anchor));return new ye(o.parent.inlineContent?o:r,r)}replace(t,n=J.empty){if(super.replace(t,n),n==J.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ye&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Uh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ye(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ee.findFrom(n,r,!0)||Ee.findFrom(n,-r,!0);if(i)n=i.$head;else return Ee.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(Ee.findFrom(t,-r,!0)||Ee.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=o<0&&(t=n))),new ye(t,n)}}Ee.jsonID("text",ye);class Uh{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Uh(t.map(this.anchor),t.map(this.head))}resolve(t){return ye.between(t.resolve(this.anchor),t.resolve(this.head))}}class he extends Ee{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?Ee.near(i):new he(i)}content(){return new J(B.from(this.node),0,0)}eq(t){return t instanceof he&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Y0(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new he(t.resolve(n.anchor))}static create(t,n){return new he(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}he.prototype.visible=!1;Ee.jsonID("node",he);class Y0{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Uh(r,r):new Y0(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&he.isSelectable(r)?new he(n):Ee.near(n)}}class En extends Ee{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=J.empty){if(n==J.empty){t.delete(0,t.doc.content.size);let r=Ee.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new En(t)}map(t){return new En(t)}eq(t){return t instanceof En}getBookmark(){return e9}}Ee.jsonID("all",En);const e9={map(){return this},resolve(e){return new En(e)}};function ua(e,t,n,r,o,i=!1){if(t.inlineContent)return ye.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&he.isSelectable(a))return he.create(e,n-(o<0?a.nodeSize:0))}else{let l=ua(e,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function xx(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof Jt||o instanceof St))return;let i=e.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),e.setSelection(Ee.near(e.doc.resolve(s),n))}const wx=1,Sx=2,Cx=4;class t9 extends ZU{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|wx)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&wx)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Sx,this}ensureMarks(t){return Pe.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Sx)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Pe.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection(Ee.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Cx,this}get scrolledIntoView(){return(this.updated&Cx)>0}}function Ex(e,t){return!t||!e?e:e.bind(t)}class Yl{constructor(t,n,r){this.name=t,this.init=Ex(n.init,r),this.apply=Ex(n.apply,r)}}const n9=[new Yl("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Yl("selection",{init(e,t){return e.selection||Ee.atStart(t.doc)},apply(e){return e.selection}}),new Yl("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Yl("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class cg{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=n9.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Yl(r.key,r.spec.state,r))})}}class hs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new hs(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new t9(this)}static create(t){let n=new cg(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new hs(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}reconfigure(t){let n=new cg(this.schema,t.plugins),r=n.fields,o=new hs(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(t,o)}return o}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new cg(t.schema,t.plugins),i=new hs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ci.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=Ee.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function IT(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=IT(o,t,{})),n[r]=o}return n}class Wi{constructor(t){this.spec=t,this.props={},t.props&&IT(t.props,this,this.props),this.key=t.key?t.key.key:NT("plugin")}getState(t){return t[this.key]}}const ug=Object.create(null);function NT(e){return e in ug?e+"$"+ ++ug[e]:(ug[e]=0,e+"$")}class pl{constructor(t="key"){this.key=NT(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function PT(){return typeof document<"u"?document:null}const r9={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},o9={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},i9={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},s9={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},a9={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},l9={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},c9={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},u9={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var Ni=Object.freeze({__proto__:null,COPY_DESCRIPTION:o9,COPY_LABEL:r9,CUT_DESCRIPTION:s9,CUT_LABEL:i9,PASTE_DESCRIPTION:l9,PASTE_LABEL:a9,SELECT_ALL_DESCRIPTION:u9,SELECT_ALL_LABEL:c9});const d9={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},f9={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var kx=Object.freeze({__proto__:null,DESCRIPTION:f9,LABEL:d9});const h9={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},p9={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var g9=Object.freeze({__proto__:null,DESCRIPTION:p9,LABEL:h9});const m9={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},v9={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},y9={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},b9={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Af=Object.freeze({__proto__:null,REDO_DESCRIPTION:b9,REDO_LABEL:y9,UNDO_DESCRIPTION:v9,UNDO_LABEL:m9});const x9={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},w9={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var Ox=Object.freeze({__proto__:null,DESCRIPTION:w9,LABEL:x9});const S9={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},C9={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},E9={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var X0=Object.freeze({__proto__:null,BULLET_LIST_LABEL:C9,ORDERED_LIST_LABEL:S9,TASK_LIST_LABEL:E9});const k9={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},O9={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},T9={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},_9={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Lf=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:_9,CONVERT_LABEL:T9,INSERT_DESCRIPTION:O9,INSERT_LABEL:k9});class Nr{constructor(t,n,r={}){this.match=t,this.match=t,this.handler=typeof n=="string"?M9(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1}}function M9(e){return function(t,n,r,o){let i=e;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}}const D9=500;function R9({rules:e}){let t=new Wi({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return Tx(n,r,o,i,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&Tx(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function Tx(e,t,n,r,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t),l=a.parent.textBetween(Math.max(0,a.parentOffset-D9),a.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c];if(a.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode==="only")continue;let d=u.match.exec(l),f=d&&u.handler(s,d,t-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:t,to:n,text:r}),e.dispatch(f),!0}return!1}const I9=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let o=n[r],i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let s=e.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};new Nr(/--$/,"—");new Nr(/\.\.\.$/,"…");new Nr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new Nr(/"$/,"”");new Nr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new Nr(/'$/,"’");function J0(e,t,n=null,r){return new Nr(e,(o,i,s,a)=>{let l=n instanceof Function?n(i):n,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&K0(d,t,l);if(!f)return null;c.wrap(d,f);let h=c.doc.resolve(s-1).nodeBefore;return h&&h.type==t&&Ou(c.doc,s-1)&&(!r||r(i,h))&&c.join(s-1),c})}const Ft=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Wc=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let qm=null;const po=function(e,t,n){let r=qm||(qm=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},N9=function(){qm=null},Rs=function(e,t,n,r){return n&&(_x(e,t,n,r,-1)||_x(e,t,n,r,1))},P9=/^(img|br|input|textarea|hr)$/i;function _x(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:qr(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Tu(e)||P9.test(e.nodeName)||e.contentEditable=="false")return!1;t=Ft(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?qr(e):0}else return!1}}function qr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function A9(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=qr(e)}else if(e.parentNode&&!Tu(e))t=Ft(e),e=e.parentNode;else return null}}function L9(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Tu(e))t=Ft(e)+1,e=e.parentNode;else return null}}function j9(e,t,n){for(let r=t==0,o=t==qr(e);r||o;){if(e==n)return!0;let i=Ft(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==qr(e)}}function Tu(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const qh=function(e){return e.focusNode&&Rs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function cs(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function $9(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function z9(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Zr=typeof navigator<"u"?navigator:null,Mx=typeof document<"u"?document:null,Ui=Zr&&Zr.userAgent||"",Km=/Edge\/(\d+)/.exec(Ui),AT=/MSIE \d/.exec(Ui),Gm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ui),kn=!!(AT||Gm||Km),Ei=AT?document.documentMode:Gm?+Gm[1]:Km?+Km[1]:0,Dr=!kn&&/gecko\/(\d+)/i.test(Ui);Dr&&+(/Firefox\/(\d+)/.exec(Ui)||[0,0])[1];const Ym=!kn&&/Chrome\/(\d+)/.exec(Ui),Zt=!!Ym,LT=Ym?+Ym[1]:0,un=!kn&&!!Zr&&/Apple Computer/.test(Zr.vendor),Ga=un&&(/Mobile\/\w+/.test(Ui)||!!Zr&&Zr.maxTouchPoints>2),Yn=Ga||(Zr?/Mac/.test(Zr.platform):!1),B9=Zr?/Win/.test(Zr.platform):!1,br=/Android \d/.test(Ui),_u=!!Mx&&"webkitFontSmoothing"in Mx.documentElement.style,F9=_u?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function H9(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function so(e,t){return typeof e=="number"?e:e[t]}function V9(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Dx(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Wc(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?H9(i):V9(a),u=0,d=0;if(t.top<c.top+so(r,"top")?d=-(c.top-t.top+so(o,"top")):t.bottom>c.bottom-so(r,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+so(o,"top")-c.top:t.bottom-c.bottom+so(o,"bottom")),t.left<c.left+so(r,"left")?u=-(c.left-t.left+so(o,"left")):t.right>c.right-so(r,"right")&&(u=t.right-c.right+so(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let p=a.scrollLeft-f,g=a.scrollTop-h;t={left:t.left-p,top:t.top-g,right:t.right-p,bottom:t.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function W9(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(i,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:jT(e.dom)}}function jT(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Wc(r));return t}function U9({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;$T(n,r==0?0:r-t)}function $T(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let na=null;function q9(e){if(e.setActive)return e.setActive();if(na)return e.focus(na);let t=jT(e);e.focus(na==null?{get preventScroll(){return na={preventScroll:!0},!0}}:void 0),na||(na=!1,$T(t,0))}function zT(e,t){let n,r=2e8,o,i=0,s=t.top,a=t.top,l,c;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=po(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let g=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&g&&(i=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?K9(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:zT(n,o)}function K9(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=Qo(r,1);if(i.top!=i.bottom&&Z0(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Z0(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function G9(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Y9(e,t,n){let{node:r,offset:o}=zT(t,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function X9(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function BT(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=e.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Z0(t,c))return BT(s,t,c)}}if((i=(i+1)%r)==o)break}return e}function J9(e,t){let n=e.dom.ownerDocument,r,o=0,i=z9(n,t.left,t.top);i&&({node:r,offset:o}=i);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=e.dom.getBoundingClientRect();if(!Z0(t,c)||(s=BT(e.dom,t,c),!s))return null}if(un)for(let c=s;r&&c;c=Wc(c))c.draggable&&(r=void 0);if(s=G9(s,t),r){if(Dr&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&o++}let c;_u&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=X9(e,r,o,t))}a==null&&(a=Y9(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Rx(e){return e.top<e.bottom||e.left<e.right}function Qo(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(Rx(r))return r}return Array.prototype.find.call(n,Rx)||e.getBoundingClientRect()}const Z9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function FT(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=_u||Dr;if(r.nodeType==3)if(s&&(Z9.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Qo(po(r,o,o),n);if(Dr&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Qo(po(r,o-1,o-1),-1);if(c.top==l.top){let u=Qo(po(r,o,o+1),-1);if(u.top!=l.top)return Pl(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Pl(Qo(po(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==qr(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return dg(l.getBoundingClientRect(),!1)}if(i==null&&o<qr(r)){let l=r.childNodes[o];if(l.nodeType==1)return dg(l.getBoundingClientRect(),!0)}return dg(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==qr(r))){let l=r.childNodes[o-1],c=l.nodeType==3?po(l,qr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Pl(Qo(c,1),!1)}if(i==null&&o<qr(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?po(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Pl(Qo(c,-1),!0)}return Pl(Qo(r.nodeType==3?po(r):r,-n),n>=0)}function Pl(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function dg(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function HT(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function Q9(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return HT(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=FT(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=po(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const e8=/[\u0590-\u08ac]/;function t8(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return!e8.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:HT(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:g}=e.domSelectionRange(),m=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),m})}let Ix=null,Nx=null,Px=!1;function n8(e,t,n){return Ix==t&&Nx==n?Px:(Ix=t,Nx=n,Px=n=="up"||n=="down"?Q9(e,t,n):t8(e,t,n))}const Qn=0,Ax=1,ps=2,Qr=3;class Mu{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Qn,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let i,s;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>Ft(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>t||s instanceof WT){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof VT&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ft(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Ft(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&t<=c){let u=s+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Ft(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Ft(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let i=Math.min(t,n),s=Math.max(t,n);for(let f=0,h=0;f<this.children.length;f++){let p=this.children[f],g=h+p.size;if(i>h&&s<g)return p.setSelection(t-h-p.border,n-h-p.border,r,o);h=g}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((Dr||un)&&t==n){let{node:f,offset:h}=a;if(f.nodeType==3){if(u=!!(h&&f.nodeValue[h-1]==`
119
+ `),u&&h==f.nodeValue.length)for(let p=f,g;p;p=p.parentNode){if(g=p.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:Ft(g)+1});break}let m=p.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let p=f.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(Dr&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&un)&&Rs(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Rs(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||t==n)&&!u){c.collapse(a.node,a.offset);try{t!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(t>n){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+i.border,l=s-i.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?ps:Ax,t==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Qr:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ps:Qr}r=s}this.dirty=ps}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ps:Ax;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class VT extends Mu{constructor(t,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Qn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class r8 extends Mu{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Is extends Mu{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Mo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Is(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Qr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Qr&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Qn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Qn}}slice(t,n,r){let o=Is.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Zm(i,n,s,r)),t>0&&(i=Zm(i,0,t,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}}class ki extends Mu{constructor(t,n,r,o,i,s,a,l,c){super(t,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(t,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Mo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=KT(u,r,n),c?l=new o8(t,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Kh(t,n,r,o,u,f,i):new ki(t,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>B.empty)}return t}matchesNode(t,n,r){return this.dirty==Qn&&t.eq(this.node)&&Jm(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new s8(this,s&&s.node,t);c8(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Pe.none:this.node.child(u).marks,r,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,t);let h;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to<o+c.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,h,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],r,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ps)&&(s&&this.protectLocalComposition(t,s),UT(this.contentDOM,this.children,t),Ga&&u8(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof ye)||r<n||o>n+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=d8(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new r8(this,i,n,o);t.input.compositionNodes.push(s),this.children=Zm(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==Qr||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Qn}updateOuterDeco(t){if(Jm(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=qT(this.dom,this.nodeDOM,Xm(this.outerDeco,this.node,n),Xm(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Lx(e,t,n,r,o){KT(r,t,e);let i=new ki(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Kh extends ki{constructor(t,n,r,o,i,s,a){super(t,n,r,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==Qr||this.dirty!=Qn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Qn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Qn,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new Kh(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Qr)}get domAtom(){return!1}isText(t){return this.node.text==t}}class WT extends Mu{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Qn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class o8 extends ki{constructor(t,n,r,o,i,s,a,l,c,u){super(t,n,r,o,i,s,a,c,u),this.spec=l}update(t,n,r,o){if(this.dirty==Qr)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function UT(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=jx(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Is){let l=r?r.previousSibling:e.lastChild;UT(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=jx(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Ec=function(e){e&&(this.nodeName=e)};Ec.prototype=Object.create(null);const gs=[new Ec];function Xm(e,t,n){if(e.length==0)return gs;let r=n?gs[0]:new Ec,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Ec(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Ec(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function qT(e,t,n,r){if(n==gs&&r==gs)return t;let o=t;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=e&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=gs[0]),o=l}i8(o,a||gs[0],s)}return o}function i8(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.add(o[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function KT(e,t,n){return qT(e,e,gs,Xm(t,n,e.nodeType!=1))}function Jm(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function jx(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class s8{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=a8(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Qn,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(t[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Is.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,o,i){let s=this.top.children[o];return s.dirty==Qr&&s.dom==s.contentDOM&&(s.dirty=ps),s.update(t,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ki){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=Qr&&Jm(n,l.outerDeco));if(!f&&l.update(t,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,t,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ps,d.updateChildren(o,s+1),d.dirty=Qn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,i,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let a=ki.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,o,i){let s=ki.create(this.top,t,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new VT(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Is;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Kh)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((un||Zt)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new WT(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function a8(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Is)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function l8(e,t){return e.type.side-t.type.side}function c8(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,o,t.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let m=o[s++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(l8);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<e.childCount)h=c,f=e.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=i&&a.splice(m--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+f.nodeSize;if(f.isText){let m=p;s<o.length&&o[s].from<m&&(m=o[s].from);for(let b=0;b<a.length;b++)a[b].to<m&&(m=a[b].to);m<p&&(l=f.cut(m-i),f=f.cut(0,m-i),p=m,h=-1)}else for(;s<o.length&&o[s].to<p;)s++;let g=f.isInline&&!f.isLeaf?a.filter(m=>!m.inline):a.slice();r(f,g,t.forChild(i,f),h),i=p}}function u8(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function d8(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function Zm(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Q0(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(qh(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&he.isSelectable(u)&&o.parent&&!(u.isInline&&j9(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new he(s==d?a:r.resolve(d))}}else{let u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head<a.pos&&!i?1:-1;c=ey(e,l,a,u)}return c}function GT(e){return e.editable?e.hasFocus():XT(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function yo(e,t=!1){let n=e.state.selection;if(YT(e,n),!!GT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Zt){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Rs(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)h8(e);else{let{anchor:r,head:o}=n,i,s;$x&&!(n instanceof ye)&&(n.$from.parent.inlineContent||(i=zx(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=zx(e,n.to))),e.docView.setSelection(r,o,e.root,t),$x&&(i&&Bx(i),s&&Bx(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&f8(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const $x=un||Zt&&LT<63;function zx(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(un&&o&&o.contentEditable=="false")return fg(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return fg(o);if(i)return fg(i)}}function fg(e){return e.contentEditable="true",un&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Bx(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function f8(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!GT(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function h8(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,Ft(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&kn&&Ei<=11&&(r.disabled=!0,r.disabled=!1)}function YT(e,t){if(t instanceof he){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Fx(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Fx(e)}function Fx(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ey(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||ye.between(t,n,r)}function Hx(e){return e.editable&&!e.hasFocus()?!1:XT(e)}function XT(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function p8(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Rs(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Qm(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Ee.findFrom(i,t)}function ii(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Vx(e,t,n){let r=e.state.selection;if(r instanceof ye)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return ii(e,new ye(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=Qm(e.state,t);return o&&o instanceof he?ii(e,o):!1}else if(!(Yn&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?he.isSelectable(i)?ii(e,new he(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):_u?ii(e,new ye(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return ii(e,new ye(t>0?r.$to:r.$from));{let o=Qm(e.state,t);return o?ii(e,o):!1}}}function jf(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function kc(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ra(e,t){return t<0?g8(e):m8(e)}function g8(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Dr&&n.nodeType==1&&r<jf(n)&&kc(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(kc(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(JT(n))break;{let a=n.previousSibling;for(;a&&kc(a,-1);)o=n.parentNode,i=Ft(a),a=a.previousSibling;if(a)n=a,r=jf(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?ev(e,n,r):o&&ev(e,o,i)}function m8(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=jf(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(kc(a,1))i=n,s=++r;else break}else{if(JT(n))break;{let a=n.nextSibling;for(;a&&kc(a,1);)i=a.parentNode,s=Ft(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=jf(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&ev(e,i,s)}function JT(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function v8(e,t){for(;e&&t==e.childNodes.length&&!Tu(e);)t=Ft(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function y8(e,t){for(;e&&!t&&!Tu(e);)t=Ft(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function ev(e,t,n){if(t.nodeType!=3){let i,s;(s=v8(t,n))?(t=s,n=0):(i=y8(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(qh(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&yo(e)},50)}function Wx(e,t){let n=e.state.doc.resolve(t);if(!(Zt||B9)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Ux(e,t,n){let r=e.state.selection;if(r instanceof ye&&!r.empty||n.indexOf("s")>-1||Yn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Qm(e.state,t);if(s&&s instanceof he)return ii(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=r instanceof En?Ee.near(s,t):Ee.findFrom(s,t);return a?ii(e,a):!1}return!1}function qx(e,t){if(!(e.state.selection instanceof ye))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Kx(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function b8(e){if(!un||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Kx(e,r,"true"),setTimeout(()=>Kx(e,r,"false"),20)}return!1}function x8(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function w8(e,t){let n=t.keyCode,r=x8(t);if(n==8||Yn&&n==72&&r=="c")return qx(e,-1)||ra(e,-1);if(n==46&&!t.shiftKey||Yn&&n==68&&r=="c")return qx(e,1)||ra(e,1);if(n==13||n==27)return!0;if(n==37||Yn&&n==66&&r=="c"){let o=n==37?Wx(e,e.state.selection.from)=="ltr"?-1:1:-1;return Vx(e,o,r)||ra(e,o)}else if(n==39||Yn&&n==70&&r=="c"){let o=n==39?Wx(e,e.state.selection.from)=="ltr"?1:-1:1;return Vx(e,o,r)||ra(e,o)}else{if(n==38||Yn&&n==80&&r=="c")return Ux(e,-1,r)||ra(e,-1);if(n==40||Yn&&n==78&&r=="c")return b8(e)||Ux(e,1,r)||ra(e,1);if(r==(Yn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ZT(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||Mo.fromSchema(e.state.schema),a=o_(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=r_[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
120
+
121
+ `);return{dom:l,text:f,slice:t}}function QT(e,t,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||i||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||r,e)}),i)return t?new J(B.from(e.state.schema.text(t.replace(/\r\n?/g,`
122
+ `))),0,0):J.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,r,e));if(d)a=d;else{let f=o.marks(),{schema:h}=e.state,p=Mo.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),s=E8(n),_u&&k8(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Ua.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!S8.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=O8(Gx(a,+u[1],+u[2]),u[4]);else if(a=J.maxOpen(C8(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=Gx(a,d,f)}return e.someProp("transformPasted",d=>{a=d(a,e)}),a}const S8=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function C8(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&t_(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=n_(s[s.length-1],i.length));let u=e_(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return B.from(s)}return e}function e_(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,B.from(e));return e}function t_(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=t_(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(B.from(e_(n,e,o+1))))}}function n_(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,n_(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(B.empty,!0);return e.copy(n.append(r))}function tv(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=tv(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(B.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Gx(e,t,n){return t<e.openStart&&(e=new J(tv(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new J(tv(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const r_={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Yx=null;function o_(){return Yx||(Yx=document.implementation.createHTMLDocument("title"))}function E8(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=o_().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&r_[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=e,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function k8(e){let t=e.querySelectorAll(Zt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function O8(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:o,openStart:i,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=B.from(l.create(r[a+1],o)),i++,s++}return new J(o,i,s)}const dn={},fn={},T8={touchstart:!0,touchmove:!0};class _8{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function M8(e){for(let t in dn){let n=dn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{R8(e,r)&&!ty(e,r)&&(e.editable||!(r.type in fn))&&n(e,r)},T8[t]?{passive:!0}:void 0)}un&&e.dom.addEventListener("input",()=>null),nv(e)}function gi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function D8(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function nv(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>ty(e,r))})}function ty(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function R8(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function I8(e,t){!ty(e,t)&&dn[t.type]&&(e.editable||!(t.type in fn))&&dn[t.type](e,t)}fn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!s_(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(br&&Zt&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ga&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,cs(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||w8(e,n)?n.preventDefault():gi(e,"key")};fn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};fn.keypress=(e,t)=>{let n=t;if(s_(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yn&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ye)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Gh(e){return{left:e.clientX,top:e.clientY}}function N8(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ny(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),o,!0):a(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function _a(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function P8(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(_a(e,new he(n)),!0):!1}function A8(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof he&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(he.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(_a(e,he.create(e.state.doc,o)),!0):!1}function L8(e,t,n,r,o){return ny(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?A8(e,n):P8(e,n))}function j8(e,t,n,r){return ny(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function $8(e,t,n,r){return ny(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||z8(e,n,r)}function z8(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(_a(e,ye.create(r,0,r.content.size)),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)_a(e,ye.create(r,a+1,a+1+s.content.size));else if(he.isSelectable(s))_a(e,he.create(r,a));else continue;return!0}}function ry(e){return $f(e)}const i_=Yn?"metaKey":"ctrlKey";dn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ry(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&N8(n,e.input.lastClick)&&!n[i_]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(Gh(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new B8(e,s,n,!!r)):(i=="doubleClick"?j8:$8)(e,s.pos,s.inside,n)?n.preventDefault():gi(e,"pointer"))};class B8{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[i_],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof he&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Dr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),gi(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>yo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Gh(t))),this.updateAllowDefault(t),this.allowDefault||!n?gi(this.view,"pointer"):L8(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||un&&this.mightDrag&&!this.mightDrag.node.isAtom||Zt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(_a(this.view,Ee.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):gi(this.view,"pointer")}move(t){this.updateAllowDefault(t),gi(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}dn.touchstart=e=>{e.input.lastTouch=Date.now(),ry(e),gi(e,"pointer")};dn.touchmove=e=>{e.input.lastTouch=Date.now(),gi(e,"pointer")};dn.contextmenu=e=>ry(e);function s_(e,t){return e.composing?!0:un&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const F8=br?5e3:-1;fn.compositionstart=fn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),$f(e,!0),e.markCursor=null;else if($f(e),Dr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}a_(e,F8)};fn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,a_(e,20))};function a_(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>$f(e),t))}function l_(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=V8());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function H8(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=A9(t.focusNode,t.focusOffset),r=L9(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function V8(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function $f(e,t=!1){if(!(br&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),l_(e),t||e.docView&&e.docView.dirty){let n=Q0(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function W8(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Uc=kn&&Ei<15||Ga&&F9<604;dn.copy=fn.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=Uc?null:n.clipboardData,s=r.content(),{dom:a,text:l}=ZT(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):W8(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function U8(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function q8(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?qc(e,r.value,null,o,t):qc(e,r.textContent,r.innerHTML,o,t)},50)}function qc(e,t,n,r,o){let i=QT(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||J.empty)))return!0;if(!i)return!1;let s=U8(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function c_(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}fn.paste=(e,t)=>{let n=t;if(e.composing&&!br)return;let r=Uc?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&qc(e,c_(r),r.getData("text/html"),o,n)?n.preventDefault():q8(e,n)};class u_{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const d_=Yn?"altKey":"ctrlKey";dn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Gh(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof he?o.to-1:o.to))){if(r&&r.mightDrag)s=he.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(s=he.create(e.state.doc,d.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:c,slice:u}=ZT(e,a);(!n.dataTransfer.files.length||!Zt||LT>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Uc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Uc||n.dataTransfer.setData("text/plain",c),e.dragging=new u_(u,!n[d_],s)};dn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};fn.dragover=fn.dragenter=(e,t)=>t.preventDefault();fn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(Gh(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",p=>{s=p(s,e)}):s=QT(e,c_(n.dataTransfer),Uc?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[d_]);if(e.someProp("handleDrop",p=>p(e,n,s||J.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?UU(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;if(a){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&he.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new he(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,b,y)=>p=y),c.setSelection(ey(e,h,c.doc.resolve(p)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};dn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&yo(e)},20))};dn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};dn.beforeinput=(e,t)=>{if(Zt&&br&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,cs(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in fn)dn[e]=fn[e];function Kc(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class zf{constructor(t,n){this.toDOM=t,this.spec=n||Ss,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Ye(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof zf&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Kc(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Oi{constructor(t,n){this.attrs=t,this.spec=n||Ss}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Ye(i,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Oi&&Kc(this.attrs,t.attrs)&&Kc(this.spec,t.spec)}static is(t){return t.type instanceof Oi}destroy(){}}class oy{constructor(t,n){this.attrs=t,this.spec=n||Ss}map(t,n,r,o){let i=t.mapResult(n.from+o,1);if(i.deleted)return null;let s=t.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Ye(i.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),i;return o==n.from&&!(i=t.child(r)).isText&&o+i.nodeSize==n.to}eq(t){return this==t||t instanceof oy&&Kc(this.attrs,t.attrs)&&Kc(this.spec,t.spec)}destroy(){}}class Ye{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Ye(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Ye(t,t,new zf(n,r))}static inline(t,n,r,o){return new Ye(t,n,new Oi(r,o))}static node(t,n,r,o){return new Ye(t,n,new oy(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Oi}get widget(){return this.type instanceof zf}}const da=[],Ss={};class Re{constructor(t,n){this.local=t.length?t:da,this.children=n.length?n:da}static create(t,n){return n.length?Bf(n,t,0,Ss):Gt}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,o+a,i)}}map(t,n,r){return this==Gt||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ss)}mapInner(t,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?K8(this.children,s||[],t,n,r,o,i):s?new Re(s.sort(Cs),da):Gt}add(t,n){return n.length?this==Gt?Re.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((a,l)=>{let c=l+r,u;if(u=h_(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Bf(u,a,c+1,Ss)),i+=3}});let s=f_(i?p_(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new Re(s.length?this.local.concat(s).sort(Cs):this.local,o||this.children)}remove(t){return t.length==0||this==Gt?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<t.length;u++)(d=t[u])&&d.from>a&&d.to<l&&(t[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Gt?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Re(o,r):Gt}forChild(t,n){if(this==Gt)return this;if(n.isLeaf)return Re.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Oi){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Re(o.sort(Cs),da);return r?new ui([a,r]):a}return r||Gt}eq(t){if(this==t)return!0;if(!(t instanceof Re)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return iy(this.localsInner(t))}localsInner(t){if(this==Gt)return da;if(t.inlineContent||!this.local.some(Oi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Oi||n.push(this.local[r]);return n}}Re.empty=new Re([],[]);Re.removeOverlap=iy;const Gt=Re.empty;class ui{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,Ss));return ui.from(r)}forChild(t,n){if(n.isLeaf)return Re.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=Gt&&(i instanceof ui?r=r.concat(i.members):r.push(i))}return ui.from(r)}eq(t){if(!(t instanceof ui)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?iy(r?n:n.sort(Cs)):da}static from(t){switch(t.length){case 0:return Gt;case 1:return t[0];default:return new ui(t.every(n=>n instanceof Re)?t:t.reduce((n,r)=>n.concat(r instanceof Re?r:r.members),[]))}}}function K8(e,t,n,r,o,i,s){let a=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,g)=>{let m=g-p-(h-f);for(let b=0;b<a.length;b+=3){let y=a[b+1];if(y<0||f>y+u-d)continue;let w=a[b]+u-d;h>=w?a[b+1]=f<=w?-2:-1:f>=u&&m&&(a[b]+=m,a[b+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(e[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(e[c+1]+i,-1),h=f-o,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==h){let b=a[c+2].mapInner(n,m,u+1,e[c]+i+1,s);b!=Gt?(a[c]=d,a[c+1]=h,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=G8(a,e,t,n,o,i,s),u=Bf(c,r,0,s);t=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Re(t.sort(Cs),a)}function f_(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new Ye(o.from+t,o.to+t,o.type))}return n}function G8(e,t,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+i+1);return n}function h_(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i=0,s;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function p_(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Bf(e,t,n,r){let o=[],i=!1;t.forEach((a,l)=>{let c=h_(e,a,l+n);if(c){i=!0;let u=Bf(c,a,n+l+1,r);u!=Gt&&o.push(l,l+a.nodeSize,u)}});let s=f_(i?p_(e):e,-n).sort(Cs);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Re(s,o):Gt}function Cs(e,t){return e.from-t.from||e.to-t.to}function iy(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Xx(t,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Xx(t,o,r.copy(i.from,r.to)));break}}}return t}function Xx(e,t,n){for(;t<e.length&&Cs(n,e[t])>0;)t++;e.splice(t,0,n)}function hg(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Gt&&t.push(r)}),e.cursorWrapper&&t.push(Re.create(e.state.doc,[e.cursorWrapper.deco])),ui.from(t)}const Y8={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X8=kn&&Ei<=11;class J8{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Z8{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new J8,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);kn&&Ei<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),X8&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Y8)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Hx(this.view)){if(this.suppressingSelectionUpdates)return yo(this.view);if(kn&&Ei<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Rs(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Wc(i))n.add(i);for(let i=t.anchorNode;i;i=Wc(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Hx(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(Dr&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||t7(t,d)!=h)&&f.remove()}}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&qh(r)&&(c=Q0(t))&&c.eq(Ee.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,yo(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),Q8(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||yo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++){let d=t.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,i=t.nextSibling;if(kn&&Ei<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=t.addedNodes[u];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==t.target?Ft(o)+1:0,a=r.localPosFromDOM(t.target,s,-1),l=i&&i.parentNode==t.target?Ft(i):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Jx=new WeakMap,Zx=!1;function Q8(e){if(!Jx.has(e)&&(Jx.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Dr,Zx)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Zx=!0}}function Qx(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Rs(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function e7(e,t){if(t.getComposedRanges){let o=t.getComposedRanges(e.root)[0];if(o)return Qx(e,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Qx(e,n):null}function t7(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function n7(e,t,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c,u=l.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],qh(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Zt&&e.input.lastKeyCode===8)for(let m=i;m>o;m--){let b=r.childNodes[m-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){i=m;break}if(!y||y.size)break}let d=e.state.doc,f=e.someProp("domParser")||Ua.fromSchema(e.state.schema),h=d.resolve(s),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:r7,context:h});if(c&&c[0].pos!=null){let m=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=m),p={anchor:m+s,head:b+s}}return{doc:g,sel:p,from:s,to:a}}function r7(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(un&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||un&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const o7=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function i7(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let T=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,D=Q0(e,T);if(D&&!e.state.selection.eq(D)){if(Zt&&br&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",M=>M(e,cs(13,"Enter"))))return;let O=e.state.tr.setSelection(D);T=="pointer"?O.setMeta("pointer",!0):T=="key"&&O.scrollIntoView(),i&&O.setMeta("composition",i),e.dispatch(O)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,c=n7(e,t,n),u=e.state.doc,d=u.slice(c.from,c.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let p=l7(d.content,c.doc.content,c.from,f,h);if((Ga&&e.input.lastIOSEnter>Date.now()-225||br)&&o.some(T=>T.nodeType==1&&!o7.test(T.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",T=>T(e,cs(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof ye&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let T=ew(e,e.state.doc,c.sel);if(T&&!T.eq(e.state.selection)){let D=e.state.tr.setSelection(T);i&&D.setMeta("composition",i),e.dispatch(D)}}return}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof ye&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),kn&&Ei<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),b=u.resolve(p.start),y=g.sameParent(m)&&g.parent.inlineContent&&b.end()>=p.endA,w;if((Ga&&e.input.lastIOSEnter>Date.now()-225&&(!y||o.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!y&&g.pos<c.doc.content.size&&!g.sameParent(m)&&(w=Ee.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==m.pos)&&e.someProp("handleKeyDown",T=>T(e,cs(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&a7(u,p.start,p.endA,g,m)&&e.someProp("handleKeyDown",T=>T(e,cs(8,"Backspace")))){br&&Zt&&e.domObserver.suppressSelectionUpdates();return}Zt&&br&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),br&&!y&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(T){return T(e,cs(13,"Enter"))})},20));let S=p.start,C=p.endA,E,k,_;if(y){if(g.pos==m.pos)kn&&Ei<=11&&g.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>yo(e),20)),E=e.state.tr.delete(S,C),k=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(_=s7(g.parent.content.cut(g.parentOffset,m.parentOffset),b.parent.content.cut(b.parentOffset,p.endA-b.start()))))E=e.state.tr,_.type=="add"?E.addMark(S,C,_.mark):E.removeMark(S,C,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let T=g.parent.textBetween(g.parentOffset,m.parentOffset);if(e.someProp("handleTextInput",D=>D(e,S,C,T)))return;E=e.state.tr.insertText(T,S,C)}}if(E||(E=e.state.tr.replace(S,C,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let T=ew(e,E.doc,c.sel);T&&!(Zt&&br&&e.composing&&T.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(T.head==S||T.head==E.mapping.map(C)-1)||kn&&T.empty&&T.head==S)&&E.setSelection(T)}k&&E.ensureMarks(k),i&&E.setMeta("composition",i),e.dispatch(E.scrollIntoView())}function ew(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ey(e,t.resolve(n.anchor),t.resolve(n.head))}function s7(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(B.from(c).eq(e))return{mark:a,type:s}}function a7(e,t,n,r,o){if(n-t<=o.pos-r.pos||pg(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==t+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(pg(i,!0,!0));return!s.parent.isTextblock||s.pos>n||pg(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function pg(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function l7(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&e.size<t.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<t.size&&tw(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<e.size&&tw(e.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function tw(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class c7{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new _8,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sw),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ow(this),rw(this),this.nodeViews=iw(this),this.docView=Lx(this.state.doc,nw(this),hg(this),this.dom,this),this.domObserver=new Z8(this,(r,o,i,s)=>i7(this,r,o,i,s)),this.domObserver.start(),M8(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&nv(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(sw),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let o=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&(l_(this),s=!0),this.state=t;let a=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=iw(this);d7(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&nv(this),this.editable=ow(this),rw(this);let l=hg(this),c=nw(this),u=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(t.doc,c,l);(d||!t.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&W9(this);if(s){this.domObserver.stop();let h=d&&(kn||Zt)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&u7(o.selection,t.selection);if(d){let p=Zt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=H8(this)),(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Lx(t.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&p8(this))?yo(this,h):(YT(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&U9(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Dx(this,n.getBoundingClientRect(),t)}else Dx(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new u_(t.slice,t.move,o<0?void 0:he.create(this.state.doc,o))}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[t];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(kn){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&q9(this.dom),yo(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return J9(this,t)}coordsAtPos(t,n=1){return FT(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return n8(this,n||this.state,t)}pasteHTML(t,n){return qc(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return qc(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(D8(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,N9())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return I8(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return un&&this.root.nodeType===11&&$9(this.dom.ownerDocument)==this.dom&&e7(this,t)||t}domSelection(){return this.root.getSelection()}}function nw(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Ye.node(0,e.state.doc.content.size,t)]}function rw(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ye.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ow(e){return!e.someProp("editable",t=>t(e.state)===!1)}function u7(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function iw(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function d7(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function sw(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var f7=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const h7=_o(f7);function p7(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function g7(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function m7(e){return!!(!e.prev&&e.next)}function v7(e){return!!(e.prev&&!e.next)}function y7(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function b7(e){return e==="invalid-exit-split"}var x7=["jump-backward-exit","jump-forward-exit"],w7=["jump-backward-change","jump-forward-change"];function S7(e){var t,n;return Jr(x7,(t=e.exit)==null?void 0:t.exitReason)||Jr(w7,(n=e.change)==null?void 0:n.changeReason)}function aw(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function lw(e){return gn(e)&&e instanceof ye}function Cn(e){const{match:t,changeReason:n,exitReason:r}=e;return{...t,changeReason:n,exitReason:r}}function C7(e,t){const{invalidPrefixCharacters:n,validPrefixCharacters:r}=t;return n?!new RegExp(ov(n)).test(e):new RegExp(ov(r)).test(e)}function E7(e){const{text:t,regexp:n,$pos:r,suggester:o}=e,i=r.start();let s;return U0(t,n).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(C7(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ge(u)||!ge(d))return;const f=c+u.length,h=Math.min(f,r.pos),p=h-c;c<r.pos&&f>=r.pos&&(s={range:{from:c,to:f,cursor:h},match:a,query:{partial:u.slice(d.length,p),full:u.slice(d.length)},text:{partial:u.slice(0,p),full:u},textAfter:r.doc.textBetween(f,r.end(),fi,fi),textBefore:r.doc.textBetween(i,c,fi,fi),suggester:o})}}),s}function g_(e){const{$pos:t,suggester:n}=e,{char:r,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=n,d=N7({char:r,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),fi,fi);return E7({suggester:n,text:f,regexp:d,$pos:t})}function m_(e){const{state:t,match:n}=e;try{return g_({$pos:t.doc.resolve(n.range.cursor),suggester:n.suggester})}catch{return}}function v_(e){const{prev:t,next:n,state:r}=e;return!n&&t.range.from>=r.doc.nodeSize?{exit:Cn({match:t,exitReason:"delete"})}:!n||!t.query.partial?{exit:Cn({match:t,exitReason:"invalid-exit-split"})}:t.range.to===n.range.cursor?{exit:Cn({match:n,exitReason:"exit-end"})}:t.query.partial?{exit:Cn({match:n,exitReason:"exit-split"})}:{}}function k7(e){const{prev:t,next:n,state:r}=e,o=le(),i=m_({state:r,match:t}),{exit:s}=i&&i.query.full!==t.query.full?v_({prev:t,next:i,state:r}):o;return t.range.from<n.range.from?{exit:s??Cn({match:t,exitReason:"jump-forward-exit"}),change:Cn({match:n,changeReason:"jump-forward-change"})}:{exit:s??Cn({match:t,exitReason:"jump-backward-exit"}),change:Cn({match:n,changeReason:"jump-backward-change"})}}function O7(e){const{match:t,state:n,$pos:r}=e,{selection:o}=n,i=m_({match:t,state:n});return!i||i.text.full!==t.text.full?v_({prev:t,next:i,state:n}):!o.empty&&(o.from<=t.range.from||o.to>=t.range.to)?{exit:Cn({match:t,exitReason:"selection-outside"})}:r.pos>t.range.to?{exit:Cn({match:t,exitReason:"move-end"})}:r.pos<=t.range.from?{exit:Cn({match:t,exitReason:"move-start"})}:{}}function T7(e){const{prev:t,next:n,state:r,$pos:o}=e,i=le();if(!t&&!n)return i;const s={prev:t,next:n};return y7(s)?k7({prev:s.prev,next:s.next,state:r}):m7(s)?{change:Cn({match:s.next,changeReason:"start"})}:v7(s)?O7({$pos:o,match:s.prev,state:r}):p7(s)?{change:Cn({match:s.next,changeReason:"change-character"})}:g7(s)?{change:Cn({match:s.next,changeReason:r.selection.empty?"move":"selection-inside"})}:i}function cw(e,t){for(let n=e.depth;n>0;n--){const r=e.node(n);if(t.includes(r.type.name))return!0}return!1}function rv(e,t){const{$from:n,$to:r}=e;return y_(e,t)?!0:tT(n.pos,r.pos).some(o=>_7(n.doc.resolve(o),t))}function y_(e,t){const{$from:n,$to:r}=e,o=new Set((n.marksAcross(r)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function _7(e,t){const n=new Set(e.marks().map(r=>r.type.name));return t.some(r=>n.has(r))}function M7(e,t){const{$cursor:n}=t,{validMarks:r,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!r&&!o&&Ii(i)&&Ii(s)?!0:!(r&&!y_(t,r)||o&&!cw(n,o)||!r&&rv(t,i)||!o&&cw(n,s))}function uw(e){const{suggesters:t,$pos:n,selectionEmpty:r}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!r))try{const i=g_({suggester:o,$pos:n});if(!i)continue;const s={$from:n.doc.resolve(i.range.from),$to:n.doc.resolve(i.range.to),$cursor:n};if(M7(o,s)&&o.isValidPosition(s,i))return i}catch{}}function ov(e){return H6(e)?e.source:e}function D7(e){return e?"^":""}function R7(e,t){return`(?:${ov(e)}){${t},}`}function I7(e){return ge(e)?new RegExp(h7(e)):e}function N7(e){const{char:t,matchOffset:n,startOfLine:r,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=I7(t).source;return i&&(u=`(${u})`),new RegExp(`${D7(r)}${u}${R7(o,n)}`,c)}var P7={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},b_="__ignore_prosemirror_suggest_update__",A7=(Ip=class{constructor(e){io(this,Wu,!1),io(this,Ml,!1),io(this,_t),io(this,zo),io(this,Js),io(this,Ar,le()),wn(this,"view"),io(this,mt,Re.empty),io(this,Bo,!1),io(this,Zs,!1),wn(this,"setMarkRemoved",()=>{He(this,Bo,!0)}),wn(this,"findNextTextSelection",n=>{const r=n.$from.doc,o=Math.min(r.nodeSize-2,n.to+1),i=r.resolve(o),s=Ee.findFrom(i,1,!0);if(lw(s))return s}),wn(this,"ignoreNextExit",()=>{He(this,Ml,!0)}),wn(this,"addIgnored",({from:n,name:r,specific:o=!1})=>{const i=xe(this,_t).find(u=>u.name===r);if(!i)throw new Error(`No suggester exists for the name provided: ${r}`);const s=ge(i.char)?i.char.length:1,a=n+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ye.inline(n,a,{nodeName:i.ignoredTag,...l},{name:r,specific:o,char:i.char});He(this,mt,xe(this,mt).add(this.view.state.doc,[c]))}),wn(this,"removeIgnored",({from:n,name:r})=>{const o=xe(this,_t).find(a=>a.name===r);if(!o)throw new Error(`No suggester exists for the name provided: ${r}`);const i=ge(o.char)?o.char.length:1,s=xe(this,mt).find(n,n+i)[0];!s||s.spec.name!==r||He(this,mt,xe(this,mt).remove([s]))}),wn(this,"clearIgnored",n=>{if(!n){He(this,mt,Re.empty);return}const o=xe(this,mt).find().filter(({spec:i})=>i.name===n);He(this,mt,xe(this,mt).remove(o))}),wn(this,"findMatchAtPosition",(n,r)=>{const o=r?xe(this,_t).filter(i=>i.name===r):xe(this,_t);return uw({suggesters:o,$pos:n,selectionEmpty:!0})}),wn(this,"setLastChangeFromAppend",()=>{He(this,Zs,!0)});const t=dw();He(this,_t,e.map(t)),He(this,_t,Va(xe(this,_t),(n,r)=>r.priority-n.priority))}static create(e){return new Ip(e)}get decorationSet(){return xe(this,mt)}get removed(){return xe(this,Bo)}get match(){return xe(this,zo)?xe(this,zo):xe(this,Js)&&xe(this,Ar).exit?xe(this,Js):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:n}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:n,...e}}shouldRunExit(){return xe(this,Ml)?(He(this,Ml,!1),!1):!0}updateWithNextSelection(e){var t,n,r;const o=this.findNextTextSelection(e.selection);if(o)for(const i of xe(this,_t)){const s=(t=xe(this,Ar).change)==null?void 0:t.suggester.name,a=(n=xe(this,Ar).exit)==null?void 0:n.suggester.name;(r=i.checkNextValidSelection)==null||r.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:n,exit:r}=xe(this,Ar),o=this.match;if(!n&&!r||!aw(o))return;const i=t===(r==null?void 0:r.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(n==null?void 0:n.suggester.appendTransaction);if(!(!i&&!s)){if(n&&r&&S7({change:n,exit:r})){const a=this.createProps(r),l=this.createProps(n),c=r.range.from<n.range.from;i&&r.suggester.onChange(a,e),s&&n.suggester.onChange(l,e),i&&He(this,Bo,!1);return}n&&s&&n.suggester.onChange(this.createProps(n),e),r&&i&&(r.suggester.onChange(this.createProps(r),e),He(this,Bo,!1),b7(r.exitReason)&&He(this,Ar,le()))}}mapIgnoredDecorations(e){const t=xe(this,mt).map(e.mapping,e.doc),r=t.find().filter(({from:o,to:i,spec:s})=>{const a=ge(s.char)?s.char.length:1;return i-o!==a});He(this,mt,t.remove(r))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return xe(this,mt).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){He(this,Ar,le()),He(this,zo,void 0),He(this,Bo,!1),He(this,Zs,!1)}updateReasons(e){const{$pos:t,state:n}=e;xe(this,Wu);const r=xe(this,_t),o=n.selection.empty,i=lw(n.selection)?uw({suggesters:r,$pos:t,selectionEmpty:o}):void 0;He(this,zo,i&&this.shouldIgnoreMatch(i)?void 0:i),He(this,Ar,T7({next:xe(this,zo),prev:xe(this,Js),state:n,$pos:t}))}addSuggester(e){const t=xe(this,_t).find(r=>r.name===e.name),n=dw();if(t)He(this,_t,xe(this,_t).map(r=>r===t?n(e):r));else{const r=[...xe(this,_t),n(e)];He(this,_t,Va(r,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ge(e)?e:e.name;He(this,_t,xe(this,_t).filter(n=>n.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:n}=xe(this,Ar);if(xe(this,Zs)&&(He(this,Zs,!1),!(t!=null&&t.suggester.appendTransaction)&&!(n!=null&&n.suggester.appendTransaction)))return this;const{tr:r,state:o}=e,i=r.docChanged||r.selectionSet;return r.getMeta(b_)||!i&&!xe(this,Bo)?this:(He(this,Wu,r.docChanged),this.mapIgnoredDecorations(r),t&&this.resetState(),He(this,Js,xe(this,zo)),this.updateReasons({$pos:r.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!aw(t))return xe(this,mt);const{disableDecorations:n}=t.suggester;if(Xe(n)?n(e,t):n)return xe(this,mt);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?xe(this,mt):xe(this,mt).add(e.doc,[Ye.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},Wu=new WeakMap,Ml=new WeakMap,_t=new WeakMap,zo=new WeakMap,Js=new WeakMap,Ar=new WeakMap,mt=new WeakMap,Bo=new WeakMap,Zs=new WeakMap,Ip);function dw(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const n={...P7,...t};return e.add(t.name),n}}var x_=new pl("suggest");function sy(e){return x_.getState(e)}function fw(e,t){return sy(e).addSuggester(t)}function hw(e){e.setMeta(b_,!0)}function L7(e,t){return sy(e).removeSuggester(t)}function j7(...e){const t=A7.create(e);return new Wi({key:x_,view:n=>(t.init(n),{update:r=>t.changeHandler(r.state.tr,!1)}),state:{init:()=>t,apply:(n,r,o,i)=>t.apply({tr:n,state:i})},appendTransaction:(n,r,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:n=>t.createDecorations(n)}})}function ay(e,t){const n=Object.getPrototypeOf(t);let r=e.selection,o=e.doc,i=e.storedMarks;const s=le();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(n,{...s,storedMarks:{get(){return i}},selection:{get(){return r}},doc:{get(){return o}},tr:{get(){return r=e.selection,o=e.doc,i=e.storedMarks,e}}})}function jd(e){return({state:t,dispatch:n,view:r,tr:o})=>e(ay(o,t),n,r)}function pw(e){return t=>{var n;return fe(t.dispatch===void 0||t.dispatch===((n=t.view)==null?void 0:n.dispatch),{code:K.NON_CHAINABLE_COMMAND}),e(t)}}var Pi={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isIos(){return Pi.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return Pi.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isDevelopment(){return!1}};function qo(e,t){var n;const r=iq(e);return((n=r==null?void 0:r.getComputedStyle(e))==null?void 0:n.getPropertyValue(t))??""}function iv(e){return gn(e)&&nr(e.nodeType)&&ge(e.nodeName)}function On(e){return iv(e)&&e.nodeType===1}function ly(e){const{types:t,node:n}=e;if(!n)return!1;const r=o=>o===n.type||o===n.type.name;return Et(t)?t.some(r):r(t)}function Yh(e){const{predicate:t,selection:n}=e,r=C_(n)?n.selection.$from:uy(n)?n.$from:n;for(let o=r.depth;o>0;o--){const i=r.node(o),s=o>0?r.before(o):0,a=r.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function $7(e){const{depth:t}=e,n=t>0?e.before(t):0,r=e.node(t),o=e.start(t),i=n+r.nodeSize;return{pos:n,start:o,node:r,end:i,depth:t}}function Gc(e){const{types:t,selection:n}=e;return Yh({predicate:r=>ly({types:t,node:r}),selection:n})}function z7(e){const{types:t,selection:n}=e;if(!(!Jh(n)||!ly({types:t,node:n.node})))return{pos:n.$from.pos,depth:n.$from.depth,start:n.$from.start(),end:n.$from.pos+n.node.nodeSize,node:n.node}}function w_(e){return uy(e)?e.empty:e.selection.empty}function B7(e){return e.docChanged||e.selectionSet}function F7(e){return!!Yc(e)}function Yc(e){const{state:t,type:n,attrs:r}=e,{selection:o,doc:i}=t,s=ge(n)?i.type.schema.nodes[n]:n;fe(s,{code:K.SCHEMA,message:`No node exists for ${n}`});const a=z7({selection:o,types:n})??Yh({predicate:l=>l.type===s,selection:o});return!r||Of(r)||!a||a.node.hasMarkup(s,{...a.node.attrs,...r})?a:void 0}function Ff(...e){return t=>{if(!ox(e))return!1;const[n,...r]=e;let o=!1;const i=(...l)=>()=>{if(!ox(l))return!1;o=!0;const[,...c]=l;return Ff(...l)({...t,next:i(...c)})},s=i(...r),a=n({...t,next:s});return o||a?a:s()}}function H7(e,t){const n=new Map,r=le();for(const o of e)for(const[i,s]of wt(o)){const l=[...n.get(i)??[],s],c=Ff(...l);n.set(i,l),r[i]=t(c)}return r}function V7(e){return H7(e,t=>(n,r,o)=>t({state:n,dispatch:r,view:o,tr:n.tr,next:()=>!1}))}function cy(e,t){const n=e.attrs??{};return Object.entries(t).every(([r,o])=>n[r]===o)}function gl(e){return gn(e)}function ml(e,t){return Et(t)?Jr(t,e[Co]):t===e[Co]}function W7(e){return gn(e)&&e instanceof Vm}function U7(e,t){return ge(e)?Qe(t.nodes,e):e}function S_(e){return gn(e)&&e instanceof ku}function q7(e,t){return ge(e)?Qe(t.marks,e):e}function Xh(e){return gn(e)&&e instanceof Ci}function K7(e){return gn(e)&&e instanceof B}function G7(e){return gn(e)&&e instanceof Pe}function C_(e){return gn(e)&&e instanceof hs}function vl(e){return gn(e)&&e instanceof ye}function uy(e){return gn(e)&&e instanceof Ee}function Y7(e){return gn(e)&&e instanceof Wa}function gw(e){const{trState:t,from:n,to:r,type:o,attrs:i={}}=e,{doc:s}=t,a=q7(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(n,r,a);let l=!1;return r>n&&s.nodesBetween(n,r,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:cy(d,i)),!l)),l}function Jh(e){return gn(e)&&e instanceof he}function E_(e){const{trState:t,type:n,attrs:r={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ge(n)?a.type.schema.marks[n]:n;if(fe(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&gw({...e,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(d=>d.type!==n?!1:cy(d,r??{})):gw({...e,from:s.from,to:s.to})}function dy(e,t={}){const n=X7(e.type.schema);if(!n)return!1;const{ignoreAttributes:r,ignoreDocAttributes:o}=t;return r?k_(n,e):o?n.content.eq(e.content):n.eq(e)}function k_(e,t){if(e===t)return!0;const n=e.type===t.type&&Pe.sameSet(e.marks,t.marks);function r(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!k_(a,l))return!1}return!0}return n&&r()}function X7(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Zh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;fe(!1,{code:K.SCHEMA,message:"No default block node found for the provided schema."})}function J7(e){return e.type===Zh(e.type.schema)}function fy(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function Fs(e,t,n){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const o=ge(t)?t:t.name,i=r.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+r.offset,l=s+1,c=a+r.node.nodeSize;if(!i)return n&&c<n.pos?Fs(e.doc.resolve(c+1),t,n):void 0;for(;s>0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&i.isInSet(e.parent.child(l).marks);)c+=e.parent.child(l).nodeSize,l+=1;const u=e.doc.textBetween(a,c,V0,`
123
+
124
+ `);return{from:a,to:c,text:u,mark:i}}function Z7(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function Q7(e,t){if(!vl(e.selection))return;let{from:n,to:r}=e.selection;const o=(s,a)=>Z7(ye.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(n-1,n);s&&!t.test(s);n--,s=o(n-1,n));for(let s=o(r,r+1);s&&!t.test(s);r++,s=o(r,r+1));if(n===r)return;const i=e.doc.textBetween(n,r,V0,`
125
+
126
+ `);return{from:n,to:r,text:i}}function eq(e){return Q7(e,/\W/)}function mw(e,t=0){const n=Et(e)?e[t]:e;return JO(ge(n),`No match string found for match ${e}`),n??""}function tq(e){return vl(e)?e.$cursor:void 0}function nq(e,t){return Xh(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function rq(e){return gn(e)&&nr(e.anchor)&&nr(e.head)}function Rr(e,t){const n=t.nodeSize-2,r=0;let o;const i=l=>G6({min:r,max:n,value:l});if(uy(e))return e;if(e==="all")return new En(t);if(e==="start"?o=r:e==="end"?o=n:Y7(e)?o=e.pos:o=e,nr(o))return o=i(o),ye.near(t.resolve(o));if(rq(o)){const l=i(o.anchor),c=i(o.head);return ye.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return ye.between(t.resolve(s),t.resolve(a))}var oq=3;function O_(e){const{content:t,schema:n,document:r,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=oq||s===0;if(fe(a,{code:K.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ge(t))return fe(o,{code:K.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:r,content:t,schema:n});if(C_(t))return t.doc;if(Xh(t))return t;try{return n.nodeFromJSON(t)}catch(l){const c=dq({schema:n,error:l,json:t}),u=i==null?void 0:i(c);return fe(u,{code:K.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),O_({...e,content:u,attempts:s+1})}}function Qh(){const e=PT();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope.
127
+ It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work.
128
+ If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
129
+ If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
130
+ If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function T_(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=PT())==null?void 0:t.defaultView)}function iq(e){return T_(e==null?void 0:e.ownerDocument)}function sq(e){const t=T_(e)??Qh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function aq(e,t=Qh()){const n=nq(e,e.type.schema)?e.content:B.from(e);return Mo.fromSchema(e.type.schema).serializeFragment(n,{document:t})}function lq(e,t){return new(sq(t)).DOMParser().parseFromString(`<body>${e}</body>`,"text/html").body}function cq(e,t=Qh()){const n=t.createElement("div");return n.append(aq(e,t)),n.innerHTML}function sv(e){const{content:t,schema:n,document:r,fragment:o=!1,...i}=e,s=lq(t,r),a=Ua.fromSchema(n);return o?a.parseSlice(s,{...vw,...i}).content:a.parse(s,{...vw,...i})}var vw={preserveWhitespace:!1},uq={remove(e,t){let n=e;for(const r of t)r.invalidParentNode||(n=X6(r.path,n));return n}};function dq({json:e,schema:t,...n}){const r=new Set(kf(t.marks)),o=new Set(kf(t.nodes)),i=__({json:e,path:[],validNodes:o,validMarks:r});return{json:e,invalidContent:i,transformers:uq,...n}}function __(e){const{json:t,validMarks:n,validNodes:r,path:o=[]}=e,i={validMarks:n,validNodes:r},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[h,p]of l.entries()){const g=ge(p)?p:p.type;n.has(g)||(f.unshift({name:g,path:[...o,"marks",`${h}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(r.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[h,p]of c.entries())f.unshift(...__({...i,json:p,path:[...o,"content",`${h}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function fq(e){return!!(vl(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function av(e){return!!(vl(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function yw(e){const t=Ee.atStart(e.$anchor.doc);return!!(av(e)&&t.anchor===e.anchor)}function hq({tr:e,dispatch:t}){const{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&hl(o);return!nr(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function M_(e,t={},n){return function(r){const{tr:o,dispatch:i,state:s}=r,a=ge(e)?Qe(s.schema.nodes,e):e,{from:l,to:c}=Rr(n??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),h=f&&K0(f,a,t);return!h||!f?!1:(i==null||i(o.wrap(f,h).scrollIntoView()),!0)}}function pq(e,t={},n){return r=>{const{tr:o,state:i}=r,s=ge(e)?Qe(i.schema.nodes,e):e;return Yc({state:o,type:s,attrs:t})?hq(r):M_(e,t,n)(r)}}function lv(e,t,n,r=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ge(e)?Qe(a.schema.nodes,e):e,{from:c,to:u}=Rr(n??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(h,p)=>{if(d)return!1;if(!h.isTextblock||h.hasMarkup(l,t))return;if(h.type===l){d=!0,f=h.attrs;return}const g=i.doc.resolve(p),m=g.index();d=g.parent.canReplaceWith(m,m+1,l),d&&(f=g.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...r?f:{},...t}).scrollIntoView()),!0):!1}}function gq(e){return t=>{const{tr:n,state:r}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Yc({state:n,type:o,attrs:i}),l=e.toggleType??Zh(r.schema);if(a)return lv(l,{...s?a.node.attrs:{},...i})(t);const c=Yc({state:n,type:l,attrs:i});return lv(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function mq(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(Qe(t,2),10)>=e:!1}function vq(e,t){let{head:n,empty:r,anchor:o}=e;for(const i of t.steps)n=i.getMap().map(n);r?t.setSelection(ye.near(t.doc.resolve(n))):t.setSelection(ye.between(t.doc.resolve(o),t.doc.resolve(n)))}function yq(e){const{attrs:t={},appendText:n="",content:r="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=Rr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:h,to:p,$from:g}=d,m=ge(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(fe(ge(e.type)?m:!0,{code:K.SCHEMA,message:`Schema contains no marks or nodes with name ${m}`}),W7(m)){if(!g.parent.canReplaceWith(f,f,m))return!1;a.replaceWith(h,p,m.create(t,r?u.text(r):void 0))}else fe(r,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(h,p,u.text(r,S_(m)?[m.create(t)]:void 0));return n&&a.insertText(n),o&&vq(s.selection,a),l&&(mq(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function D_(e,t){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const{marks:r,nodeSize:o}=n.node;if(r[0])return r[0].type;const s=e.start()+n.offset+o;return D_(e.doc.resolve(s+1))}function bq(e){return({dispatch:t,tr:n,state:r})=>{const{type:o,expand:i=!0,range:s}=e,a=Rr(e.selection??s??n.selection,n.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ge(o)?r.schema.marks[o]:o;f!==null&&fe(f,{code:K.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const h=f??D_(u);if(!h)return!1;const p=Fs(u,h,d);return i&&p&&(l=Math.max(0,Math.min(l,p.from)),c=Math.min(Math.max(c,p.to),n.doc.nodeSize-2)),t==null||t(n.removeMark(l,nr(c)?c:l,S_(f)?f:void 0)),!0}}function Hf(e){const{regexp:t,type:n,getAttributes:r,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new Nr(t,(d,f,h,p)=>{const{tr:g,schema:m}=d;c||(c=ge(n)?m.marks[n]:n,fe(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let b=f[1],y=f[0];const w=xq({captureGroup:b,fullMatch:y,end:p,start:h,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!w)return null;({start:h,end:p,captureGroup:b,fullMatch:y}=w);const S=Xe(r)?r(f):r;let C=p,E=[];if(b){const k=y.search(/\S/),_=h+y.indexOf(b),T=_+b.length;E=g.storedMarks??[],T<p&&g.delete(T,p),_>h&&g.delete(h+k,_),C=h+k+b.length}return g.addMark(h,C,c.create(S)),g.setStoredMarks(E),i==null||i({tr:g,match:f,start:h,end:p}),g});return u}function xq({captureGroup:e,fullMatch:t,end:n,start:r,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:r,end:n}))??{};e=d.captureGroup??e,t=d.fullMatch??t,r=d.start??r,n=d.end??n;const f=l.doc.resolve(r),h=l.doc.resolve(n);return c&&rv({$from:f,$to:h},c)||o.invalidMarks&&rv({$from:f,$to:h},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})?null:{captureGroup:e,end:n,fullMatch:t,start:r}}var wq=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const o=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(n[i]);return o.push(...r),o.join(" ")},Sq=wq;const R_=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Cq(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const I_=(e,t,n)=>{let r=Cq(e,n);if(!r)return!1;let o=N_(r);if(!o){let s=r.blockRange(),a=s&&hl(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(A_(e,o,t,-1))return!0;if(r.parent.content.size==0&&(Ya(i,"end")||he.isSelectable(i)))for(let s=r.depth;;s--){let a=G0(e.doc,r.before(s),r.after(s),J.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=e.tr.step(a);l.setSelection(Ya(i,"end")?Ee.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):he.create(l.doc,o.pos-i.nodeSize)),t(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function Ya(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Eq=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=N_(r)}let s=i&&i.nodeBefore;return!s||!he.isSelectable(s)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function N_(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function kq(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Oq=(e,t,n)=>{let r=kq(e,n);if(!r)return!1;let o=P_(r);if(!o)return!1;let i=o.nodeAfter;if(A_(e,o,t,1))return!0;if(r.parent.content.size==0&&(Ya(i,"start")||he.isSelectable(i))){let s=G0(e.doc,r.before(),r.after(),J.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Ya(i,"start")?Ee.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):he.create(a.doc,a.mapping.map(o.pos))),t(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Tq=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=P_(r)}let s=i&&i.nodeAfter;return!s||!he.isSelectable(s)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,i.pos)).scrollIntoView()),!0)};function P_(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const _q=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
131
+ `).scrollIntoView()),!0)};function hy(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Mq=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=hy(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Ee.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Dq=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof En||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=hy(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(s,i.createAndFill());a.setSelection(ye.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},Rq=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Oa(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&hl(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function Iq(e){return(t,n)=>{let{$from:r,$to:o}=t.selection;if(t.selection instanceof he&&t.selection.node.isBlock)return!r.parentOffset||!Oa(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof ye||t.selection instanceof En)&&s.deleteSelection();let a=r.depth==0?null:hy(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&a?[{type:a}]:void 0,c=Oa(s.doc,s.mapping.map(r.pos),1,l);if(!l&&!c&&Oa(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(l=[{type:a}]),c=!0),c&&(s.split(s.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=a)){let u=s.mapping.map(r.before()),d=s.doc.resolve(u);a&&r.node(-1).canReplaceWith(d.index(),d.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const Nq=Iq(),Pq=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(he.create(e.doc,o))),!0)},Aq=(e,t)=>(t&&t(e.tr.setSelection(new En(e.doc))),!0);function Lq(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Ou(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function A_(e,t,n,r){let o=t.nodeBefore,i=t.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&Lq(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let h=t.pos+i.nodeSize,p=B.empty;for(let b=s.length-1;b>=0;b--)p=B.from(s[b].create(null,p));p=B.from(o.copy(p));let g=e.tr.step(new St(t.pos-1,h,t.pos,h,new J(p,1,0),s.length,!0)),m=h+2*s.length;Ou(g.doc,m)&&g.join(m),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:Ee.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&hl(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(c&&Ya(i,"start",!0)&&Ya(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=i,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let b=B.empty;for(let w=p.length-1;w>=0;w--)b=B.from(p[w].copy(b));let y=e.tr.step(new St(t.pos-p.length,t.pos+i.nodeSize,t.pos+m,t.pos+i.nodeSize-m,new J(b,p.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function L_(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(ye.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const jq=L_(-1),$q=L_(1);function zq(e,t,n,r){for(let o=0;o<t.length;o++){let{$from:i,$to:s}=t[o],a=i.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(i.pos,s.pos,(l,c)=>{if(a)return!1;a=l.inlineContent&&l.type.allowsMarkType(n)}),a)return!0}return!1}function Bq(e,t=null,n){return function(r,o){let{empty:i,$cursor:s,ranges:a}=r.selection;if(i&&!s||!zq(r.doc,a,e))return!1;if(o)if(s)e.isInSet(r.storedMarks||s.marks())?o(r.tr.removeStoredMark(e)):o(r.tr.addStoredMark(e.create(t)));else{let l,c=r.tr;l=!a.some(u=>r.doc.rangeHasMark(u.$from.pos,u.$to.pos,e));for(let u=0;u<a.length;u++){let{$from:d,$to:f}=a[u];if(!l)c.removeMark(d.pos,f.pos,e);else{let h=d.pos,p=f.pos,g=d.nodeAfter,m=f.nodeBefore,b=g&&g.isText?/^\s*/.exec(g.text)[0].length:0,y=m&&m.isText?/\s*$/.exec(m.text)[0].length:0;h+b<p&&(h+=b,p-=y),c.addMark(h,p,e.create(t))}}o(c.scrollIntoView())}return!0}}function ep(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let gg=ep(R_,I_,Eq),bw=ep(R_,Oq,Tq);const mo={Enter:ep(_q,Dq,Rq,Nq),"Mod-Enter":Mq,Backspace:gg,"Mod-Backspace":gg,"Shift-Backspace":gg,Delete:bw,"Mod-Delete":bw,"Mod-a":Aq},j_={"Ctrl-h":mo.Backspace,"Alt-Backspace":mo["Mod-Backspace"],"Ctrl-d":mo.Delete,"Ctrl-Alt-Backspace":mo["Mod-Delete"],"Alt-Delete":mo["Mod-Delete"],"Alt-d":mo["Mod-Delete"],"Ctrl-a":jq,"Ctrl-e":$q};for(let e in mo)j_[e]=mo[e];const Fq=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,mg=Fq?j_:mo;var Ai={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Vf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Vq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ht=0;Ht<10;Ht++)Ai[48+Ht]=Ai[96+Ht]=String(Ht);for(var Ht=1;Ht<=24;Ht++)Ai[Ht+111]="F"+Ht;for(var Ht=65;Ht<=90;Ht++)Ai[Ht]=String.fromCharCode(Ht+32),Vf[Ht]=String.fromCharCode(Ht);for(var vg in Ai)Vf.hasOwnProperty(vg)||(Vf[vg]=Ai[vg]);function Wq(e){var t=Hq&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Vq&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Vf:Ai)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Uq=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function qq(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Uq?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function Kq(e){let t=Object.create(null);for(let n in e)t[qq(n)]=e[n];return t}function yg(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function $_(e){let t=Kq(e);return function(n,r){let o=Wq(r),i,s=t[yg(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=t[yg(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=Ai[r.keyCode])&&i!=o){let a=t[yg(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function Gq(e){const t=Va(e,(i,s)=>(s.priority??Be.Low)-(i.priority??Be.Low)),n=[],r=[];for(const i of t)tK(i)?n.push(i):r.push(i);let o;return new Wi({key:Yq,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of n){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(y=>d.has(y)))continue;const h=((l=i.content.firstChild)==null?void 0:l.textContent)??"",p=!o.state.selection.empty&&i.content.childCount===1&&h,g=U0(h,f.regexp)[0];if(p&&g&&f.type==="mark"&&f.replaceSelection){const{from:y,to:w}=o.state.selection,S=o.state.doc.slice(y,w),C=S.content.textBetween(0,S.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(C):f.replaceSelection){const E=[],{getAttributes:k,markType:_}=f,T=Xe(k)?k(g,!0):k,D=_.create(T);return S.content.forEach(O=>{if(O.isText){const M=D.addToSet(O.marks);E.push(O.mark(M))}}),J.maxOpen(B.fromArray(E))}}const{nodes:m,transformed:b}=Qq(i.content,f,o.state.schema);b&&(i=f.type==="node"&&f.nodeType.isBlock?new J(B.fromArray(m),0,0):new J(B.fromArray(m),i.openStart,i.openEnd))}return iK(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(h=>h.getAsFile()).filter(h=>!!h);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:h,regexp:p}of r){const g=p?d.filter(m=>p.test(m.type)):d;if(g.length!==0&&h({event:c,files:g,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:h}=u;if(!d)return!1;const p=oK(u);if(p.length===0)return!1;const g=((c=i.posAtCoords({left:f,top:h}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:m,regexp:b}of r){const y=b?p.filter(w=>b.test(w.type)):p;if(y.length!==0&&m({event:u,files:y,pos:g,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var Yq=new pl("pasteRule");function bg(e,t){return function n(r){const{fragment:o,rule:i,nodes:s}=r,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||nK(f)){s.push(f);return}if(!f.isText){const g=n({fragment:f.content,rule:i,nodes:[]});d||(d=g.transformed);const m=B.fromArray(g.nodes);f.type.validContent(m)?s.push(f.copy(m)):s.push(...g.nodes);return}if(f.marks.some(g=>rK(g)||(c==null?void 0:c.includes(g.type.name)))){s.push(f);return}const h=f.text??"";let p=0;for(const g of U0(h,a)){const m=g[1],b=g[0];if(l&&(m==null?void 0:m.trim())===""||!b)return;const y=g.index,w=y+b.length;y>p&&s.push(f.cut(p,y));let S=f.cut(y,w);if(b&&m){const C=b.search(/\S/),E=y+b.indexOf(m),k=E+m.length;C&&s.push(f.cut(y,y+C)),S=f.cut(E,k)}e({nodes:s,rule:i,textNode:S,match:g,schema:t}),d=!0,p=w}h&&p<h.length&&s.push(f.cut(p))}),{nodes:s,transformed:d}}}function Xq(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s,getAttributes:a,markType:l}=n,c=Xe(a)?a(o,!1):a,u=r.text??"",d=l.create(c),f=s==null?void 0:s(o);if(f==="")return;if(f===!1){t.push(i.text(u,r.marks));return}const h=d.addToSet(r.marks);t.push(i.text(f??u,h))}function Jq(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s}=n,a=s==null?void 0:s(o);if(a===""||a===!1)return;const l=a??r.text??"";t.push(i.text(l,r.marks))}function Zq(e){const{nodes:t,rule:n,textNode:r,match:o}=e,{getAttributes:i,nodeType:s,getContent:a}=n,l=Xe(i)?i(o,!1):i,c=(a?a(o):r)||void 0;t.push(s.createChecked(l,c))}function Qq(e,t,n){const r=[];switch(t.type){case"mark":return bg(Xq,n)({fragment:e,nodes:r,rule:t});case"node":return bg(Zq,n)({fragment:e,nodes:r,rule:t});default:return bg(Jq,n)({fragment:e,nodes:r,rule:t})}}var eK=["mark","node","text"];function tK(e){return Jr(eK,e.type)}function nK(e){var t;return e.type.spec.code||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function rK(e){var t;return e.type.name==="code"||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function oK(e){var t,n;const{dataTransfer:r}=e;return r?((t=r.files)==null?void 0:t.length)>0?[...r.files]:(n=r.items)!=null&&n.length?[...r.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function iK(e){const t=J.maxOpen(e.content);return t.openStart<e.openStart||t.openEnd<e.openEnd?t:e}let tp=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(n=>n(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(n=>n!==t)}});var sK=Object.defineProperty,aK=Object.getOwnPropertyDescriptor,ne=(e,t,n,r)=>{for(var o=r>1?void 0:r?aK(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&sK(t,n,o),o},z_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Z=(e,t,n)=>(z_(e,t,"read from private field"),n?n.call(e):t.get(e)),ut=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rt=(e,t,n,r)=>(z_(e,t,"write to private field"),t.set(e,n),n);function lK(e,t){return e===t}function xw(e){const{previousOptions:t,update:n,equals:r=lK}=e,o=fs({...t,...n}),i=le(),s=kf(t);for(const l of s){const c=t[l],u=o[l];if(r(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=le();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:fs(i),options:o,pickChanged:a}}var cK={[K.DUPLICATE_HELPER_NAMES]:"helper method",[K.DUPLICATE_COMMAND_NAMES]:"command method"};function B_(e){const{name:t,set:n,code:r}=e,o=cK[r];fe(!n.has(t),{code:r,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(t)}function cv(...e){return Hc(Sq(...e).split(" ")).join(" ")}var ww="__IGNORE__",uK="__ALL__",yl=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=le(),this.populateMappedHandlers(),this._options=this._initialOptions=K6(e,this.constructor.defaultOptions,t??le(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:n,staticKeys:r}=this.constructor;for(const o of kf(this._options))r.includes(o)||n.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:r,options:o,pickChanged:i}=xw({previousOptions:n,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:r,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:n,options:r,pickChanged:o}=xw({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(r),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:r,changes:n,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return KO(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=le();for(const t of this.constructor.handlerKeys)e[t]=(...n)=>{var r;const{handlerKeyOptions:o}=this.constructor,i=(r=o[t])==null?void 0:r.reducer;let s=i==null?void 0:i.getDefault(...n);for(const[,a]of this._mappedHandlers[t]){const l=a(...n);if(s=i?i.accumulator(s,l,...n):l,dK(o,s,t))return s}return s};return e}addHandler(e,t,n=Be.Default){return this._mappedHandlers[e].push([n,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,r])=>r!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=Va(this._mappedHandlers[e],([t],[n])=>n-t)}addCustomHandler(e,t){var n;return((n=this.onAddCustomHandler)==null?void 0:n.call(this,{[e]:t}))??eT}};yl.defaultOptions={};yl.staticKeys=[];yl.handlerKeys=[];yl.handlerKeyOptions={};yl.customHandlerKeys=[];function dK(e,t,n){const{[uK]:r}=e,o=e[n];return!r&&!o?!1:!!(o&&o.earlyReturnValue!==ww&&(Xe(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||r&&r.earlyReturnValue!==ww&&(Xe(r.earlyReturnValue)?r.earlyReturnValue(t)===!0:t===r.earlyReturnValue))}var np=class extends yl{constructor(...e){super(fK,...e),this["~E"]={},this._extensions=Z6(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${XO(this.name)}Extension`}get store(){return fe(this._store,{code:K.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),fs(this._store,{})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(n=>t.constructor===e?t:n))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return fe(t,{code:K.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};np.defaultPriority=Be.Default;var Je=class extends np{static get[Co](){return At.PlainExtensionConstructor}get[Co](){return At.PlainExtension}},rp=class extends np{static get[Co](){return At.MarkExtensionConstructor}get[Co](){return At.MarkExtension}get type(){return Qe(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};rp.disableExtraAttributes=!1;var Do=class extends np{static get[Co](){return At.NodeExtensionConstructor}get[Co](){return At.NodeExtension}get type(){return Qe(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};Do.disableExtraAttributes=!1;var fK={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function F_(e){return gl(e)&&ml(e,[At.PlainExtension,At.MarkExtension,At.NodeExtension])}function hK(e){return gl(e)&&ml(e,[At.PlainExtensionConstructor,At.MarkExtensionConstructor,At.NodeExtensionConstructor])}function H_(e){return gl(e)&&ml(e,At.PlainExtension)}function Du(e){return gl(e)&&ml(e,At.NodeExtension)}function op(e){return gl(e)&&ml(e,At.MarkExtension)}function ze(e){return t=>{const{defaultOptions:n,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;n&&(c.defaultOptions=n),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=r??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var pK=class extends Je{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=le(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,n;if(this.attributeObject=le(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const r of this.store.extensions){if((t=r.options.exclude)!=null&&t.attributes)continue;const o=(n=r.createAttributes)==null?void 0:n.call(r),i={...o,class:cv(...r.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const r of this.attributeList)this.attributeObject={...this.attributeObject,...r,class:cv(this.attributeObject.class,r.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function et(e={}){return(t,n,r)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[n]=e}}function ce(e={}){return(t,n,r)=>{(t.decoratedCommands??(t.decoratedCommands={}))[n]=e}}function sr(e){return(t,n,r)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[n]=e}}var gK=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let n=!0;const{view:r,tr:o,dispatch:i}=t;if(!r)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){n=!1;break}return!i||!n?n:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var n;for(const r of e)if(!r({...t,dispatch:()=>{}}))break;(n=t.dispatch)==null||n.call(t,t.tr)}};function Xa(e){const{type:t,attrs:n,range:r,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ge(t)?l.schema.marks[t]:t;if(fe(c,{code:K.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),r||o){const{from:u,to:d}=Rr(o??r??a.selection,a.doc);return E_({trState:a,type:t,...r})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(n))),!0}return jd(Bq(c,n))(i)}}function mK(e,t,n){for(const{$from:r,$to:o}of n){let i=r.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(r.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function vK(e,t,n){return({tr:r,dispatch:o,state:i})=>{const s=Rr(n??r.selection,r.doc),a=tq(s),l=ge(e)?i.schema.marks[e]:e;if(fe(l,{code:K.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!mK(l,r.doc,s.ranges))return!1;if(!o)return!0;if(a)return r.removeStoredMark(l),t&&r.addStoredMark(l.create(t)),o(r),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=r.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&r.removeMark(u.pos,d.pos,l),t&&r.addMark(u.pos,d.pos,l.create(t));return o(r),!0}}function yK(e,t={}){return({tr:n,dispatch:r,state:o})=>{const i=o.schema,s=n.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!r)return!0;n.insertText(e,a,l);const u=Qe(n.steps,n.steps.length-1).getMap().map(l);for(const[d,f]of wt(c))n.addMark(a,u,Qe(i.marks,d).create(f));return r(n),!0}}var ke=class extends Je{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:n}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Hc([...n,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),n=!Ii(this._transaction.steps);if(!t){const r=e.tr;if(n)for(const o of this._transaction.steps)r.step(o);this._transaction=r}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:n,helpers:r}=this.store,o=le(),i=new Set;let s=le();const a=c=>{var u;const d=le(),f=()=>c??this.transaction;let h=[];const p=()=>h;for(const[m,b]of Object.entries(o))(u=s[m])!=null&&u.disableChaining||(d[m]=this.chainedFactory({chain:d,command:b.original,getTr:f,getChain:p}));const g=m=>{fe(m===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(m={})=>{const b=h;h=[];for(const y of b)if(!y(g)&&m.exitEarly)return;e.dispatch(f())},d.tr=()=>{const m=h;h=[];for(const b of m)b(g);return f()},d.enabled=()=>{for(const m of h)if(!m())return!1;return!0},d.new=m=>a(m),d};for(const c of n){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[h,p]of Object.entries(d)){const g=ge(p.shortcut)&&p.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(p.shortcut,c.options)}:void 0;this.updateDecorated(h,{...p,name:c.name,...g}),u[h]=c[h].bind(c),p.active&&(f[h]=()=>{var m;return((m=p.active)==null?void 0:m.call(p,c.options,this.store))??!1})}Of(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ge(e)?yK(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(n,r,o)=>this.insertText(n,{...t,...r})(o)}).generateCommand()}selectText(e,t={}){return({tr:n,dispatch:r})=>{const o=Rr(e,n.doc);return n.selection.anchor===o.anchor&&n.selection.head===o.head&&!t.forceUpdate?!1:(r==null||r(n.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:n}=t,r=Fs(n.selection.$from,e);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(t):!1}}delete(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=e??t.selection;return n==null||n(t.delete(r,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:n})=>(n&&(e==null||e(),n(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:n})=>(n==null||n(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:n,dispatch:r})=>(r==null||r(n.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return n=>{const{tr:r,dispatch:o}=n,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(r.replaceRangeWith(0,r.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:n}=e,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(e):(n==null||n(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(ye.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>vl(t.selection)?(e==null||e(t.insertText(`
132
+ `)),!0):!1}insertNode(e,t={}){return({dispatch:n,tr:r,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=Rr(l??a??r.selection,r.doc);if(Xh(e)||K7(e)){const b=f.before(f.depth);return n==null||n(c&&u===d&&fy(f.parent)?r.replaceWith(b,b+f.parent.nodeSize,e):r.replaceWith(u,d,e)),!0}const h=ge(e)?o.schema.nodes[e]:e;fe(h,{code:K.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const p=(i=t.marks)==null?void 0:i.map(b=>{if(b instanceof Pe)return b;const y=ge(b)?o.schema.marks[b]:b;return fe(y,{code:K.SCHEMA,message:`The requested mark type ${b} does not exist in the schema.`}),y.create()}),g=h.createAndFill(s,ge(t.content)?o.schema.text(t.content):t.content,p);if(!g)return!1;const m=u!==d;return n==null||n(m?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(e){return t=>{const{dispatch:n,tr:r}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=r.selection;e={from:i,to:s}}return n&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,n,r=!0){return lv(e,t,n,r)}toggleWrappingNode(e,t,n){return pq(e,t,n)}toggleBlockNodeItem(e){return gq(e)}wrapInNode(e,t,n){return M_(e,t,n)}applyMark(e,t,n){return vK(e,t,n)}toggleMark(e){return Xa(e)}removeMark(e){return bq(e)}setMeta(e,t){return({tr:n})=>(n.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,n)=>this.insertNode(sv({content:e,schema:n.state.schema}),{selection:t})(n)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return yq(e)}getAllCommandOptions(){const e={};for(const[t,n]of this.decorated)Of(n)||(e[t]=n);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const n=this.decorated.get(e)??{name:""};this.decorated.set(e,{...n,...t})}handleIosFocus(){Pi.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...bK,...t}}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addCommands(e){const{extensionCommands:t,commands:n,names:r,active:o}=e;for(const[i,s]of wt(t))B_({name:i,set:r,code:K.DUPLICATE_COMMAND_NAMES}),fe(!xK.has(i),{code:K.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),n[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:n=!0,command:r}=e,{view:o}=this.store,{state:i}=o;let s;return n&&(s=o.dispatch),r(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const n=this.unchainedFactory({command:e});return n.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=e,n.active=t,n}chainedFactory(e){return(...t)=>{const{chain:n,command:r,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>r(...t)({state:l,dispatch:c,view:a,tr:o()})),n}}};ne([ce()],ke.prototype,"customDispatch",1);ne([ce()],ke.prototype,"insertText",1);ne([ce()],ke.prototype,"selectText",1);ne([ce()],ke.prototype,"selectMark",1);ne([ce()],ke.prototype,"delete",1);ne([ce()],ke.prototype,"emptyUpdate",1);ne([ce()],ke.prototype,"forceUpdate",1);ne([ce()],ke.prototype,"updateNodeAttributes",1);ne([ce()],ke.prototype,"setContent",1);ne([ce()],ke.prototype,"resetContent",1);ne([ce()],ke.prototype,"emptySelection",1);ne([ce()],ke.prototype,"insertNewLine",1);ne([ce()],ke.prototype,"insertNode",1);ne([ce()],ke.prototype,"focus",1);ne([ce()],ke.prototype,"blur",1);ne([ce()],ke.prototype,"setBlockNodeType",1);ne([ce()],ke.prototype,"toggleWrappingNode",1);ne([ce()],ke.prototype,"toggleBlockNodeItem",1);ne([ce()],ke.prototype,"wrapInNode",1);ne([ce()],ke.prototype,"applyMark",1);ne([ce()],ke.prototype,"toggleMark",1);ne([ce()],ke.prototype,"removeMark",1);ne([ce()],ke.prototype,"setMeta",1);ne([ce({description:({t:e})=>e(Ni.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(Ni.SELECT_ALL_LABEL),shortcut:Q.SelectAll})],ke.prototype,"selectAll",1);ne([ce({description:({t:e})=>e(Ni.COPY_DESCRIPTION),label:({t:e})=>e(Ni.COPY_LABEL),shortcut:Q.Copy,icon:"fileCopyLine"})],ke.prototype,"copy",1);ne([ce({description:({t:e})=>e(Ni.PASTE_DESCRIPTION),label:({t:e})=>e(Ni.PASTE_LABEL),shortcut:Q.Paste,icon:"clipboardLine"})],ke.prototype,"paste",1);ne([ce({description:({t:e})=>e(Ni.CUT_DESCRIPTION),label:({t:e})=>e(Ni.CUT_LABEL),shortcut:Q.Cut,icon:"scissorsFill"})],ke.prototype,"cut",1);ne([ce()],ke.prototype,"replaceText",1);ne([et()],ke.prototype,"getAllCommandOptions",1);ne([et()],ke.prototype,"getCommandOptions",1);ne([et()],ke.prototype,"getCommandProp",1);ke=ne([ze({defaultPriority:Be.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],ke);var bK={forcedUpdates:[]},xK=new Set(["run","chain","original","raw","enabled","tr","new"]),Ir=class extends Je{constructor(){super(...arguments),this.placeholders=Re.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=_f(),{promise:n,placeholder:r,onFailure:o,onSuccess:i}=e;return new gK(n).validate(s=>this.addPlaceholder(t,r)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const h=new Error("The placeholder has been removed");return(o==null?void 0:o({error:h,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,n,r,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Re.empty;for(const[,d]of this.placeholderWidgets)(n=(t=d.spec).onDestroy)==null||n.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,h;const p=this.placeholderWidgets.get(d.id);p&&((h=(f=p.spec).onDestroy)==null||h.call(f,this.store.view,p.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(r=d.spec).onUpdate)==null||o.call(r,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const h=this.placeholderWidgets.get(d);if(!h)continue;const p=Ye.widget(h.from,h.spec.element,{...h.spec,data:f});this.placeholders=this.placeholders.remove([h]).add(e.doc,[p]),this.placeholderWidgets.set(d,p)}for(const d of c){const f=this.placeholders.find(void 0,void 0,p=>p.id===d&&p.__type===oa),h=this.placeholderWidgets.get(d);h&&((s=(i=h.spec).onDestroy)==null||s.call(i,this.store.view,h.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const n of this.store.extensions){if(!n.createDecorations)continue;const r=n.createDecorations(e).find();t=t.add(e.doc,r)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Sw,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Sw,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,n){return({dispatch:r,tr:o})=>this.addPlaceholderTransaction(e,t,o,!r)?(r==null||r(n?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:e,data:t,tr:r,checkOnly:!n})?(n==null||n(r),!0):!1}removePlaceholder(e){return({dispatch:t,tr:n})=>this.removePlaceholderTransaction({id:e,tr:n,checkOnly:!t})?(t==null||t(n),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,n=>n.__type===oa);for(const n of t)e.set(n.spec.id,{from:n.from,to:n.to});return e}createDecorations(e){var t,n,r;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(r=(n=this.store.helpers).isInteracting)!=null&&r.call(n)?Re.empty:SK(e,Re.empty,{class:ge(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:n,createElement:r,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(r==null?void 0:r(this.store.view,n))??document.createElement(a);u.classList.add(s);const d=Ye.widget(n,u,{id:l,__type:oa,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:n=t.selection.from,to:r=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(n===r){const c=document.createElement(i);c.classList.add(o),l=Ye.widget(n,c,{id:s,type:a,__type:oa,widget:c})}else l=Ye.inline(n,r,{nodeName:i,class:o},{id:s,__type:oa});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:n,className:r,nodeName:o,id:i}=e,s=nr(n)?t.doc.resolve(n):t.selection.$from,a=nr(n)?s.nodeAfter?{pos:n,end:s.nodeAfter.nodeSize}:void 0:$7(s);if(!a)return;const l=Ye.node(a.pos,a.end,{nodeName:o,class:r},{id:i,__type:oa});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:o=n,className:i,...s}=t,a=(i?[r,i]:[r]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...wK,...t}}setMeta(e,t){const n=this.getMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addPlaceholderTransaction(e,t,n,r=!1){if(this.findPlaceholder(e))return!1;if(r)return!0;const{added:i}=this.getMeta(n);return this.setMeta(n,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{updated:s}=this.getMeta(n);return this.setMeta(n,{updated:Hc([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{removed:i}=this.getMeta(n);return this.setMeta(n,{removed:Hc([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:n=!1}=e;return this.getPluginState()===Re.empty?!1:(n||this.setMeta(t,{clearTrackers:!0}),!0)}};ne([ce()],Ir.prototype,"updateDecorations",1);ne([ce()],Ir.prototype,"addPlaceholder",1);ne([ce()],Ir.prototype,"updatePlaceholder",1);ne([ce()],Ir.prototype,"removePlaceholder",1);ne([ce()],Ir.prototype,"clearPlaceholders",1);ne([et()],Ir.prototype,"findPlaceholder",1);ne([et()],Ir.prototype,"findAllPlaceholders",1);Ir=ne([ze({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,n)=>e.add(n.doc,t.find()),getDefault:()=>Re.empty}}},defaultPriority:Be.Low})],Ir);var wK={added:[],updated:[],clearTrackers:!1,removed:[]},oa="placeholderDecoration",Sw="persistentSelectionFocus";function SK(e,t,n){const{selection:r,doc:o}=e;if(r.empty)return t;const{from:i,to:s}=r,a=Jh(r)?Ye.node(i,s,n):Ye.inline(i,s,n);return t.add(o,[a])}var uv=class extends Je{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:n,tr:r}=e;t||(n??[r]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};uv=ne([ze({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Be.Lowest})],uv);var rr=class extends Je{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",sv);const t=le(),n=le(),r=le(),o=new Set;for(const i of this.store.extensions){Du(i)&&(n[i.name]=a=>F7({state:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{var l;return(l=Yc({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),op(i)&&(n[i.name]=a=>E_({trState:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{const l=Fs(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(cy(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!Of(s))for(const[a,l]of wt(s))B_({name:a,set:o,code:K.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",r),this.store.setStoreKey("active",n),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",r),this.store.setExtensionStore("active",n),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return w_(e)}isViewEditable(e=this.store.getState()){var t,n;return((n=(t=this.store.view.props).editable)==null?void 0:n.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return n=>{const{state:r}=n,o=sv({content:e,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(n)}}getText({lineBreakDivider:e=`
133
+
134
+ `,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,fi)}getTextBetween(e,t,n=this.store.getState().doc){return n.textBetween(e,t,`
135
+
136
+ `,fi)}getHTML(e=this.store.getState()){return cq(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};ne([et()],rr.prototype,"isSelectionEmpty",1);ne([et()],rr.prototype,"isViewEditable",1);ne([et()],rr.prototype,"getStateJSON",1);ne([et()],rr.prototype,"getJSON",1);ne([et()],rr.prototype,"getRemirrorJSON",1);ne([ce()],rr.prototype,"insertHtml",1);ne([et()],rr.prototype,"getText",1);ne([et()],rr.prototype,"getTextBetween",1);ne([et()],rr.prototype,"getHTML",1);rr=ne([ze({})],rr);var dv=class extends Je{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const n=[],r=this.store.markTags[De.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=r,n.push(i);return R9({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};dv=ne([ze({defaultPriority:Be.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],dv);var wr=class extends Je{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,n;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(n=(t=this.store).rebuildKeymap)==null||n.call(t),()=>{var r,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(r=this.store).rebuildKeymap)==null||o.call(r)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ge(e)?OK[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Wi({props:{handleKeyDown:(t,n)=>{var r;return(r=this.keydownHandler)==null?void 0:r.call(this,t,n)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=$_(e)}generateKeymapBindings(){var e;const t=[],n=this.shortcutMap,r=this.store.getExtension(ke),o=a=>l=>$d({shortcut:l,map:n,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(EK(a.createKeymap(o(a)),n));for(const[c,u]of wt(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=$d({shortcut:u.shortcut,map:n,options:a.options,store:this.store}),h=Xe(u.priority)?u.priority(a.options,this.store):u.priority??Be.Low,p=le();for(const g of f)p[g]=d;t.push([h,p]),u.command&&r.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return V7(i)}arrowRightShortcut(e){const t=this.store.markTags[De.PreventExits],n=this.store.nodeTags[De.PreventExits];return this.exitMarkForwards(t,n)(e)}arrowLeftShortcut(e){const t=this.store.markTags[De.PreventExits],n=this.store.nodeTags[De.PreventExits];return Ff(this.exitNodeBackwards(n),this.exitMarkBackwards(t,n))(e)}backspace(e){const t=this.store.markTags[De.PreventExits],n=this.store.nodeTags[De.PreventExits];return Ff(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(t,n,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:n}=this.options,r=le();if(!n)for(const[o,i]of wt(mg))r[o]=jd(i);return t&&mg.Backspace&&(r.Backspace=jd(ep(I9,mg.Backspace))),e&&(r.Escape=jd(Pq)),[Be.Low,r]}getNamedShortcut(e,t={}){return e.startsWith("_|")?$d({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,n;const{changes:r}=e;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(t=this.store).rebuildKeymap)==null||n.call(t))}sortKeymaps(e){return Va(e.map(t=>Et(t)?t:[Be.Default,t]),(t,n)=>n[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return n=>{const{tr:r,dispatch:o}=n;if(!fq(r.selection)||Gc({selection:r.selection,types:t}))return!1;const a=r.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Ii(a))return!1;if(!o)return!0;for(const l of a)r.removeStoredMark(l);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(e,t=!1){return n=>{const{tr:r}=n;if(!(t?yw:av)(r.selection))return!1;const i=r.selection.$anchor.node();return!fy(i)||J7(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(n)}}exitMarkBackwards(e,t,n=!1){return r=>{const{tr:o,dispatch:i}=r;if(!(n?yw:av)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(Gc({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Ii(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};ne([sr({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],wr.prototype,"arrowRightShortcut",1);ne([sr({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],wr.prototype,"arrowLeftShortcut",1);ne([sr({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],wr.prototype,"backspace",1);ne([et()],wr.prototype,"getNamedShortcut",1);wr=ne([ze({defaultPriority:Be.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],wr);function CK(e){return Jr(Vh(Q),e)}function $d({shortcut:e,map:t,options:n,store:r}){return ge(e)?[fv(e,t)]:Et(e)?e.map(o=>fv(o,t)):(e=e(n,r),$d({shortcut:e,map:t,options:n,store:r}))}function fv(e,t){return CK(e)?t[e]:e}function EK(e,t){const n={};let r,o;Et(e)?[o,r]=e:r=e;for(const[i,s]of wt(r))n[fv(i,t)]=s;return Wh(o)?n:[o,n]}var V_={[Q.Copy]:"Mod-c",[Q.Cut]:"Mod-x",[Q.Paste]:"Mod-v",[Q.PastePlain]:"Mod-Shift-v",[Q.SelectAll]:"Mod-a",[Q.Undo]:"Mod-z",[Q.Redo]:Pi.isMac?"Shift-Mod-z":"Mod-y",[Q.Bold]:"Mod-b",[Q.Italic]:"Mod-i",[Q.Underline]:"Mod-u",[Q.Strike]:"Mod-d",[Q.Code]:"Mod-`",[Q.Paragraph]:"Mod-Shift-0",[Q.H1]:"Mod-Shift-1",[Q.H2]:"Mod-Shift-2",[Q.H3]:"Mod-Shift-3",[Q.H4]:"Mod-Shift-4",[Q.H5]:"Mod-Shift-5",[Q.H6]:"Mod-Shift-6",[Q.TaskList]:"Mod-Shift-7",[Q.BulletList]:"Mod-Shift-8",[Q.OrderedList]:"Mod-Shift-9",[Q.Quote]:"Mod->",[Q.Divider]:"Mod-Shift-|",[Q.Codeblock]:"Mod-Shift-~",[Q.ClearFormatting]:"Mod-Shift-C",[Q.Superscript]:"Mod-.",[Q.Subscript]:"Mod-,",[Q.LeftAlignment]:"Mod-Shift-L",[Q.CenterAlignment]:"Mod-Shift-E",[Q.RightAlignment]:"Mod-Shift-R",[Q.JustifyAlignment]:"Mod-Shift-J",[Q.InsertLink]:"Mod-k",[Q.Find]:"Mod-f",[Q.FindBackwards]:"Mod-Shift-f",[Q.FindReplace]:"Mod-Shift-H",[Q.AddFootnote]:"Mod-Alt-f",[Q.AddComment]:"Mod-Alt-m",[Q.ContextMenu]:"Mod-Shift-\\",[Q.IncreaseFontSize]:"Mod-Shift-.",[Q.DecreaseFontSize]:"Mod-Shift-,",[Q.IncreaseIndent]:"Tab",[Q.DecreaseIndent]:"Shift-Tab",[Q.Shortcuts]:"Mod-/",[Q.Format]:Pi.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},kK={...V_,[Q.Strike]:"Mod-Shift-S",[Q.Code]:"Mod-Shift-M",[Q.Paragraph]:"Mod-Alt-0",[Q.H1]:"Mod-Alt-1",[Q.H2]:"Mod-Alt-2",[Q.H3]:"Mod-Alt-3",[Q.H4]:"Mod-Alt-4",[Q.H5]:"Mod-Alt-5",[Q.H6]:"Mod-Alt-6",[Q.OrderedList]:"Mod-Alt-7",[Q.BulletList]:"Mod-Alt-8",[Q.Quote]:"Mod-Alt-9",[Q.ClearFormatting]:"Mod-\\",[Q.IncreaseIndent]:"Mod-[",[Q.DecreaseIndent]:"Mod-]"},OK={default:V_,googleDoc:kK},TK=class extends Je{get name(){return"nodeViews"}createPlugin(){const e=[],t=le();for(const n of this.store.extensions){if(!n.createNodeViews)continue;const r=n.createNodeViews();e.unshift(Xe(r)?{[n.name]:r}:r)}e.unshift(this.store.managerSettings.nodeViews??{});for(const n of e)Object.assign(t,n);return{props:{nodeViews:t}}}},_K=class extends Je{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!r.createPasteRules||(t=r.options.exclude)!=null&&t.pasteRules)continue;const o=r.createPasteRules(),i=Et(o)?o:[o];n.push(...i)}return Gq(n)}},hv=class extends Je{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=le(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return fe(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();const{plugins:o=[]}=n;this.updatePlugins(o,this.managerPlugins);for(const i of r)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr,o={previousState:t,tr:r,transactions:e,state:n};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(e,t)=>{for(const n of this.initStateHandlers)n(t)},apply:(e,t,n,r)=>{const o={previousState:n,state:r,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,n;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(n=e.options.exclude)!=null&&n.plugins)){if(e.createPlugin){const o=new pl(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Wi(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Ii(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(r=>!t.includes(r)),...e];return}const n=new Map;for(const[r,o]of e.entries())n.set(Qe(t,r),o);this.plugins=this.plugins.map(r=>t.includes(r)?n.get(r):r)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=F_(e)?e:hK(e)?this.store.manager.getExtension(e):this.store.extensions.find(n=>n.name===e);fe(t,{code:K.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){fe(this.store.phase>=bn.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,n=e.state.reconfigure({plugins:this.plugins});t(n)}};hv=ne([ze({defaultPriority:Be.Highest,handlerKeys:["applyState","appendTransaction"]})],hv);var pv=class extends Je{constructor(){super(...arguments),this.dynamicAttributes={marks:le(),nodes:le()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:n,nodeNames:r,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=p=>!!(p&&t[De.Block].includes(p));if(e.schema){const{nodes:p,marks:g}=LK(e.schema);this.addSchema(e.schema,p,g);return}const u=c(i)?{doc:le(),[i]:le()}:le(),d=le(),f=MK({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:r,markNames:n,tags:t});for(const p of o){f[p.name]={...f[p.name],...p.options.extraAttributes};const g=s===!0||p.options.disableExtraAttributes===!0||p.constructor.disableExtraAttributes===!0;if(Du(p)){const{spec:m,dynamic:b}=Cw({createExtensionSpec:(y,w)=>p.createNodeSpec(y,w),extraAttributes:Qe(f,p.name),override:{...a,...p.options.nodeOverride},ignoreExtraAttributes:g,name:p.constructorName,tags:p.tags});p.spec=m,u[p.name]=m,Object.keys(b).length>0&&(this.dynamicAttributes.nodes[p.name]=b)}if(op(p)){const{spec:m,dynamic:b}=Cw({createExtensionSpec:(y,w)=>p.createMarkSpec(y,w),extraAttributes:Qe(f,p.name),override:{...l,...p.options.markOverride},ignoreExtraAttributes:g,name:p.constructorName,tags:p.tags??[]});p.spec=m,d[p.name]=m,Object.keys(b).length>0&&(this.dynamicAttributes.marks[p.name]=b)}}const h=new bU({nodes:u,marks:d,topNode:"doc"});this.addSchema(h,u,d)}createPlugin(){return{appendTransaction:(e,t,n)=>{const{tr:r}=n;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,r),this.checkAndUpdateDynamicMarks(i,s,r),!0)),r.steps.length>0?r:null)}}}addSchema(e,t,n){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",n),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Zh(e).name);for(const r of Object.values(e.nodes))if(r.name!=="doc"&&(r.isBlock||r.isTextblock))break}checkAndUpdateDynamicNodes(e,t,n){for(const[r,o]of wt(this.dynamicAttributes.nodes))if(e.type.name===r)for(const[i,s]of wt(o)){if(!Ri(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};n.setNodeMarkup(t,void 0,a),hw(n)}}checkAndUpdateDynamicMarks(e,t,n){for(const[r,o]of wt(this.dynamicAttributes.marks)){const i=Qe(this.store.schema.marks,r),s=e.marks.find(a=>a.type.name===r);if(s)for(const[a,l]of wt(o)){if(!Ri(s.attrs[a]))continue;const c=Fs(n.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});n.removeMark(u,d,i).addMark(u,d,f),hw(n)}}}gatherExtraAttributes(e){const t=[];for(const n of e)n.createSchemaAttributes&&t.push(...n.createSchemaAttributes());return t}};pv=ne([ze({defaultPriority:Be.Highest})],pv);function MK(e){const{settings:t,gatheredSchemaAttributes:n,nodeNames:r,markNames:o,tags:i}=e,s=le();if(t.disableExtraAttributes)return s;const a=[...n,...t.extraAttributes??[]];for(const l of a??[]){const c=RK({identifiers:l.identifiers,nodeNames:r,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function DK(e){return Bs(e)&&Et(e.tags)}function RK(e){const{identifiers:t,nodeNames:n,markNames:r,tags:o}=e;if(t==="nodes")return n;if(t==="marks")return r;if(t==="all")return[...n,...r];if(Et(t))return t;fe(DK(t),{code:K.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?r:u==="node"?n:[...r,...n],h=g=>f.includes(g)&&!(l!=null&&l.includes(g));for(const g of s)h(g)&&d.add(g);const p=new Map;for(const g of i)if(!(c!=null&&c.includes(g)))for(const m of o[g]){if(!h(m))continue;if(a==="any"){d.add(m);continue}const b=p.get(m)??new Set;b.add(g),p.set(m,b)}for(const[g,m]of p)m.size===i.length&&d.add(g);return[...d]}function Cw(e){var t;const{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=le();function c(m,b){l[m]=b}let u=!1;function d(){u=!0}const f=IK(r,o,d,c),h=NK(r,o),p=PK(r,o),g=n({defaults:f,parse:h,dom:p},a);return fe(o||u,{code:K.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),g.group=[...((t=g.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:g,dynamic:l}}function py(e){return ge(e)||Xe(e)?{default:e}:(fe(e,{message:`${ZO(e)} is not supported`,code:K.EXTENSION_EXTRA_ATTRIBUTES}),e)}function IK(e,t,n,r){return()=>{n();const o=le();if(t)return o;for(const[i,s]of wt(e)){let l=py(s).default;Xe(l)&&(r(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function NK(e,t){return n=>{const r=le();if(t)return r;for(const[o,i]of wt(e)){const{parseDOM:s,...a}=py(i);if(On(n)){if(Ri(s)){r[o]=n.getAttribute(o)??a.default;continue}if(Xe(s)){r[o]=s(n)??a.default;continue}r[o]=n.getAttribute(s)??a.default}}return r}}function PK(e,t){return n=>{const r=le();if(t)return r;function o(i,s){if(i){if(ge(i)){r[s]=i;return}if(Et(i)){const[a,l]=i;r[a]=l??n.attrs[s];return}for(const[a,l]of wt(i))r[a]=l}}for(const[i,s]of wt(e)){const{toDOM:a,parseDOM:l}=py(s);if(Ri(a)){const c=ge(l)?l:i;r[c]=n.attrs[i];continue}if(Xe(a)){o(a(n.attrs,AK(n)),i);continue}o(a,i)}return r}}function AK(e){return Xh(e)?{node:e}:G7(e)?{mark:e}:{}}function LK(e){const t=le(),n=le();for(const[r,o]of Object.entries(e.nodes))t[r]=o.spec;for(const[r,o]of Object.entries(e.marks))n[r]=o.spec;return{nodes:t,marks:n}}var Ja=class extends Je{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return fw(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>fw(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>L7(this.store.getState(),e))}createExternalPlugins(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!r.createSuggesters||(t=r.options.exclude)!=null&&t.suggesters)continue;const o=r.createSuggesters(),i=Et(o)?o:[o];n.push(...i)}return[j7(...n)]}getSuggestState(e){return sy(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return Jr(Et(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};ne([et()],Ja.prototype,"getSuggestState",1);ne([et()],Ja.prototype,"getSuggestMethods",1);ne([et()],Ja.prototype,"isSuggesterActive",1);Ja=ne([ze({customHandlerKeys:["suggester"]})],Ja);var gv=class extends Je{constructor(){super(...arguments),this.allTags=le(),this.plainTags=le(),this.markTags=le(),this.nodeTags=le()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=le(),t=le(),n=le(),r=le();for(const o of Vh(De))e[o]=[],t[o]=[],n[o]=[],r[o]=[];this.allTags=e,this.plainTags=t,this.markTags=n,this.nodeTags=r}updateTagForExtension(e){var t,n;const r=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((n=this.store.managerSettings.extraTags)==null?void 0:n[e.name])??[]]);for(const o of r)fe(jK(o),{code:K.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),H_(e)&&this.plainTags[o].push(e.name),op(e)&&this.markTags[o].push(e.name),Du(e)&&this.nodeTags[o].push(e.name);e.tags=[...r]}};gv=ne([ze({defaultPriority:Be.Highest})],gv);function jK(e){return Jr(Vh(De),e)}var $K=new pl("remirrorFilePlaceholderPlugin");function zK(){const e=new Wi({key:$K,state:{init(){return{set:Re.empty,payloads:new Map}},apply(t,{set:n,payloads:r}){n=n.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ye.widget(o.pos,i,{id:o.id});n=n.add(t.doc,[s]),r.set(o.id,o.payload)}else o.type===1&&(n=n.remove(n.find(void 0,void 0,i=>i.id===o.id)),r.delete(o.id));return{set:n,payloads:r}}},props:{decorations(t){var n;return((n=e.getState(t))==null?void 0:n.set)??null}}});return e}var BK=class extends Je{get name(){return"upload"}createExternalPlugins(){return[zK()]}};function FK(e={}){e={...{exitMarksOnArrowPress:wr.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:wr.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:wr.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:wr.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:Ir.defaultOptions.persistentSelectionClass},...e};const n=zm(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=zm(e,["persistentSelectionClass"]);return[new gv,new pv,new pK,new hv,new dv,new _K,new TK,new Ja,new ke,new rr,new wr(n),new uv,new BK,new Ir(r)]}var Ew=class extends Je{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},n=e.createCommands;for(const r of Object.keys(t)){const o=e[r];e[r]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:r,extension:e.name,decorated:!0}),l}}n&&(e.createCommands=()=>{const r=n();for(const[o,i]of Object.entries(r))r[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return r})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...n,t])}};Ew=ne([ze({defaultOptions:{capture:Pi.isDevelopment},staticKeys:["capture"],defaultPriority:Be.Highest})],Ew);var zd,Xl,Bd,fa,ei,Fd,Hd,HK=class{constructor(e){ut(this,zd,_f()),ut(this,Xl,void 0),ut(this,Bd,void 0),ut(this,fa,!0),ut(this,ei,tp()),ut(this,Fd,void 0),ut(this,Hd,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;fe(!this.manager.destroyed,{code:K.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Rt(this,Bd,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Ii(d)||this.updateViewProps(...d)},this.onChange=(i=le())=>{var s,a;const l=this.eventListenerProps(i);Z(this,fa)&&Rt(this,fa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),Z(this,ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),Z(this,ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:n,element:r}=e;if(Rt(this,Xl,t),Rt(this,Hd,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(n,r);this.manager.addView(o)}get addHandler(){return Z(this,Fd)??Rt(this,Fd,Z(this,ei).on.bind(Z(this,ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return Z(this,fa)}get props(){return Z(this,Xl).call(this)}get previousState(){return this.previousStateOverride??Z(this,Bd)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return Z(this,zd)}get initialEditorState(){return Z(this,Hd)}updateListener(e){const{state:t,tr:n}=e;return Z(this,ei).emit("updated",this.eventListenerProps({state:t,tr:n}))}update(e){const{getProps:t}=e;return Rt(this,Xl,t),this}updateViewProps(...e){const t=zm(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:n,autoFocus:r,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=Xe(n)?n(this.eventListenerProps()):n;let c={};(r||nr(r))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Hc(cv(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return U6({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){Z(this,ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=le()){const{state:t,tr:n,transactions:r}=e;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:Z(this,fa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:Z(this,zd),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};zd=new WeakMap;Xl=new WeakMap;Bd=new WeakMap;fa=new WeakMap;ei=new WeakMap;Fd=new WeakMap;Hd=new WeakMap;function VK(e,t){const n=[],r=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)W_(a,{extension:d});s=Va(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,h=d.name,p=i.get(f);fe(p,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:K.INTERNAL}),!(l.has(f)||c.has(h))&&(l.add(f),c.add(h),n.push(d),r.set(f,d),p.forEach(g=>g==null?void 0:g.replaceChildExtension(f,d)))}const u=[];for(const d of n)WK({extension:d,found:l,missing:u});return fe(Ii(u),{code:K.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(`
137
+ `)}),{extensions:n,extensionMap:r}}function W_(e,t){var n;const{gatheredExtensions:r,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;fe(F_(a),{code:K.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((n=s.priority)==null?void 0:n[a.name]),r.push(a),UK({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)W_(e,{names:c,extension:d,parentExtension:a})}}function WK(e){const{extension:t,found:n,missing:r}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])n.has(o)||r.push({Constructor:o,extension:t})}function UK(e){const{duplicateMap:t,extension:n,parentExtension:r}=e,o=n.constructor,i=t.get(o),s=r?[r]:[];t.set(o,i?[...i,...s]:s)}function qK(e){var t,n,r,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(n=i.onView)==null?void 0:n.bind(i),h=(r=i.onStateUpdate)==null?void 0:r.bind(i),p=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),h&&u.update.push(h),p&&u.destroy.push(p),op(i)&&a.push(i.name),Du(i)&&i.name!=="doc"&&s.push(i.name),H_(i)&&l.push(i.name)}var ti,Jl,hr,co,Zl,Nn,rs,Ql,is,ec,ss,pr,tc,Vd=class{constructor(e,t={}){ut(this,ti,void 0),ut(this,Jl,le()),ut(this,hr,le()),ut(this,co,void 0),ut(this,Zl,void 0),ut(this,Nn,bn.None),ut(this,rs,void 0),ut(this,Ql,!0),ut(this,is,{create:[],view:[],update:[],destroy:[]}),ut(this,ec,[]),ut(this,ss,tp()),ut(this,pr,void 0),ut(this,tc,void 0),this.getState=()=>{var o;return Z(this,Nn)>=bn.EditorView?this.view.state:(fe(Z(this,pr),{code:K.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=Z(this,pr))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:n,extensionMap:r}=VK(e,t);Rt(this,rs,t),Rt(this,co,fs(n)),Rt(this,Zl,r),Rt(this,ti,this.createExtensionStore()),Rt(this,Nn,bn.Create),this.setupLifecycleHandlers();for(const o of Z(this,is).create){const i=o();i&&Z(this,ec).push(i)}}static create(e,t={}){return new Vd([...nT(e),...FK(t.builtin)],t)}get[Co](){return At.Manager}get destroyed(){return Z(this,Nn)===bn.Destroy}get mounted(){return Z(this,Nn)>=bn.EditorView&&Z(this,Nn)<bn.Destroy}get output(){var e;return(e=Z(this,pr))==null?void 0:e.frameworkOutput}get frameworkAttached(){return!!Z(this,pr)}get extensions(){return Z(this,co)}get stringHandlers(){return Z(this,Jl)}get store(){return fs(Z(this,hr))}get extensionStore(){return fs(Z(this,ti))}get tr(){return this.getExtension(ke).transaction}get nodes(){return Z(this,hr).nodes}get marks(){return Z(this,hr).marks}get schema(){return Z(this,hr).schema}get extensionTags(){return Z(this,hr).tags}get view(){return Z(this,hr).view}get settings(){return Z(this,rs)}get document(){return Z(this,rs).document??Qh()}setupLifecycleHandlers(){const e=Z(this,ti),t=Z(this,is),n=[],r=[],o=[];e.nodeNames=n,e.markNames=r,e.plainNames=o;for(const i of Z(this,co))qK({extension:i,nodeNames:n,markNames:r,plainNames:o,handlers:t,store:e})}setStringHandler(e,t){Z(this,Jl)[e]=t}setStoreKey(e,t){Z(this,hr)[e]=t}getStoreKey(e){const t=Z(this,hr)[e];return fe(!Ri(t),{code:K.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),t}setExtensionStore(e,t){fe(Z(this,Nn)<=bn.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),Z(this,ti)[e]=t}createExtensionStore(){const e=le(),t=!0;let n,r;return Object.defineProperties(e,{extensions:{get:()=>Z(this,co),enumerable:t},phase:{get:()=>Z(this,Nn),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>fs(Z(this,rs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>Z(this,Jl),enumerable:t},currentState:{get:()=>n??(n=this.getState()),set:o=>{n=o},enumerable:t},previousState:{get:()=>r,set:o=>{r=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(Z(this,Nn)>=bn.EditorView)return this;Rt(this,Ql,!0),Rt(this,Nn,bn.EditorView),Z(this,hr).view=e;for(const t of Z(this,is).view){const n=t(e);n&&Z(this,ec).push(n)}return this}attachFramework(e,t){var n;Z(this,pr)!==e&&(Z(this,pr)&&(Z(this,pr).destroy(),(n=Z(this,tc))==null||n.call(this)),Rt(this,pr,e),Rt(this,tc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return fe(t,{code:K.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:n="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=n,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=O_({stringHandler:ge(i)?this.stringHandlers[i]:i,document:this.document,content:r,onError:t,schema:s,selection:o});return hs.create({schema:s,doc:l,plugins:a,selection:Rr(o,l)})}addHandler(e,t){return Z(this,ss).on(e,t)}onStateUpdate(e){const t=Z(this,Ql);Z(this,ti).currentState=e.state,Z(this,ti).previousState=e.previousState,t&&(Rt(this,Nn,bn.Runtime),Rt(this,Ql,!1));const n={...e,firstUpdate:t};for(const r of Z(this,is).update)r(n);Z(this,ss).emit("stateUpdate",n)}getExtension(e){const t=Z(this,Zl).get(e);return fe(t,{code:K.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!Z(this,Zl).get(e)}clone(){const e=Z(this,co).map(n=>n.clone(n.options)),t=Vd.create(()=>e,Z(this,rs));return Z(this,ss).emit("clone",t),t}recreate(e=[],t={}){const n=Z(this,co).map(o=>o.clone(o.initialOptions)),r=Vd.create(()=>[...n,...e],t);return Z(this,ss).emit("recreate",r),r}destroy(){var e,t,n,r,o,i;Rt(this,Nn,bn.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(n=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||n.call(t);(r=Z(this,pr))==null||r.destroy(),(o=Z(this,tc))==null||o.call(this);for(const s of Z(this,ec))s();for(const s of Z(this,is).destroy)s();(i=this.view)==null||i.destroy(),Z(this,ss).emit("destroy")}includes(e){const t=[],n=[];for(const r of Z(this,co))t.push(r.name,r.constructorName),n.push(r.constructor);return e.every(r=>ge(r)?Jr(t,r):Jr(n,r))}},KK=Vd;ti=new WeakMap;Jl=new WeakMap;hr=new WeakMap;co=new WeakMap;Zl=new WeakMap;Nn=new WeakMap;rs=new WeakMap;Ql=new WeakMap;is=new WeakMap;ec=new WeakMap;ss=new WeakMap;pr=new WeakMap;tc=new WeakMap;function GK(e,t){return!(!gl(e)||!ml(e,At.Manager))}function vo(e,t,n){return Math.min(Math.max(e,n),t)}class YK extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var nc=YK;function U_(e){if(typeof e!="string")throw new nc(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=rG.test(e)?ZK(e):e;const n=QK.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Xc(a,2),16)),parseInt(Xc(s[3]||"f",2),16)/255]}const r=eG.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=tG.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=nG.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(vo(0,100,a)!==a)throw new nc(e);if(vo(0,100,l)!==l)throw new nc(e);return[...oG(s,a,l),Number.isNaN(c)?1:c]}throw new nc(e)}function XK(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const kw=e=>parseInt(e.replace(/_/g,""),36),JK="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=kw(t.substring(0,3)),r=kw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function ZK(e){const t=e.toLowerCase().trim(),n=JK[XK(t)];if(!n)throw new nc(e);return`#${n}`}const Xc=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),QK=new RegExp(`^#${Xc("([a-f0-9])",3)}([a-f0-9])?$`,"i"),eG=new RegExp(`^#${Xc("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),tG=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Xc(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),nG=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,rG=/^[a-z]+$/i,Ow=e=>Math.round(e*255),oG=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(Ow);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,h=c+u;return[d,f,h].map(Ow)};function iG(e){const[t,n,r,o]=U_(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(n-r)/l+(n<r?6:0):n===i?(r-t)/l+2:(t-n)/l+4),c,a,o]}function sG(e,t,n,r){return`hsla(${(e%360).toFixed()}, ${vo(0,100,t*100).toFixed()}%, ${vo(0,100,n*100).toFixed()}%, ${parseFloat(vo(0,1,r).toFixed(3))})`}function An(e,t){const[n,r,o,i]=iG(e);return sG(n,r,o-t,i)}function aG(e,t,n,r){return`rgba(${vo(0,255,e).toFixed()}, ${vo(0,255,t).toFixed()}, ${vo(0,255,n).toFixed()}, ${parseFloat(vo(0,1,r).toFixed(3))})`}function Wd(e,t){return An(e,-t)}function Wf(e,t){const[n,r,o,i]=U_(e);return aG(n,r,o,i-t)}const lG="remirror-editor-wrapper",cG="remirror-button-active",uG="remirror-button",dG="remirror-composite",fG="remirror-dialog",hG="remirror-dialog-backdrop",pG="remirror-form",gG="remirror-form-message",mG="remirror-form-label",vG="remirror-form-group",yG="remirror-group",bG="remirror-input",xG="remirror-menu",wG="remirror-menu-pane",SG="remirror-menu-pane-active",CG="remirror-menu-dropdown-label",EG="remirror-menu-pane-icon",kG="remirror-menu-pane-label",OG="remirror-menu-pane-shortcut",TG="remirror-menu-button-left",_G="remirror-menu-button-right",MG="remirror-menu-button-nested-left",DG="remirror-menu-button-nested-right",RG="remirror-menu-button",IG="remirror-menu-bar",NG="remirror-flex-column",PG="remirror-flex-row",AG="remirror-menu-item",LG="remirror-menu-item-row",jG="remirror-menu-item-column",$G="remirror-menu-item-checkbox",zG="remirror-menu-item-radio",BG="remirror-menu-group",FG="remirror-floating-popover",HG="remirror-popover",VG="remirror-animated-popover",WG="remirror-role",UG="remirror-separator",qG="remirror-tab",KG="remirror-tab-list",GG="remirror-tabbable",YG="remirror-toolbar",XG="remirror-tooltip",JG="remirror-table-size-editor",ZG="remirror-table-size-editor-body",QG="remirror-table-size-editor-cell",eY="remirror-table-size-editor-cell-selected",tY="remirror-table-size-editor-footer",nY="remirror-color-picker",rY="remirror-color-picker-cell",oY="remirror-color-picker-cell-selected";var iY=Object.freeze({__proto__:null,ANIMATED_POPOVER:VG,BUTTON:uG,BUTTON_ACTIVE:cG,COLOR_PICKER:nY,COLOR_PICKER_CELL:rY,COLOR_PICKER_CELL_SELECTED:oY,COMPOSITE:dG,DIALOG:fG,DIALOG_BACKDROP:hG,EDITOR_WRAPPER:lG,FLEX_COLUMN:NG,FLEX_ROW:PG,FLOATING_POPOVER:FG,FORM:pG,FORM_GROUP:vG,FORM_LABEL:mG,FORM_MESSAGE:gG,GROUP:yG,INPUT:bG,MENU:xG,MENU_BAR:IG,MENU_BUTTON:RG,MENU_BUTTON_LEFT:TG,MENU_BUTTON_NESTED_LEFT:MG,MENU_BUTTON_NESTED_RIGHT:DG,MENU_BUTTON_RIGHT:_G,MENU_DROPDOWN_LABEL:CG,MENU_GROUP:BG,MENU_ITEM:AG,MENU_ITEM_CHECKBOX:$G,MENU_ITEM_COLUMN:jG,MENU_ITEM_RADIO:zG,MENU_ITEM_ROW:LG,MENU_PANE:wG,MENU_PANE_ACTIVE:SG,MENU_PANE_ICON:EG,MENU_PANE_LABEL:kG,MENU_PANE_SHORTCUT:OG,POPOVER:HG,ROLE:WG,SEPARATOR:UG,TAB:qG,TABBABLE:GG,TABLE_SIZE_EDITOR:JG,TABLE_SIZE_EDITOR_BODY:ZG,TABLE_SIZE_EDITOR_CELL:QG,TABLE_SIZE_EDITOR_CELL_SELECTED:eY,TABLE_SIZE_EDITOR_FOOTER:tY,TAB_LIST:KG,TOOLBAR:YG,TOOLTIP:XG});const sY="remirror-list-item-with-custom-mark",aY="remirror-ul-list-content",lY="remirror-editor",cY="remirror-list-item-marker-container",uY="remirror-list-item-checkbox",dY="remirror-collapsible-list-item-closed",fY="remirror-collapsible-list-item-button",hY="remirror-list-spine";var Li=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:fY,COLLAPSIBLE_LIST_ITEM_CLOSED:dY,EDITOR:lY,LIST_ITEM_CHECKBOX:uY,LIST_ITEM_MARKER_CONTAINER:cY,LIST_ITEM_WITH_CUSTOM_MARKER:sY,LIST_SPINE:hY,UL_LIST_CONTENT:aY});const pY="remirror-is-empty";var gY=Object.freeze({__proto__:null,IS_EMPTY:pY});const mY="remirror-editor",vY="remirror-positioner",yY="remirror-positioner-widget";var bY=Object.freeze({__proto__:null,EDITOR:mY,POSITIONER:vY,POSITIONER_WIDGET:yY});const xY={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"]},mi="#000000",q_="#ffffff",K_=Wf(mi,.75),gy="#7963d2",G_="#bcd263",Y_=xY.gray[1];Wd(Wf(mi,.1),.13);An(q_,.15),An(K_,.15),An(mi,.15),An(Y_,.15),An(gy,.15),An(G_,.15);An(q_,.075),An(K_,.075),An(mi,.075),An(Y_,.075),An(gy,.075),An(G_,.075);Wf(mi,.1),Wf(gy,.6),Wd(mi,.8),Wd(mi,.4),Wd(mi,.4);var wY=Object.defineProperty,SY=Object.getOwnPropertyDescriptor,my=(e,t,n,r)=>{for(var o=r>1?void 0:r?SY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&wY(t,n,o),o},X_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},vt=(e,t,n)=>(X_(e,t,"read from private field"),n?n.call(e):t.get(e)),ao=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ko=(e,t,n,r)=>(X_(e,t,"write to private field"),t.set(e,n),n),rc,oc,ha,ic,Ud,sc,ac,lc,cc,qd=class{constructor(e){ao(this,rc,tp()),ao(this,oc,[]),ao(this,ha,new Map),ao(this,ic,[]),ao(this,Ud,!1),ao(this,sc,void 0),ao(this,ac,void 0),ao(this,lc,void 0),ao(this,cc,void 0),this.addListener=(t,n)=>vt(this,rc).on(t,n),Ko(this,sc,e),Ko(this,ac,e.getActive),Ko(this,cc,e.getPosition),Ko(this,lc,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new qd(e)}static fromPositioner(e,t){return qd.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:vt(this,ac),getPosition:vt(this,cc),hasChanged:this.hasChanged,events:this.events,getID:vt(this,lc)}}onActiveChanged(e){this.recentUpdate=e;const t=vt(this,ac).call(this,e);Ko(this,oc,t),Ko(this,ha,new Map),Ko(this,Ud,!1),Ko(this,ic,[]);const n=[];for(const[r,o]of t.entries()){const i=this.getID(o,r);vt(this,ic).push(i),n.push({setElement:s=>this.addProps({...e,data:o,element:s},r),id:i,data:o})}vt(this,rc).emit("update",n)}getID(e,t){var n;return((n=vt(this,lc))==null?void 0:n.call(this,e,t))??t.toString()}addProps(e,t){if(vt(this,Ud)||(vt(this,ha).set(t,e),vt(this,ha).size<vt(this,oc).length))return;const n=[];for(const r of vt(this,oc).keys()){const o=vt(this,ha).get(r);fe(o,{code:K.INTERNAL,message:"Something went wrong when retrieving the parameters"});const i=vt(this,ic)[r];if(!i)return;n.push({position:vt(this,cc).call(this,o),element:o.element,id:i})}vt(this,rc).emit("done",n)}clone(e){return qd.create({...vt(this,sc),...Xe(e)?e(vt(this,sc)):e})}active(e){const t=Xe(e)?e:()=>e;return this.clone(n=>({getActive:r=>n.getActive(r).filter(t)}))}},_r=qd;rc=new WeakMap;oc=new WeakMap;ha=new WeakMap;ic=new WeakMap;Ud=new WeakMap;sc=new WeakMap;ac=new WeakMap;lc=new WeakMap;cc=new WeakMap;_r.EMPTY=[];function CY(e,t=eM){const{key:n}=(e==null?void 0:e.getMeta(Q_))??{};return n===t}function J_(e){const{tr:t,state:n,previousState:r}=e;return!r||t&&CY(t)?!0:t?B7(t):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function Z_(e,t,n={}){const r=t.getBoundingClientRect(),{accountForPadding:o=!1}=n;let i=0,s=0,a=0,l=0;if(On(t)&&o){const u=Number.parseFloat(qo(t,"padding-left").replace("px","")),d=Number.parseFloat(qo(t,"padding-right").replace("px","")),f=Number.parseFloat(qo(t,"padding-top").replace("px","")),h=Number.parseFloat(qo(t,"padding-bottom").replace("px","")),p=Number.parseFloat(qo(t,"border-left").replace("px","")),g=Number.parseFloat(qo(t,"border-right").replace("px","")),m=Number.parseFloat(qo(t,"border-top").replace("px","")),b=Number.parseFloat(qo(t,"border-bottom").replace("px","")),y=t.offsetWidth-t.clientWidth,w=t.offsetHeight-t.clientHeight;i+=u+p+(t.dir==="rtl"?y:0),s+=d+g+(t.dir==="rtl"?0:y),a+=f+m,l+=h+b+w}const c=new DOMRect(r.left+i,r.top+a,r.width-s,r.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(ix(u,c.top,c.bottom)&&ix(d,c.left,c.right))return!0;return!1}var EY="remirror-positioner-widget",Q_="positionerUpdate",eM="__all_positioners__",tM={y:-999999,x:-999999,width:0,height:0},Tw={...tM,left:-999999,top:-999999,bottom:-999999,right:-999999},kY={...tM,rect:{...Tw,toJSON:()=>Tw},visible:!1},OY=_r.create({hasChanged:J_,getActive(e){const{state:t}=e;if(!w_(t)||t.selection.$anchor.depth>2)return _r.EMPTY;const n=Yh({predicate:r=>r.type.isBlock,selection:t});return n?[n]:_r.EMPTY},getPosition(e){const{view:t,data:n}=e,r=t.nodeDOM(n.pos);if(!On(r))return kY;const o=r.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=Z_(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),nM=OY.clone(({getActive:e})=>({getActive:t=>{const[n]=e(t);return n&&fy(n.node)&&n.node.type===Zh(t.state.schema)?[n]:_r.EMPTY}}));nM.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})}));nM.clone(({getPosition:e})=>({getPosition:t=>{const{width:n,x:r,y:o,height:i}=e(t);return{...e(t),width:1,x:n+r,rect:new DOMRect(n+r,o,1,i)}}}));function vy(e){return _r.create({hasChanged:J_,getActive:t=>{const{state:n,view:r}=t;if(!e(n)||!vl(n.selection))return _r.EMPTY;try{const{head:o,anchor:i}=n.selection;return[{from:r.coordsAtPos(i),to:r.coordsAtPos(o)}]}catch{return _r.EMPTY}},getPosition(t){const{element:n,data:r,view:o}=t,{from:i,to:s}=r,a=n.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),h=a.scrollLeft+(u?s.left-l.left:d-l.left),p=a.scrollTop+f-l.top,g=u?1:Math.abs(i.left-s.right),m=new DOMRect(u?s.left:d,f,g,c),b=Z_(m,o.dom);return{rect:m,y:p,x:h,height:c,width:g,visible:b}}})}var TY=vy(e=>!e.selection.empty);vy(e=>e.selection.empty);vy(()=>!0);TY.clone(()=>({getActive:e=>{const{state:t,view:n}=e;if(!t.selection.empty)return _r.EMPTY;const r=eq(t);if(!r)return _r.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return _r.EMPTY}}}));var Jc=class extends Je{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:bY.EDITOR}}init(){this.onScroll=j6(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Re.empty;const t=Ye.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Re.create(e.doc,[t])}forceUpdatePositioners(e=eM){return({tr:t,dispatch:n})=>(n==null||n(t.setMeta(Q_,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=EY,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:r,state:n,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};my([ce()],Jc.prototype,"forceUpdatePositioners",1);my([et()],Jc.prototype,"getPositionerWidget",1);Jc=my([ze({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Jc);var _Y=Object.defineProperty,MY=Object.getOwnPropertyDescriptor,Ru=(e,t,n,r)=>{for(var o=r>1?void 0:r?MY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&_Y(t,n,o),o},DY={icon:"bold",label:({t:e})=>e(kx.LABEL),description:({t:e})=>e(kx.DESCRIPTION)},Ns=class extends rp{get name(){return"bold"}createTags(){return[De.FormattingMark,De.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:n=>On(n)&&n.style.fontWeight!=="normal"?e.parse(n):!1},{style:"font-weight",getAttrs:n=>ge(n)&&/^(bold(er)?|[5-9]\d{2,})$/.test(n)?null:!1},...t.parseDOM??[]],toDOM:n=>{const{weight:r}=this.options;return r?["strong",{"font-weight":r.toString()},0]:["strong",e.dom(n),0]}}}createInputRules(){return[Hf({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return Xa({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Rr(e??t.selection,t.doc);return n==null||n(t.addMark(r,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Rr(e??t.selection,t.doc);return t.doc.rangeHasMark(r,o,this.type)?(n==null||n(t.removeMark(r,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Ru([ce(DY)],Ns.prototype,"toggleBold",1);Ru([ce()],Ns.prototype,"setBold",1);Ru([ce()],Ns.prototype,"removeBold",1);Ru([sr({shortcut:Q.Bold,command:"toggleBold"})],Ns.prototype,"shortcut",1);Ns=Ru([ze({defaultOptions:{weight:void 0},staticKeys:["weight"]})],Ns);var RY=Object.defineProperty,IY=Object.getOwnPropertyDescriptor,yy=(e,t,n,r)=>{for(var o=r>1?void 0:r?IY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&RY(t,n,o),o},{DESCRIPTION:NY,LABEL:PY}=g9,AY={icon:"codeLine",description:({t:e})=>e(NY),label:({t:e})=>e(PY)},Zc=class extends rp{get name(){return"code"}createTags(){return[De.Code,De.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["code",{spellcheck:"false",...e.dom(n)},0]}}createKeymap(){return{"Mod-`":Xa({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return Xa({type:this.type})}createInputRules(){return[Hf({regexp:new RegExp(`(?:\`)([^\`${V0}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};yy([sr({shortcut:Q.Code,command:"toggleCode"})],Zc.prototype,"keyboardShortcut",1);yy([ce(AY)],Zc.prototype,"toggleCode",1);Zc=yy([ze({})],Zc);var Uf=200,Lt=function(){};Lt.prototype.append=function(t){return t.length?(t=Lt.from(t),!this.length&&t||t.length<Uf&&this.leafAppend(t)||this.length<Uf&&t.leafPrepend(this)||this.appendInner(t)):this};Lt.prototype.prepend=function(t){return t.length?Lt.from(t).append(this):this};Lt.prototype.appendInner=function(t){return new LY(this,t)};Lt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Lt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Lt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Lt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Lt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},n,r),o};Lt.from=function(t){return t instanceof Lt?t:t&&t.length?new rM(t):Lt.empty};var rM=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Uf)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Uf)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Lt);Lt.empty=new rM([]);var LY=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},t.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Lt);const jY=500;class Sr{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Fr(d.map));let h=d.step.map(o.slice(i)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Fr(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Sr(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<t.steps.length;u++){let d=t.steps[u].invert(t.docs[u]),f=new Fr(t.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>zY&&(a=$Y(a,c),s-=c),new Sr(a.append(i),s)}remapping(t,n){let r=new ka;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Sr(this.items.append(t.map(n=>new Fr(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=i.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),m=f.selection&&f.selection.map(i.slice(l+1,h));m&&a++,r.push(new Fr(p,g,m))}else r.push(new Fr(p))},o);let c=[];for(let f=n;f<s;f++)c.push(new Fr(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Sr(u,a);return d.emptyItemCount()>jY&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Fr(c.invert(),l,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Sr(Lt.from(o.reverse()),i)}}Sr.empty=new Sr(Lt.empty,0);function $Y(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}class Fr{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Fr(n.getMap().invert(),n,this.selection)}}}class si{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const zY=20;function BY(e,t,n,r){let o=n.getMeta(bo),i;if(o)return o.historyState;n.getMeta(VY)&&(e=new si(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(bo))return s.getMeta(bo).redo?new si(e.done.addTransform(n,void 0,r,Kd(t)),e.undone,_w(n.mapping.maps),e.prevTime,e.prevComposition):new si(e.done,e.undone.addTransform(n,void 0,r,Kd(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!FY(n,e.prevRanges)),c=s?xg(e.prevRanges,n.mapping):_w(n.mapping.maps);return new si(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,Kd(t)),Sr.empty,c,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new si(e.done.rebased(n,i),e.undone.rebased(n,i),xg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new si(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),xg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function FY(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&o>=t[i]&&(n=!0)}),n}function _w(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,o,i,s)=>t.push(i,s));return t}function xg(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function HY(e,t,n){let r=Kd(t),o=bo.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new si(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(bo,{redo:n,historyState:l})}let wg=!1,Mw=null;function Kd(e){let t=e.plugins;if(Mw!=t){wg=!1,Mw=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){wg=!0;break}}return wg}const bo=new pl("history"),VY=new pl("closeHistory");function WY(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Wi({key:bo,state:{init(){return new si(Sr.empty,Sr.empty,null,0,-1)},apply(t,n,r){return BY(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,o=r=="historyUndo"?Gd:r=="historyRedo"?uc:null;return o?(n.preventDefault(),o(t.state,t.dispatch)):!1}}}})}function oM(e,t){return(n,r)=>{let o=bo.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(r){let i=HY(o,n,e);i&&r(i.scrollIntoView())}return!0}}const Gd=oM(!1),uc=oM(!0);function UY(e){let t=bo.getState(e);return t?t.done.eventCount:0}function qY(e){let t=bo.getState(e);return t?t.undone.eventCount:0}var KY=Object.defineProperty,GY=Object.getOwnPropertyDescriptor,by=(e,t,n,r)=>{for(var o=r>1?void 0:r?GY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&KY(t,n,o),o},Za=class extends Do{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:n,content:r}=this.options,o=le();if(Bs(n))for(const[i,s]of wt(n))o[i]={default:s};else for(const i of n)o[i]={default:null};return{attrs:o,content:r,...t}}setDocAttributes(e){return({tr:t,dispatch:n})=>{if(n){for(const[r,o]of Object.entries(e))t.step(new mv(r,o));n(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return dy(e.doc,t)}};by([ce()],Za.prototype,"setDocAttributes",1);by([et()],Za.prototype,"isDefaultDocNode",1);Za=by([ze({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Be.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],Za);var iM="SetDocAttribute",sM="RevertSetDocAttribute",mv=class vv extends kt{constructor(t,n,r=iM){super(),wn(this,"key"),wn(this,"stepType"),wn(this,"value"),wn(this,"previous"),this.stepType=r,this.key=t,this.value=n}static fromJSON(t,n){return new vv(n.key,n.value,n.stepType)}apply(t){this.previous=t.attrs[this.key];const n={...t.attrs,[this.key]:this.value};return lt.ok(t.type.create(n,t.content,t.marks))}invert(){return new vv(this.key,this.previous,sM)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{kt.jsonID(iM,mv),kt.jsonID(sM,mv)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var Sg={exports:{}},Cg={exports:{}},aM={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(aM);var ip=aM.exports,Eg={exports:{}},Dw;function YY(){return Dw||(Dw=1,function(e){var t=ip.default;function n(r,o){if(t(r)!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var s=i.call(r,o||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Eg)),Eg.exports}var Rw;function XY(){return Rw||(Rw=1,function(e){var t=ip.default,n=YY();function r(o){var i=n(o,"string");return t(i)=="symbol"?i:i+""}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Cg)),Cg.exports}var Iw;function lM(){return Iw||(Iw=1,function(e){var t=XY();function n(r,o,i){return(o=t(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Sg)),Sg.exports}var kg={exports:{}},Nw;function JY(){return Nw||(Nw=1,function(e){var t=lM();function n(o,i){var s=Object.keys(o);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(o);i&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),s.push.apply(s,a)}return s}function r(o){for(var i=1;i<arguments.length;i++){var s=arguments[i]!=null?arguments[i]:{};i%2?n(Object(s),!0).forEach(function(a){t(o,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach(function(a){Object.defineProperty(o,a,Object.getOwnPropertyDescriptor(s,a))})}return o}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(kg)),kg.exports}var Og={exports:{}},Tg={exports:{}},Pw;function ZY(){return Pw||(Pw=1,function(e){function t(n,r){if(n==null)return{};var o={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(r.includes(i))continue;o[i]=n[i]}return o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Tg)),Tg.exports}var Aw;function QY(){return Aw||(Aw=1,function(e){var t=ZY();function n(r,o){if(r==null)return{};var i,s,a=t(r,o);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(s=0;s<l.length;s++)i=l[s],o.includes(i)||{}.propertyIsEnumerable.call(r,i)&&(a[i]=r[i])}return a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Og)),Og.exports}var eX=Object.defineProperty,tX=Object.getOwnPropertyDescriptor,cM=(e,t,n,r)=>{for(var o=r>1?void 0:r?tX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&eX(t,n,o),o};function nX(e,t,n,r){const o=e.docView.posFromDOM(t,n,r);return o===null||o<0?null:o}function rX(e,t){const n=t.target;if(n){const r=nX(e,n,0);if(r!==null){const o=e.state.doc.resolve(r),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:r,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var qf=class extends Je{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,n)=>{const r=n,o=rX(t,r);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of tT(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=Fs(c,d);f&&s.push(f)}return e(r,{view:t,nodes:i,marks:s,getMark:d=>{const f=ge(d)?t.state.schema.marks[d]:d;return fe(f,{code:K.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(h=>h.mark.type===f)},getNode:d=>{var f;const h=ge(d)?t.state.schema.nodes[d]:d;fe(h,{code:K.EXTENSION,message:"The node being checked does not exist"});const p=i.find(({node:g})=>g.type===h);if(p)return{...p,isRoot:!!((f=i[0])!=null&&f.node.eq(p.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const n of this.store.extensions){if(!n.createEventHandlers||(t=n.options.exclude)!=null&&t.clickHandler)continue;const r=n.createEventHandlers();for(const[o,i]of wt(r))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(n,r,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,h=f.resolve(i),p=e.has(l),g=oX({$pos:h,handled:p,view:o,state:u});let m=!1;p||(m=n(l,g)||m);const b={...g,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:y=>{const w=ge(y)?d.nodes[y]:y;return fe(w,{code:K.EXTENSION,message:"The node being checked does not exist"}),w===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),r(l,b)||m};return{props:{handleKeyPress:(n,r)=>this.options.keypress(r)||!1,handleKeyDown:(n,r)=>this.options.keydown(r)||!1,handleTextInput:(n,r,o,i)=>this.options.textInput({from:r,to:o,text:i})||!1,handleClickOn:(n,r,o,i,s,a)=>t(this.options.clickMark,this.options.click,n,r,o,i,s,a),handleDoubleClickOn:(n,r,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,n,r,o,i,s,a),handleTripleClickOn:(n,r,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,n,r,o,i,s,a),handleDOMEvents:{focus:(n,r)=>this.options.focus(r)||!1,blur:(n,r)=>this.options.blur(r)||!1,mousedown:(n,r)=>(this.startMouseover(),this.options.mousedown(r)||!1),mouseup:(n,r)=>(this.endMouseover(),this.options.mouseup(r)||!1),mouseleave:(n,r)=>(this.mouseover=!1,this.options.mouseleave(r)||!1),mouseenter:(n,r)=>(this.mouseover=!0,this.options.mouseenter(r)||!1),keyup:(n,r)=>this.options.keyup(r)||!1,mouseout:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!1};return this.options.hover(n,o)||!1}),mouseover:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!0};return this.options.hover(n,o)||!1}),contextmenu:this.createMouseEventHandler((n,r)=>this.options.contextmenu(n,r)||!1),scroll:(n,r)=>this.options.scroll(r)||!1,copy:(n,r)=>this.options.copy(r)||!1,cut:(n,r)=>this.options.cut(r)||!1,paste:(n,r)=>this.options.paste(r)||!1}},view:n=>{let r=n.editable;const o=this.options;return{update(i){const s=i.editable;s!==r&&(o.editable(s),r=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};cM([et()],qf.prototype,"isInteracting",1);qf=cM([ze({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Be.High})],qf);function oX(e){const{handled:t,view:n,$pos:r,state:o}=e,i={getMark:eT,markRanges:[],view:n,state:o};if(t)return i;for(const{type:s}of r.marksAcross(r)??[]){const a=Fs(r,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ge(s)?o.schema.marks[s]:s;return fe(a,{code:K.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class nt extends Ee{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return nt.valid(r)?new nt(r):Ee.near(r)}content(){return J.empty}eq(t){return t instanceof nt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new nt(t.resolve(n.pos))}getBookmark(){return new xy(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!iX(t)||!sX(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&nt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=n;let l=t.doc.resolve(o);if(nt.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!he.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(nt.valid(a))return a}return null}}}nt.prototype.visible=!1;nt.findFrom=nt.findGapCursorFrom;Ee.jsonID("gapcursor",nt);class xy{constructor(t){this.pos=t}map(t){return new xy(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return nt.valid(n)?new nt(n):Ee.near(n)}}function iX(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function sX(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function aX(){return new Wi({props:{decorations:dX,createSelectionBetween(e,t,n){return t.pos==n.pos&&nt.valid(n)?new nt(n):null},handleClick:cX,handleKeyDown:lX,handleDOMEvents:{beforeinput:uX}}})}const lX=$_({ArrowLeft:od("horiz",-1),ArrowRight:od("horiz",1),ArrowUp:od("vert",-1),ArrowDown:od("vert",1)});function od(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof ye){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=nt.findGapCursorFrom(a,t,l);return c?(o&&o(r.tr.setSelection(new nt(c))),!0):!1}}function cX(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!nt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&he.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new nt(r))),!0)}function uX(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof nt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=B.empty;for(let s=r.length-1;s>=0;s--)o=B.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new J(o,0,0));return i.setSelection(ye.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function dX(e){if(!(e.selection instanceof nt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Re.create(e.doc,[Ye.widget(e.selection.head,t,{key:"gapcursor"})])}var fX=Object.getOwnPropertyDescriptor,hX=(e,t,n,r)=>{for(var o=r>1?void 0:r?fX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o},yv=class extends Je{get name(){return"gapCursor"}createExternalPlugins(){return[aX()]}};yv=hX([ze({})],yv);var pX=Object.defineProperty,gX=Object.getOwnPropertyDescriptor,Hs=(e,t,n,r)=>{for(var o=r>1?void 0:r?gX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&pX(t,n,o),o},eo=class extends Je{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:n,dispatch:r,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=Xe(i)?i():n,l=Xe(s)&&r?s():r,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":Pi.isMac?()=>!1:this.wrapMethod(uc,this.options.onRedo),"Mod-z":this.wrapMethod(Gd,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(uc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(Gd,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(uc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[WY({depth:e,newGroupDelay:t})]}undo(){return pw(this.wrapMethod(Gd,this.options.onUndo))}redo(){return pw(this.wrapMethod(uc,this.options.onRedo))}undoDepth(e=this.store.getState()){return UY(e)}redoDepth(e=this.store.getState()){return qY(e)}};Hs([sr({shortcut:Q.Undo,command:"undo"})],eo.prototype,"undoShortcut",1);Hs([sr({shortcut:Q.Redo,command:"redo"})],eo.prototype,"redoShortcut",1);Hs([ce({disableChaining:!0,description:({t:e})=>e(Af.UNDO_DESCRIPTION),label:({t:e})=>e(Af.UNDO_LABEL),icon:"arrowGoBackFill"})],eo.prototype,"undo",1);Hs([ce({disableChaining:!0,description:({t:e})=>e(Af.REDO_DESCRIPTION),label:({t:e})=>e(Af.REDO_LABEL),icon:"arrowGoForwardFill"})],eo.prototype,"redo",1);Hs([et()],eo.prototype,"undoDepth",1);Hs([et()],eo.prototype,"redoDepth",1);eo=Hs([ze({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],eo);var mX=Object.defineProperty,vX=Object.getOwnPropertyDescriptor,wy=(e,t,n,r)=>{for(var o=r>1?void 0:r?vX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&mX(t,n,o),o},yX={icon:"italic",label:({t:e})=>e(Ox.LABEL),description:({t:e})=>e(Ox.DESCRIPTION)},Qc=class extends rp{get name(){return"italic"}createTags(){return[De.FontStyle,De.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:n=>["em",e.dom(n),0]}}createKeymap(){return{"Mod-i":Xa({type:this.type})}}createInputRules(){return[Hf({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Hf({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return Xa({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};wy([ce(yX)],Qc.prototype,"toggleItalic",1);wy([sr({shortcut:Q.Italic,command:"toggleItalic"})],Qc.prototype,"shortcut",1);Qc=wy([ze({})],Qc);function bX(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Ms(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Ms(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=K0(l,e,t,s);return c?(r&&r(xX(n.tr,s,c,a,e).scrollIntoView()),!0):!1}}function xX(e,t,n,r,o){let i=B.empty;for(let u=n.length-1;u>=0;u--)i=B.from(n[u].type.create(n[u].attrs,i));e.step(new St(t.start-(r?2:0),t.end,t.start,t.end,new J(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,f=!0;u<d;u++,f=!1)!f&&Oa(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return e}function wX(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?SX(t,n,e,i):CX(t,n,i):!0:!1}}function SX(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new St(i-1,s,i,s,new J(B.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ms(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=hl(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;return Ou(o.doc,l)&&o.join(l),t(o.scrollIntoView()),!0}function CX(e,t,n){let r=e.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?B.empty:B.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new St(d-(a?1:0),f+(l?1:0),d+1,f-1,new J((a?B.empty:B.from(o.copy(B.empty))).append(l?B.empty:B.from(o.copy(B.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}var EX=Object.defineProperty,kX=Object.getOwnPropertyDescriptor,ar=(e,t,n,r)=>{for(var o=r>1?void 0:r?kX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&EX(t,n,o),o};function bv(e){var t;return!!((t=e.spec.group)!=null&&t.includes(De.ListContainerNode))}function OX(e){var t;return!!((t=e.spec.group)!=null&&t.includes(De.ListItemNode))}function ji(e){return bv(e.type)}function Ti(e){return OX(e.type)}function Sy(e,t){return n=>{const{dispatch:r,tr:o}=n,i=ay(o,n.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Yh({predicate:u=>bv(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return fM(t)(n);if(bv(c.node.type))return e.validContent(c.node.content)?(r==null||r(o.setNodeMarkup(c.pos,e)),!0):TX(o,c,e,t)?(r==null||r(o.scrollIntoView()),!0):!1}return bX(e)(i,r)}}function uM(e,t=["checked"]){return function({tr:n,dispatch:r,state:o}){var i,s;const a=U7(e,o.schema),{$from:l,$to:c}=n.selection;if(Jh(n.selection)&&n.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){const g=l.index(-1)>0;let m=B.empty;for(let w=l.depth-(g?1:2);w>=l.depth-3;w--)m=B.from(l.node(w).copy(m));const b=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;m=m.append(B.from(a.createAndFill(null,b)||void 0));const y=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3;n.replace(l.before(g?void 0:-1),l.after(-y),new J(m,g?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(l.pos+(g?3:2)))),r(n.scrollIntoView())}return!0}if(u.attrs.closed&&l.sameParent(c)&&c.pos===c.end()){if(r){const g=l.after(-1),m=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill())||void 0,b=a.createAndFill(null,m);b&&(n.insert(g,b),n.setSelection(ye.near(n.doc.resolve(g+1)))),n.delete(l.pos,c.pos),r(n.scrollIntoView())}return!0}const d=Object.fromEntries(Object.entries(u.attrs).filter(([g])=>!t.includes(g))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,h={...l.node().attrs};n.delete(l.pos,c.pos);const p=f?[{type:a,attrs:d},{type:f,attrs:h}]:[{type:a,attrs:d}];return Oa(n.doc,l.pos,2)?(r&&r(n.split(l.pos,2,p).scrollIntoView()),!0):!1}}function TX(e,t,n,r){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,B.from(n.create())))return!1;const l=[];for(let h=0;h<o.childCount;h++){const p=o.child(h);if(!r.validContent(p.content))return!1;const g=r.createChecked(null,p.content);l.push(g)}const c=n.createChecked(null,l),u=t.pos,d=u+o.nodeSize,f=e.selection.from;return e.replaceRangeWith(u,d,c),e.setSelection(e.selection.constructor.near(e.doc.resolve(f))),!0}function _X({listType:e,itemType:t,tr:n,range:r}){var o;const i=r.parent,s=n.doc.slice(r.start,r.end);if(i.type===e&&((o=s.content.firstChild)==null?void 0:o.type)===t)return!1;const a=[];for(let c=0;c<s.content.childCount;c++){const u=s.content.child(c);if(!t.validContent(u.content))return!1;const d=t.createChecked(null,u.content);a.push(d)}const l=e.createChecked(null,a);return n.replaceRange(r.start,r.end,new J(B.from(l),0,0)),!0}function Qa({listType:e,itemType:t,tr:n}){const r=Kf(n.selection);if(!r)return!1;const o=r.startIndex===0,{from:i,to:s}=n.selection;return _X({listType:e,itemType:t,tr:n,range:r})?(n.setSelection(ye.between(n.doc.resolve(o?i:i+2),n.doc.resolve(o?s:s+2))),n.scrollIntoView(),!0):!1}function MX(e,t,n){const r=e.tr,o=n.parent,i=r.mapping.maps.length;for(let p=n.end,g=n.endIndex-1,m=n.startIndex;g>m;g--)p-=o.child(g).nodeSize,r.delete(p-1,p+1);const s=r.doc.resolve(n.start),a=s.nodeAfter;if(!a||r.mapping.slice(i).map(n.end)!==n.start+a.nodeSize)return!1;const l=n.startIndex===0,c=n.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?B.empty:B.from(o))))return!1;const f=s.pos,h=f+a.nodeSize;return r.step(new St(f-(l?1:0),h+(c?1:0),f+1,h-1,new J((l?B.empty:B.from(o.copy(B.empty))).append(c?B.empty:B.from(o.copy(B.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}function dM(e,t){const n=t||e.selection.$from;let r=[],o,i,s,a;for(let c=n.depth;c>=0;c--){if(i=n.node(c),o=n.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&ji(s)){const u=n.before(c+1);r.push(u)}if(o=n.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&ji(s)){const u=n.after(c+1);r.push(u)}}r=[...new Set(r)].sort((c,u)=>u-c);let l=!1;for(const c of r)Ou(e.doc,c)&&(e.join(c),l=!0);return l}function fM(e){return t=>{const{dispatch:n,tr:r}=t,o=ay(r,t.state),i=DX(e,r.selection);return i?(n&&MX(o,n,i),!0):!1}}function DX(e,t){const{$from:n,$to:r}=t;return n.blockRange(r,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function Kf(e){const{$from:t,$to:n}=e;return t.blockRange(n,ji)}function RX(e){const t=e.selection.$from,n=t.blockRange();if(!n||!Ti(n.parent)||n.startIndex!==0)return!1;const r=t.node(n.depth-2),o=t.index(n.depth),i=t.index(n.depth-1),s=t.index(n.depth-2),a=r.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&ji(a)&&l&&Ti(l))return Qa({listType:a.type,itemType:l.type,tr:e});if(Ti(r)){const c=r,u=t.node(n.depth-3);if(ji(u))return Qa({listType:u.type,itemType:c.type,tr:e})}return!1}function Lw({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ti(n.parent)||n.startIndex!==0)return!1}{const t=e.state.tr;RX(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ti(n.parent)||n.startIndex!==0)return!1;const r=t.index(n.depth),o=t.index(n.depth-1),i=t.index(n.depth-2),s=n.depth-2>=1&&Ti(t.node(n.depth-2));r===0&&o===0&&i<=1&&s&&wX(n.parent.type)(e.state,e.dispatch)}return I_(e.state,e.dispatch,e),!0}function hM({node:e,mark:t,updateDOM:n,updateMark:r}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(Li.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(Li.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,n(e,s),r(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function IX(e,t){const n=e.node(t.depth-1),r=e.node(t.depth-2);return!Ti(n)||!ji(r)?!1:{parentItem:n,parentList:r}}function NX(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return o<i?(e.step(new St(o-1,i,o,i,new J(B.from(r.type.create(null,n.copy())),1,0),1,!0)),new Ms(e.doc.resolve(t.$from.pos),e.doc.resolve(i),t.depth)):t}function PX(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth-1);return o+1<i?(e.step(new St(o-1,i,o+1,i,new J(B.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new Ms(e.selection.$from,e.selection.$to,t.depth)):t}function AX(e,t,n,r){return Qa({listType:n.type,itemType:r.type,tr:e})?new Ms(e.selection.$from,e.selection.$to,t.depth):t}function LX(e){let t=Kf(e.selection);if(!t)return!1;const n=IX(e.selection.$from,t);if(!n)return!1;const{parentItem:r,parentList:o}=n;t=NX(e,t),t=PX(e,t),t=AX(e,t,o,r);const i=hl(t);return typeof i!="number"||(e.lift(t,i),t=Kf(e.selection),t&&dM(e,e.doc.resolve(t.end-2))),!0}var jX=({tr:e,dispatch:t})=>LX(e)?(t==null||t(e.scrollIntoView()),!0):!1;function $X(e,t,n){let r,o,i,s;const a=t.doc;if(n.startIndex>=1){r=e.child(n.startIndex-1),o=e,s=a.resolve(n.start).start(n.depth),i=s+1;for(let l=0;l<n.startIndex-1;l++)i+=o.child(l).nodeSize}else{const l=t.index(n.depth-1);if(l>=1){const c=t.node(n.depth-1),u=t.start(n.depth-1);if(o=c.child(l-1),!ji(o))return!1;s=u+1;for(let d=0;d<l-1;d++)s+=c.child(d).nodeSize;if(r=o.child(o.childCount-1),i=s+o.nodeSize-r.nodeSize-1,!Ti(r))return!1}else return!1}return{previousItem:r,previousList:o,previousItemStart:i,previousListStart:s}}function zX(e,t,n){let r,o;const i=n.start,s=t.depth>=n.depth+2?t.end(n.depth+2):n.end-1,a=n.end;return s+1>=a?(r=e.slice(i,a),o=null):(r=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:r,unselectedSlice:o}}function BX(e){const{$from:t,$to:n}=e.selection,r=Kf(e.selection);if(!r)return!1;const o=e.doc.resolve(r.start).node();if(!ji(o))return!1;const i=$X(o,t,r);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=zX(e.doc,n,r),d=s.content.append(B.fromArray([o.copy(c.content)])).append(u?u.content:B.empty);e.deleteRange(r.start,r.end);const f=l+s.nodeSize-2,h=s.copy(d);return h.check(),e.replaceRangeWith(l-1,f+1,h),e.setSelection(a===o?ye.between(e.doc.resolve(t.pos),e.doc.resolve(n.pos)):ye.between(e.doc.resolve(t.pos-2),e.doc.resolve(n.pos-2))),!0}var FX=({tr:e,dispatch:t})=>BX(e)?(t==null||t(e.scrollIntoView()),!0):!1,pM=class extends Je{get name(){return"listItemShared"}createKeymap(){const e={Tab:FX,"Shift-Tab":jX,Backspace:Lw,"Mod-Backspace":Lw};if(Pi.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr;return dM(r)?r:null}}}},el=class extends Do{get name(){return"listItem"}createTags(){return[De.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Be.Lowest},...t.parseDOM??[]],toDOM:n=>["li",e.dom(n),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,n)=>{const r=document.createElement("div");return r.classList.add(Li.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable="false",r.addEventListener("click",()=>{if(r.classList.contains("disabled"))return;const o=n(),i=he.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),hM({mark:r,node:e,updateDOM:HX,updateMark:VX})}:{}}createKeymap(){return{Enter:uM(this.type)}}createExtensions(){return[new pM]}toggleListItemClosed(e){return({state:{tr:t,selection:n},dispatch:r})=>{if(!Jh(n)||n.node.type.name!==this.name)return!1;const{node:o,from:i}=n;return e=B6(e)?e:!o.attrs.closed,r==null||r(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return fM(e??this.type)}};ar([ce()],el.prototype,"toggleListItemClosed",1);ar([ce()],el.prototype,"liftListItemOutOfList",1);el=ar([ze({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],el);function HX(e,t){e.attrs.closed?t.classList.add(Li.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(Li.COLLAPSIBLE_LIST_ITEM_CLOSED)}function VX(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var eu=class extends Do{get name(){return"bulletList"}createTags(){return[De.Block,De.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["ul",e.dom(n),0]}}createNodeViews(){return this.options.enableSpine?(e,t,n)=>{var r;const o=document.createElement("div");o.style.position="relative";const i=n(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((r=a==null?void 0:a.type)==null?void 0:r.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(Li.LIST_SPINE),u.addEventListener("click",d=>{const f=n(),h=t.state.doc.resolve(f+1),p=h.start(h.depth-1),g=he.create(t.state.doc,p-1);t.dispatch(t.state.tr.setSelection(g)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(Li.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new el({priority:Be.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Sy(this.type,Qe(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[J0(e,this.type),new Nr(e,(t,n,r,o)=>{const i=t.tr;return i.deleteRange(r,o),Qa({listType:this.type,itemType:Qe(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};ar([ce({icon:"listUnordered",label:({t:e})=>e(X0.BULLET_LIST_LABEL)})],eu.prototype,"toggleBulletList",1);ar([sr({shortcut:Q.BulletList,command:"toggleBulletList"})],eu.prototype,"listShortcut",1);eu=ar([ze({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],eu);var tu=class extends Do{get name(){return"orderedList"}createTags(){return[De.Block,De.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:n=>On(n)?{...e.parse(n),order:+(n.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:n=>{const r=e.dom(n);return n.attrs.order===1?["ol",r,0]:["ol",{...r,start:n.attrs.order},0]}}}createExtensions(){return[new el({priority:Be.Low})]}toggleOrderedList(){return Sy(this.type,Qe(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[J0(e,this.type,t=>({order:+Qe(t,1)}),(t,n)=>n.childCount+n.attrs.order===+Qe(t,1)),new Nr(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Qa({listType:this.type,itemType:Qe(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+Qe(n,1);if(a!==1){const l=Gc({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};ar([ce({icon:"listOrdered",label:({t:e})=>e(X0.ORDERED_LIST_LABEL)})],tu.prototype,"toggleOrderedList",1);ar([sr({shortcut:Q.OrderedList,command:"toggleOrderedList"})],tu.prototype,"listShortcut",1);tu=ar([ze({})],tu);var gM=class extends Do{get name(){return"taskListItem"}createTags(){return[De.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:n=>{let r=!1;return On(n)&&n.getAttribute("data-checked")!==null&&(r=!0),{checked:r,...e.parse(n)}},priority:Be.Medium},...t.parseDOM??[]],toDOM:n=>["li",{...e.dom(n),"data-task-list-item":"","data-checked":n.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,n)=>{const r=document.createElement("input");return r.type="checkbox",r.classList.add(Li.LIST_ITEM_CHECKBOX),r.contentEditable="false",r.addEventListener("click",o=>{t.editable||o.preventDefault()}),r.addEventListener("change",()=>{const o=n(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),r.checked=e.attrs.checked,hM({node:e,mark:r,updateDOM:WX,updateMark:UX})}}createKeymap(){return{Enter:uM(this.type)}}createExtensions(){return[new pM]}toggleCheckboxChecked(e){let t,n;return typeof e=="boolean"?t=e:e&&(t=e.checked,n=e.$pos),({tr:r,dispatch:o})=>{const i=Gc({selection:n??r.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(r.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[J0(e,this.type,t=>({checked:["x","X"].includes(mw(t,2))})),new Nr(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Qa({listType:Qe(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(mw(n,2));if(a){const l=Gc({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};ar([ce()],gM.prototype,"toggleCheckboxChecked",1);function WX(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function UX(e,t){t.checked=!!e.attrs.checked}var mM=class extends Do{get name(){return"taskList"}createTags(){return[De.Block,De.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Be.Medium},...t.parseDOM??[]],toDOM:n=>["ul",{...e.dom(n),"data-task-list":""},0]}}createExtensions(){return[new gM({})]}toggleTaskList(){return Sy(this.type,Qe(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};ar([ce({icon:"checkboxMultipleLine",label:({t:e})=>e(X0.TASK_LIST_LABEL)})],mM.prototype,"toggleTaskList",1);ar([sr({shortcut:Q.TaskList,command:"toggleTaskList"})],mM.prototype,"listShortcut",1);function qX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}function xv(e,t){return Array(t+1).join(e)}function KX(e){return e.replace(/^\n*/,"")}function GX(e){for(var t=e.length;t>0&&e[t-1]===`
138
+ `;)t--;return e.substring(0,t)}var YX=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Cy(e){return Ey(e,YX)}var vM=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function yM(e){return Ey(e,vM)}function XX(e){return xM(e,vM)}var bM=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function JX(e){return Ey(e,bM)}function ZX(e){return xM(e,bM)}function Ey(e,t){return t.indexOf(e.nodeName)>=0}function xM(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var Qt={};Qt.paragraph={filter:"p",replacement:function(e){return`
139
+
140
+ `+e+`
141
+
142
+ `}};Qt.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+`
143
+ `}};Qt.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));if(n.headingStyle==="setext"&&r<3){var o=xv(r===1?"=":"-",e.length);return`
144
+
145
+ `+e+`
146
+ `+o+`
147
+
148
+ `}else return`
149
+
150
+ `+xv("#",r)+" "+e+`
151
+
152
+ `}};Qt.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),`
153
+
154
+ `+e+`
155
+
156
+ `}};Qt.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return n.nodeName==="LI"&&n.lastElementChild===t?`
157
+ `+e:`
158
+
159
+ `+e+`
160
+
161
+ `}};Qt.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,`
162
+ `).replace(/\n/gm,`
163
+ `);var r=n.bulletListMarker+" ",o=t.parentNode;if(o.nodeName==="OL"){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,t);r=(i?Number(i)+s:s+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?`
164
+ `:"")}};Qt.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){return`
165
+
166
+ `+t.firstChild.textContent.replace(/\n/g,`
167
+ `)+`
168
+
169
+ `}};Qt.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){for(var r=t.firstChild.getAttribute("class")||"",o=(r.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=n.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=xv(s,a);return`
170
+
171
+ `+u+o+`
172
+ `+i.replace(/\n$/,"")+`
173
+ `+u+`
174
+
175
+ `}};Qt.horizontalRule={filter:"hr",replacement:function(e,t,n){return`
176
+
177
+ `+n.hr+`
178
+
179
+ `}};Qt.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=Gf(t.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+e+"]("+n+r+")"}};Qt.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,n){var r=t.getAttribute("href"),o=Gf(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+r+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+r+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+r+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=`
180
+
181
+ `+this.references.join(`
182
+ `)+`
183
+
184
+ `,this.references=[]),t}};Qt.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}};Qt.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}};Qt.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+t+e+t+n}};Qt.image={filter:"img",replacement:function(e,t){var n=Gf(t.getAttribute("alt")),r=t.getAttribute("src")||"",o=Gf(t.getAttribute("title")),i=o?' "'+o+'"':"";return r?"!["+n+"]("+r+i+")":""}};function Gf(e){return e?e.replace(/(\n+\s*)+/g,`
185
+ `):""}function wM(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}wM.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=_g(this.array,e,this.options))||(t=_g(this._keep,e,this.options))||(t=_g(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function _g(e,t,n){for(var r=0;r<e.length;r++){var o=e[r];if(QX(o,t,n))return o}}function QX(e,t,n){var r=e.filter;if(typeof r=="string"){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(e,t,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function eJ(e){var t=e.element,n=e.isBlock,r=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=jw(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=Mg(l);continue}l.data=c,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=Mg(l);continue}var u=jw(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||Mg(i))}}function Mg(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function jw(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var ky=typeof window<"u"?window:{};function tJ(){var e=ky.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function nJ(){var e=function(){};return rJ()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function rJ(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{ky.ActiveXObject&&(e=!0)}return e}var oJ=tJ()?ky.DOMParser:nJ();function iJ(e,t){var n;if(typeof e=="string"){var r=sJ().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=e.cloneNode(!0);return eJ({element:n,isBlock:Cy,isVoid:yM,isPre:t.preformattedCode?aJ:null}),n}var Dg;function sJ(){return Dg=Dg||new oJ,Dg}function aJ(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function lJ(e,t){return e.isBlock=Cy(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=cJ(e),e.flankingWhitespace=uJ(e,t),e}function cJ(e){return!yM(e)&&!JX(e)&&/^\s*$/i.test(e.textContent)&&!XX(e)&&!ZX(e)}function uJ(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=dJ(e.textContent);return n.leadingAscii&&$w("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&$w("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function dJ(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function $w(e,t,n){var r,o,i;return e==="left"?(r=t.previousSibling,o=/ $/):(r=t.nextSibling,o=/^ /),r&&(r.nodeType===3?i=o.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!Cy(r)&&(i=o.test(r.textContent))),i}var fJ=Array.prototype.reduce,hJ=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Yf(e){if(!(this instanceof Yf))return new Yf(e);var t={rules:Qt,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
186
+
187
+ `:""},keepReplacement:function(n,r){return r.isBlock?`
188
+
189
+ `+r.outerHTML+`
190
+
191
+ `:r.outerHTML},defaultReplacement:function(n,r){return r.isBlock?`
192
+
193
+ `+n+`
194
+
195
+ `:n}};this.options=qX({},t,e),this.rules=new wM(this.options)}Yf.prototype={turndown:function(e){if(!mJ(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=SM.call(this,new iJ(e,this.options));return pJ.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return hJ.reduce(function(t,n){return t.replace(n[0],n[1])},e)}};function SM(e){var t=this;return fJ.call(e.childNodes,function(n,r){r=new lJ(r,t.options);var o="";return r.nodeType===3?o=r.isCode?r.nodeValue:t.escape(r.nodeValue):r.nodeType===1&&(o=gJ.call(t,r)),CM(n,o)},"")}function pJ(e){var t=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(e=CM(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function gJ(e){var t=this.rules.forNode(e),n=SM.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function CM(e,t){var n=GX(e),r=KX(t),o=Math.max(e.length-n.length,t.length-r.length),i=`
196
+
197
+ `.substring(0,o);return n+i+r}function mJ(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}function EM(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Vs=EM();function vJ(e){Vs=e}const kM=/[&<>"']/,yJ=new RegExp(kM.source,"g"),OM=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,bJ=new RegExp(OM.source,"g"),xJ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},zw=e=>xJ[e];function Yt(e,t){if(t){if(kM.test(e))return e.replace(yJ,zw)}else if(OM.test(e))return e.replace(bJ,zw);return e}const wJ=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function TM(e){return e.replace(wJ,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const SJ=/(^|[^\[])\^/g;function Fe(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(SJ,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const CJ=/[^\w:]/g,EJ=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Bw(e,t,n){if(e){let r;try{r=decodeURIComponent(TM(n)).replace(CJ,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!EJ.test(n)&&(n=_J(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const id={},kJ=/^[^:]+:\/*[^/]*$/,OJ=/^([^:]+:)[\s\S]*$/,TJ=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _J(e,t){id[" "+e]||(kJ.test(e)?id[" "+e]=e+"/":id[" "+e]=Yd(e,"/",!0)),e=id[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(OJ,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(TJ,"$1")+t:e+t}const Xf={exec:function(){}};function Fw(e,t){const n=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Yd(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function MJ(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function DJ(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Hw(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Vw(e,t,n,r){const o=t.href,i=t.title?Yt(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:Yt(s)}}function RJ(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
198
+ `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
199
+ `)}class Oy{constructor(t){this.options=t||Vs}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Yd(r,`
200
+ `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=RJ(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=Yd(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,o,i,s,a,l,c,u,d,f,h,p,g=n[1].trim();const m=g.length>1,b={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const y=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=y.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),u=n[2].split(`
201
+ `,1)[0].replace(/^\t+/,S=>" ".repeat(3*S.length)),d=t.split(`
202
+ `,1)[0],this.options.pedantic?(s=2,h=u.trimLeft()):(s=n[2].search(/[^ ]/),s=s>4?1:s,h=u.slice(s),s+=n[1].length),l=!1,!u&&/^ *$/.test(d)&&(r+=d+`
203
+ `,t=t.substring(d.length+1),p=!0),!p){const S=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),C=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(f=t.split(`
204
+ `,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(E.test(d)||k.test(d)||S.test(d)||C.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())h+=`
205
+ `+d.slice(s);else{if(l||u.search(/[^ ]/)>=4||E.test(u)||k.test(u)||C.test(u))break;h+=`
206
+ `+d}!l&&!d.trim()&&(l=!0),r+=f+`
207
+ `,t=t.substring(f.length+1),u=d.slice(s)}}b.loose||(c?b.loose=!0:/\n *\n *$/.test(r)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(h),o&&(i=o[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:r,task:!!o,checked:i,loose:!1,text:h}),b.raw+=r}b.items[b.items.length-1].raw=r.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const w=b.items.length;for(a=0;a<w;a++)if(this.lexer.state.top=!1,b.items[a].tokens=this.lexer.blockTokens(b.items[a].text,[]),!b.loose){const S=b.items[a].tokens.filter(E=>E.type==="space"),C=S.length>0&&S.some(E=>/\n.*\n/.test(E.raw));b.loose=C}if(b.loose)for(a=0;a<w;a++)b.items[a].loose=!0;return b}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const o=this.options.sanitizer?this.options.sanitizer(n[0]):Yt(n[0]);r.type="paragraph",r.text=o,r.tokens=this.lexer.inline(o)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:Fw(n[1]).map(o=>({text:o})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
208
+ `):[]};if(r.header.length===r.align.length){r.raw=n[0];let o=r.align.length,i,s,a,l;for(i=0;i<o;i++)/^ *-+: *$/.test(r.align[i])?r.align[i]="right":/^ *:-+: *$/.test(r.align[i])?r.align[i]="center":/^ *:-+ *$/.test(r.align[i])?r.align[i]="left":r.align[i]=null;for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=Fw(r.rows[i],r.header.length).map(c=>({text:c}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
209
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:Yt(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Yt(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=Yd(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=MJ(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),Vw(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Vw(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(r===""||this.rules.inline.punctuation.exec(r))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+s);(o=d.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=Yt(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const r=this.rules.inline.autolink.exec(t);if(r){let o,i;return r[2]==="@"?(o=Yt(this.options.mangle?n(r[1]):r[1]),i="mailto:"+o):(o=Yt(r[1]),i=o),{type:"link",raw:r[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let o,i;if(r[2]==="@")o=Yt(this.options.mangle?n(r[0]):r[0]),i="mailto:"+o;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(s!==r[0]);o=Yt(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Yt(r[0]):r[0]:o=Yt(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:o}}}}const de={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Xf,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;de.def=Fe(de.def).replace("label",de._label).replace("title",de._title).getRegex();de.bullet=/(?:[*+-]|\d{1,9}[.)])/;de.listItemStart=Fe(/^( *)(bull) */).replace("bull",de.bullet).getRegex();de.list=Fe(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex();de._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";de._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;de.html=Fe(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();de.paragraph=Fe(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.blockquote=Fe(de.blockquote).replace("paragraph",de.paragraph).getRegex();de.normal={...de};de.gfm={...de.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};de.gfm.table=Fe(de.gfm.table).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.gfm.paragraph=Fe(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",de.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.pedantic={...de.normal,html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Fe(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
210
+ ]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Xf,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Xf,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};te._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";te.punctuation=Fe(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=Fe(de._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=Fe(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=Fe(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=Fe(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;te.autolink=Fe(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=Fe(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=Fe(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=Fe(te.reflink).replace("label",te._label).replace("ref",de._label).getRegex();te.nolink=Fe(te.nolink).replace("ref",de._label).getRegex();te.reflinkSearch=Fe(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal={...te};te.pedantic={...te.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()};te.gfm={...te.normal,escape:Fe(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};te.gfm.url=Fe(te.gfm.url,"i").replace("email",te.gfm._extended_email).getRegex();te.breaks={...te.gfm,br:Fe(te.br).replace("{2,}","*").getRegex(),text:Fe(te.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function IJ(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Ww(e){let t="",n,r;const o=e.length;for(n=0;n<o;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class $i{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Vs,this.options.tokenizer=this.options.tokenizer||new Oy,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:de.normal,inline:te.normal};this.options.pedantic?(n.block=de.pedantic,n.inline=te.pedantic):this.options.gfm&&(n.block=de.gfm,this.options.breaks?n.inline=te.breaks:n.inline=te.gfm),this.tokenizer.rules=n}static get rules(){return{block:de,inline:te}}static lex(t,n){return new $i(n).lex(t)}static lexInline(t,n){return new $i(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
211
+ `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
212
+ `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
213
+ `+r.raw,o.text+=`
214
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
215
+ `+r.raw,o.text+=`
216
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let c;this.options.extensions.startBlock.forEach(function(u){c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
217
+ `+r.raw,o.text+=`
218
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
219
+ `+r.raw,o.text+=`
220
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+Hw("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+Hw("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,s,c)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,Ww)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,Ww))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(h){f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i,IJ)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class Ty{constructor(t){this.options=t||Vs}code(t,n,r){const o=(n||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(r=!0,t=i)}return t=t.replace(/\n$/,"")+`
221
+ `,o?'<pre><code class="'+this.options.langPrefix+Yt(o)+'">'+(r?t:Yt(t,!0))+`</code></pre>
222
+ `:"<pre><code>"+(r?t:Yt(t,!0))+`</code></pre>
223
+ `}blockquote(t){return`<blockquote>
224
+ ${t}</blockquote>
225
+ `}html(t){return t}heading(t,n,r,o){if(this.options.headerIds){const i=this.options.headerPrefix+o.slug(r);return`<h${n} id="${i}">${t}</h${n}>
226
+ `}return`<h${n}>${t}</h${n}>
227
+ `}hr(){return this.options.xhtml?`<hr/>
228
+ `:`<hr>
229
+ `}list(t,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
230
+ `+t+"</"+o+`>
231
+ `}listitem(t){return`<li>${t}</li>
232
+ `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
233
+ `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
234
+ <thead>
235
+ `+t+`</thead>
236
+ `+n+`</table>
237
+ `}tablerow(t){return`<tr>
238
+ ${t}</tr>
239
+ `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
240
+ `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=Bw(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let o='<a href="'+t+'"';return n&&(o+=' title="'+n+'"'),o+=">"+r+"</a>",o}image(t,n,r){if(t=Bw(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let o=`<img src="${t}" alt="${r}"`;return n&&(o+=` title="${n}"`),o+=this.options.xhtml?"/>":">",o}text(t){return t}}class _M{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class MM{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,o=0;if(this.seen.hasOwnProperty(r)){o=this.seen[t];do o++,r=t+"-"+o;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=o,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}let Iu=class wv{constructor(t){this.options=t||Vs,this.options.renderer=this.options.renderer||new Ty,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _M,this.slugger=new MM}static parse(t,n){return new wv(n).parse(t)}static parseInline(t,n){return new wv(n).parseInline(t)}parse(t,n=!0){let r="",o,i,s,a,l,c,u,d,f,h,p,g,m,b,y,w,S,C,E;const k=t.length;for(o=0;o<k;o++){if(h=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(E=this.options.extensions.renderers[h.type].call({parser:this},h),E!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=E||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,TM(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",u="",a=h.header.length,i=0;i<a;i++)u+=this.renderer.tablecell(this.parseInline(h.header[i].tokens),{header:!0,align:h.align[i]});for(d+=this.renderer.tablerow(u),f="",a=h.rows.length,i=0;i<a;i++){for(c=h.rows[i],u="",l=c.length,s=0;s<l;s++)u+=this.renderer.tablecell(this.parseInline(c[s].tokens),{header:!1,align:h.align[s]});f+=this.renderer.tablerow(u)}r+=this.renderer.table(d,f);continue}case"blockquote":{f=this.parse(h.tokens),r+=this.renderer.blockquote(f);continue}case"list":{for(p=h.ordered,g=h.start,m=h.loose,a=h.items.length,f="",i=0;i<a;i++)y=h.items[i],w=y.checked,S=y.task,b="",y.task&&(C=this.renderer.checkbox(w),m?y.tokens.length>0&&y.tokens[0].type==="paragraph"?(y.tokens[0].text=C+" "+y.tokens[0].text,y.tokens[0].tokens&&y.tokens[0].tokens.length>0&&y.tokens[0].tokens[0].type==="text"&&(y.tokens[0].tokens[0].text=C+" "+y.tokens[0].tokens[0].text)):y.tokens.unshift({type:"text",text:C}):b+=C),b+=this.parse(y.tokens,m),f+=this.renderer.listitem(b,S,w);r+=this.renderer.list(f,p,g);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(f=h.tokens?this.parseInline(h.tokens):h.text;o+1<k&&t[o+1].type==="text";)h=t[++o],f+=`
241
+ `+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(f):f;continue}default:{const _='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(_);return}else throw new Error(_)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",o,i,s;const a=t.length;for(o=0;o<a;o++){if(i=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(s=this.options.extensions.renderers[i.type].call({parser:this},i),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))){r+=s||"";continue}switch(i.type){case"escape":{r+=n.text(i.text);break}case"html":{r+=n.html(i.text);break}case"link":{r+=n.link(i.href,i.title,this.parseInline(i.tokens,n));break}case"image":{r+=n.image(i.href,i.title,i.text);break}case"strong":{r+=n.strong(this.parseInline(i.tokens,n));break}case"em":{r+=n.em(this.parseInline(i.tokens,n));break}case"codespan":{r+=n.codespan(i.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(i.tokens,n));break}case"text":{r+=n.text(i.text);break}default:{const l='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return r}};class Jf{constructor(t){this.options=t||Vs}preprocess(t){return t}postprocess(t){return t}}wn(Jf,"passThroughHooks",new Set(["preprocess","postprocess"]));function NJ(e,t,n){return r=>{if(r.message+=`
242
+ Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+Yt(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(o);if(n){n(null,o);return}return o}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function DM(e,t){return(n,r,o)=>{typeof r=="function"&&(o=r,r=null);const i={...r};r={...ue.defaults,...i};const s=NJ(r.silent,r.async,o);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(DJ(r),r.hooks&&(r.hooks.options=r),o){const a=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{r.walkTokens&&ue.walkTokens(l,r.walkTokens),f=t(l,r),r.hooks&&(f=r.hooks.postprocess(f))}catch(h){d=h}return r.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete r.highlight,!l.length))return c();let u=0;ue.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,h){if(f)return c(f);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(ue.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&ue.walkTokens(a,r.walkTokens);let l=t(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return s(a)}}}function ue(e,t,n){return DM($i.lex,Iu.parse)(e,t,n)}ue.options=ue.setOptions=function(e){return ue.defaults={...ue.defaults,...e},vJ(ue.defaults),ue};ue.getDefaults=EM;ue.defaults=Vs;ue.use=function(...e){const t=ue.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=ue.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){const o=ue.defaults.renderer||new Ty;for(const i in n.renderer){const s=o[i];o[i]=(...a)=>{let l=n.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.renderer=o}if(n.tokenizer){const o=ue.defaults.tokenizer||new Oy;for(const i in n.tokenizer){const s=o[i];o[i]=(...a)=>{let l=n.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.tokenizer=o}if(n.hooks){const o=ue.defaults.hooks||new Jf;for(const i in n.hooks){const s=o[i];Jf.passThroughHooks.has(i)?o[i]=a=>{if(ue.defaults.async)return Promise.resolve(n.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=n.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=n.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}r.hooks=o}if(n.walkTokens){const o=ue.defaults.walkTokens;r.walkTokens=function(i){let s=[];return s.push(n.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}ue.setOptions(r)})};ue.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(ue,r)),r.type){case"table":{for(const o of r.header)n=n.concat(ue.walkTokens(o.tokens,t));for(const o of r.rows)for(const i of o)n=n.concat(ue.walkTokens(i.tokens,t));break}case"list":{n=n.concat(ue.walkTokens(r.items,t));break}default:ue.defaults.extensions&&ue.defaults.extensions.childTokens&&ue.defaults.extensions.childTokens[r.type]?ue.defaults.extensions.childTokens[r.type].forEach(function(o){n=n.concat(ue.walkTokens(r[o],t))}):r.tokens&&(n=n.concat(ue.walkTokens(r.tokens,t)))}return n};ue.parseInline=DM($i.lexInline,Iu.parseInline);ue.Parser=Iu;ue.parser=Iu.parse;ue.Renderer=Ty;ue.TextRenderer=_M;ue.Lexer=$i;ue.lexer=$i.lex;ue.Tokenizer=Oy;ue.Slugger=MM;ue.Hooks=Jf;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Iu.parse;$i.lex;var PJ=Object.defineProperty,AJ=Object.getOwnPropertyDescriptor,sp=(e,t,n,r)=>{for(var o=r>1?void 0:r?AJ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&PJ(t,n,o),o},LJ=nU(Yf);function jJ(e){return zJ.turndown(e)}function Rg(e){const t=e.parentNode;if(!On(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!RM(t))return!1;const n=[...e.childNodes];return n.every(r=>r.nodeName==="TH")&&n.some(r=>!!r.textContent)}function Zf(e){return On(e)&&e.matches("th[data-controller-cell]")}function $J(e){const t=e.parentNode;return!On(t)||t.nodeName!=="TABLE"&&!RM(t)?!1:[...e.childNodes].every(r=>Zf(r))}function RM(e){var t;if(e.nodeName!=="TBODY")return!1;const n=e.previousSibling;return n?On(n)&&n.nodeName==="THEAD"&&!((t=n.textContent)!=null&&t.trim()):!0}function Uw(e){const t=e.closest("table");if(!t)return!1;const{parentNode:n}=t;return n?!!n.closest("table"):!0}function qw(e,t){var n;const r=[];for(const s of((n=t.parentNode)==null?void 0:n.childNodes)??[])Zf(s)||r.push(s);return`${(r.indexOf(t)===0?"| ":" ")+e.trim()} |`}var zJ=new LJ({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Zf(t)?"":qw(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let n="";const r={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Zf(i));if(Rg(t))for(const i of o){if(!On(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=r[a]||s),n+=qw(s,i)}return`
243
+ ${e}${n?`
244
+ ${n}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||Uw(e))return!1;const t=[...e.rows].filter(n=>!$J(n));return Rg(t[0])},replacement:e=>(e=e.replace(`
245
+
246
+ `,`
247
+ `),`
248
+
249
+ ${e}
250
+
251
+ `)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!Rg(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&Uw(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,n)=>{var r,o;fe(On(t.firstChild),{code:K.EXTENSION,message:`Invalid node \`${(r=t.firstChild)==null?void 0:r.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return`
252
+
253
+ ${n.fence}${s}
254
+ ${t.firstChild.textContent}
255
+ ${n.fence}
256
+
257
+ `}});ue.use({renderer:{list(e,t,n){return t?`<ol ${n!==1?`start="${n}"`:""}>
258
+ ${e}</ol>
259
+ `:`<ul ${e.startsWith("<li data-task-list-item ")?"data-task-list":""}>
260
+ ${e}</ul>
261
+ `},listitem(e,t,n){return t?`<li data-task-list-item ${n?"data-checked":""}>${e}</li>
262
+ `:`<li>${e}</li>
263
+ `}}});function BJ(e,t){const n=ue(e,{gfm:!0,smartLists:!0,xhtml:!0});return t?t(n):n}var tl=class extends Je{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const n=document.createElement("div"),r=Mo.fromSchema(this.store.schema);return n.append(r.serializeFragment(t.content)),this.options.htmlToMarkdown(n.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return n=>{const{state:r}=n;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("<p><")&&o.endsWith(`</p>
264
+ `)?o.slice(3,-5):`<div>${o}</div>`;const i=this.store.stringHandlers.html({content:o,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(n)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};sp([ce()],tl.prototype,"insertMarkdown",1);sp([et()],tl.prototype,"getMarkdown",1);sp([ce()],tl.prototype,"toggleBoldMarkdown",1);tl=sp([ze({defaultOptions:{htmlToMarkdown:jJ,markdownToHtml:BJ,htmlSanitizer:void 0,activeNodes:[De.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],tl);var FJ=Object.defineProperty,HJ=Object.getOwnPropertyDescriptor,ap=(e,t,n,r)=>{for(var o=r>1?void 0:r?HJ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&FJ(t,n,o),o},VJ={icon:"paragraph",label:({t:e})=>e(Lf.INSERT_LABEL),description:({t:e})=>e(Lf.INSERT_DESCRIPTION)},WJ={icon:"paragraph",label:({t:e})=>e(Lf.CONVERT_LABEL),description:({t:e})=>e(Lf.CONVERT_DESCRIPTION)},Ps=class extends Do{get name(){return"paragraph"}createTags(){return[De.LastNodeCompatible,De.TextBlock,De.Block,De.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:n=>({...e.parse(n)})},...t.parseDOM??[]],toDOM:n=>["p",e.dom(n),0]}}convertParagraph(e={}){const{attrs:t,selection:n,preserveAttrs:r}=e;return this.store.commands.setBlockNodeType.original(this.type,t,n,r)}insertParagraph(e,t={}){const{selection:n,attrs:r}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:n,attrs:r})}shortcut(e){return this.convertParagraph()(e)}};ap([ce(WJ)],Ps.prototype,"convertParagraph",1);ap([ce(VJ)],Ps.prototype,"insertParagraph",1);ap([sr({shortcut:Q.Paragraph,command:"convertParagraph"})],Ps.prototype,"shortcut",1);Ps=ap([ze({defaultPriority:Be.Medium})],Ps);var UJ=Object.getOwnPropertyDescriptor,qJ=(e,t,n,r)=>{for(var o=r>1?void 0:r?UJ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o},zi=class extends Je{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:dy(t.doc,{ignoreAttributes:!0})}),apply:(e,t,n,r)=>KJ({pluginState:t,tr:e,extension:this,state:r})},props:{decorations:e=>GJ({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=bn.EditorView&&this.store.updateAttributes()}};zi=qJ([ze({defaultOptions:{emptyNodeClass:gY.IS_EMPTY,placeholder:""}})],zi);function KJ(e){const{pluginState:t,extension:n,tr:r,state:o}=e;return r.docChanged?{...n.options,empty:dy(o.doc)}:t}function GJ(e){const{extension:t,state:n}=e,{empty:r}=t.pluginKey.getState(n),{emptyNodeClass:o,placeholder:i}=t.options;if(!r)return null;const s=[];return n.doc.descendants((a,l)=>{const c=Ye.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Re.create(n.doc,s)}var YJ=Object.getOwnPropertyDescriptor,XJ=(e,t,n,r)=>{for(var o=r>1?void 0:r?YJ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o},Sv=class extends Do{get name(){return"text"}createTags(){return[De.InlineNode]}createNodeSpec(){return{}}};Sv=XJ([ze({disableExtraAttributes:!0,defaultPriority:Be.Medium})],Sv);var JJ={...Za.defaultOptions,...Ps.defaultOptions,...eo.defaultOptions,excludeExtensions:[]};function ZJ(e={}){e={...JJ,...e};const{content:t,depth:n,getDispatch:r,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new eo({depth:n,getDispatch:r,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new Za({content:t})),a.text||l.push(new Sv),a.paragraph||l.push(new Ps),a.positioner||l.push(new Jc),a.gapCursor||l.push(new yv),a.events||l.push(new qf),l}var QJ=Object.getOwnPropertyDescriptor,eZ=(e,t,n,r)=>{for(var o=r>1?void 0:r?QJ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o},IM=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ae=(e,t,n)=>(IM(e,t,"read from private field"),n?n.call(e):t.get(e)),Pn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rn=(e,t,n,r)=>(IM(e,t,"write to private field"),t.set(e,n),n),dc,tZ=class{constructor(){this.portals=new Map,Pn(this,dc,tp()),this.on=e=>ae(this,dc).on("update",e),this.once=e=>{const t=ae(this,dc).on("update",n=>{t(),e(n)});return t}}update(){ae(this,dc).emit("update",this.portals)}render({Component:e,container:t}){const n=this.portals.get(t);this.portals.set(t,{Component:e,key:(n==null?void 0:n.key)??_f()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:_f()})}remove(e){this.portals.delete(e),this.update()}};dc=new WeakMap;var nZ=e=>{const{portals:t}=e;return U.createElement(U.Fragment,null,t.map(([n,{Component:r,key:o}])=>xr.createPortal(U.createElement(r,null),n,o)))};function rZ(e){const[t,n]=x.useState(()=>Array.from(e.portals.entries()));return x.useEffect(()=>e.on(r=>{n(Array.from(r.entries()))}),[e]),x.useMemo(()=>t,[t])}var Ze,fc,as,hc,Xd,pc,pa,gc,Jd,uo,rn,Cv,NM=class{constructor({getPosition:e,node:t,portalContainer:n,view:r,ReactComponent:o,options:i}){Pn(this,Ze,void 0),Pn(this,fc,[]),Pn(this,as,void 0),Pn(this,hc,void 0),Pn(this,Xd,void 0),Pn(this,pc,void 0),Pn(this,pa,void 0),Pn(this,gc,!1),Pn(this,Jd,void 0),Pn(this,uo,void 0),Pn(this,rn,void 0),Pn(this,Cv,l=>{l&&(fe(ae(this,uo),{code:K.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${ae(this,Ze).type.name}' which doesn't support content.`}),l.append(ae(this,uo)))}),this.Component=()=>{const l=ae(this,Xd);return fe(l,{code:K.REACT_NODE_VIEW,message:`The custom react node view provided for ${ae(this,Ze).type.name} doesn't have a valid ReactComponent`}),U.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:ae(this,as),getPosition:ae(this,pc),node:ae(this,Ze),forwardRef:ae(this,Cv),decorations:ae(this,fc)})},this.updateAttributes=l=>{if(!ae(this,as).editable)return;const c=ae(this,pc).call(this);if(c==null)return;const u=ae(this,as).state.tr.setNodeMarkup(c,void 0,{...ae(this,Ze).attrs,...l});ae(this,as).dispatch(u)},fe(Xe(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Rn(this,Ze,t),Rn(this,as,r),Rn(this,hc,n),Rn(this,Xd,o),Rn(this,pc,e),Rn(this,pa,i),Rn(this,rn,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Rn(this,Jd,s??void 0),Rn(this,uo,a),ae(this,uo)&&ae(this,rn).append(ae(this,uo)),this.setDomAttributes(ae(this,Ze),ae(this,rn)),this.Component.displayName=XO(`${ae(this,Ze).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:n,options:r}=e;return(o,i,s)=>new NM({options:r,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:n})}get selected(){return ae(this,gc)}get contentDOM(){return ae(this,Jd)}get dom(){return ae(this,rn)}renderComponent(){ae(this,hc).render({Component:this.Component,container:ae(this,rn)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=ae(this,pa),n=ae(this,Ze).isInline?document.createElement(t):document.createElement(e);return n.classList.add(`${nx(ae(this,Ze).type.name)}-node-view-wrapper`),n}createContentDom(){var e,t;if(ae(this,Ze).isLeaf)return;const n=(t=(e=ae(this,Ze).type.spec).toDOM)==null?void 0:t.call(e,ae(this,Ze));if(!n)return;const{contentDOM:r,dom:o}=Mo.renderSpec(document,n);let i;if(On(o))return i=o,o===r&&(i=document.createElement("span"),i.classList.add(`${nx(ae(this,Ze).type.name)}-node-view-content-wrapper`),i.append(r)),On(r),{wrapper:i,contentDOM:r}}update(e,t){return ly({types:ae(this,Ze).type,node:e})?(ae(this,Ze)===e&&ae(this,fc)===t||(ae(this,Ze).sameMarkup(e)||this.setDomAttributes(e,ae(this,rn)),Rn(this,Ze,e),Rn(this,fc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:n}=ae(this,Ze).type.spec;let r=e.attrs;if(n){const o=n(e);if(ge(o)||oZ(o))return;Bs(o[1])&&(r=o[1])}for(const[o,i]of wt(r))t.setAttribute(o,i)}selectNode(){Rn(this,gc,!0),ae(this,rn)&&ae(this,rn).classList.add(Z1),this.renderComponent()}deselectNode(){Rn(this,gc,!1),ae(this,rn)&&ae(this,rn).classList.remove(Z1),this.renderComponent()}destroy(){ae(this,hc).remove(ae(this,rn))}ignoreMutation(e){return e.type==="selection"?!ae(this,Ze).type.spec.selectable:ae(this,uo)?!ae(this,uo).contains(e.target):!0}stopEvent(e){var t;if(!ae(this,rn))return!1;if(Xe(ae(this,pa).stopEvent))return ae(this,pa).stopEvent({event:e});const n=e.target;if(!(ae(this,rn).contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o)return!0;const s=!!ae(this,Ze).type.spec.draggable,a=he.isSelectable(ae(this,Ze)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},Kw=NM;Ze=new WeakMap;fc=new WeakMap;as=new WeakMap;hc=new WeakMap;Xd=new WeakMap;pc=new WeakMap;pa=new WeakMap;gc=new WeakMap;Jd=new WeakMap;uo=new WeakMap;rn=new WeakMap;Cv=new WeakMap;function oZ(e){return iv(e)||Bs(e)&&iv(e.dom)}var nu=class extends Je{constructor(){super(...arguments),this.portalContainer=new tZ}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=le(),t=this.store.managerSettings.nodeViewComponents??{};for(const r of this.store.extensions)!r.ReactComponent||!Du(r)||r.reactComponentEnvironment==="ssr"||(e[r.name]=Kw.create({options:this.options,ReactComponent:r.ReactComponent,portalContainer:this.portalContainer}));const n=wt({...this.options.nodeViewComponents,...t});for(const[r,o]of n)e[r]=Kw.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};nu=eZ([ze({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],nu);var iZ=Object.defineProperty,Gw=Object.getOwnPropertySymbols,sZ=Object.prototype.hasOwnProperty,aZ=Object.prototype.propertyIsEnumerable,Yw=(e,t,n)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xw=(e,t)=>{for(var n in t||(t={}))sZ.call(t,n)&&Yw(e,n,t[n]);if(Gw)for(var n of Gw(t))aZ.call(t,n)&&Yw(e,n,t[n]);return e};function lZ(e){const t=x.createContext(null),n=cZ(t);return[o=>{const i=e(o);return U.createElement(t.Provider,{value:i},o.children)},n,t]}function cZ(e){return(t,n)=>{const r=x.useContext(e),o=uZ(r);if(!r)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return r;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(r);if(!o||!n)return i;const s=t(o);return n(s,i)?s:i}}function uZ(e){const t=x.useRef();return dZ(()=>{t.current=e}),t.current}var dZ=typeof document<"u"?x.useLayoutEffect:x.useEffect;function fZ(e,t){return lZ(n=>{const r=x.useRef(null),o=x.useRef(),i=void 0,[s,a]=x.useState(()=>e({get:Jw(r),set:Zw(o),previousContext:void 0,props:n,state:i})),l=[...Object.values(n),i];return x.useEffect(()=>{l.length!==0&&a(c=>e({get:Jw(r),set:Zw(o),previousContext:c,props:n,state:i}))},l),r.current=s,o.current=a,s})}function Jw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Zw(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(n=>Xw(Xw({},n),typeof t=="function"?t(n):t))}}var PM={},AM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(n){n.MalformedUnicode="MALFORMED_UNICODE",n.MalformedHexadecimal="MALFORMED_HEXADECIMAL",n.CodePointLimit="CODE_POINT_LIMIT",n.OctalDeprecation="OCTAL_DEPRECATION",n.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(AM);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=AM;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function n(h){return!h.match(/[^a-f0-9]/i)?parseInt(h,16):NaN}function r(h,p,g){const m=n(h);if(Number.isNaN(m)||g!==void 0&&g!==h.length)throw new SyntaxError(t.errorMessages.get(p));return m}function o(h){const p=r(h,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(p)}function i(h,p){const g=r(h,t.ErrorType.MalformedUnicode,4);if(p!==void 0){const m=r(p,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(g,m)}return String.fromCharCode(g)}function s(h){return h.charAt(0)==="{"&&h.charAt(h.length-1)==="}"}function a(h){if(!s(h))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const p=h.slice(1,-1),g=r(p,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(g)}catch(m){throw m instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):m}}function l(h,p=!1){if(p)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const g=parseInt(h,8);return String.fromCharCode(g)}const c=new Map([["b","\b"],["f","\f"],["n",`
265
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(h){return c.get(h)||h}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(h,p=!1){return h.replace(d,function(g,m,b,y,w,S,C,E,k){if(m!==void 0)return"\\";if(b!==void 0)return o(b);if(y!==void 0)return a(y);if(w!==void 0)return i(w,S);if(C!==void 0)return i(C);if(E==="0")return"\0";if(E!==void 0)return l(E,!p);if(k!==void 0)return u(k);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(PM);var ru={},LM={},jM={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.moo=n()})(hm,function(){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=typeof new RegExp().sticky=="boolean";function o(O){return O&&n.call(O)==="[object RegExp]"}function i(O){return O&&typeof O=="object"&&!o(O)&&!Array.isArray(O)}function s(O){return O.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(O){var M=new RegExp("|"+O);return M.exec("").length-1}function l(O){return"("+O+")"}function c(O){if(!O.length)return"(?!)";var M=O.map(function(R){return"(?:"+R+")"}).join("|");return"(?:"+M+")"}function u(O){if(typeof O=="string")return"(?:"+s(O)+")";if(o(O)){if(O.ignoreCase)throw new Error("RegExp /i flag not allowed");if(O.global)throw new Error("RegExp /g flag is implied");if(O.sticky)throw new Error("RegExp /y flag is implied");if(O.multiline)throw new Error("RegExp /m flag is implied");return O.source}else throw new Error("Not a pattern: "+O)}function d(O,M){return O.length>M?O:Array(M-O.length+1).join(" ")+O}function f(O,M){for(var R=O.length,I=0;;){var N=O.lastIndexOf(`
266
+ `,R-1);if(N===-1||(I++,R=N,I===M)||R===0)break}var $=I<M?0:R+1;return O.substring($).split(`
267
+ `)}function h(O){for(var M=Object.getOwnPropertyNames(O),R=[],I=0;I<M.length;I++){var N=M[I],$=O[N],A=[].concat($);if(N==="include"){for(var z=0;z<A.length;z++)R.push({include:A[z]});continue}var F=[];A.forEach(function(V){i(V)?(F.length&&R.push(g(N,F)),R.push(g(N,V)),F=[]):F.push(V)}),F.length&&R.push(g(N,F))}return R}function p(O){for(var M=[],R=0;R<O.length;R++){var I=O[R];if(I.include){for(var N=[].concat(I.include),$=0;$<N.length;$++)M.push({include:N[$]});continue}if(!I.type)throw new Error("Rule has no type: "+JSON.stringify(I));M.push(g(I.type,I))}return M}function g(O,M){if(i(M)||(M={match:M}),M.include)throw new Error("Matching rules cannot also include states");var R={defaultType:O,lineBreaks:!!M.error||!!M.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var I in M)t.call(M,I)&&(R[I]=M[I]);if(typeof R.type=="string"&&O!==R.type)throw new Error("Type transform cannot be a string (type '"+R.type+"' for token '"+O+"')");var N=R.match;return R.match=Array.isArray(N)?N:N?[N]:[],R.match.sort(function($,A){return o($)&&o(A)?0:o(A)?-1:o($)?1:A.length-$.length}),R}function m(O){return Array.isArray(O)?p(O):h(O)}var b=g("error",{lineBreaks:!0,shouldThrow:!0});function y(O,M){for(var R=null,I=Object.create(null),N=!0,$=null,A=[],z=[],F=0;F<O.length;F++)O[F].fallback&&(N=!1);for(var F=0;F<O.length;F++){var V=O[F];if(V.include)throw new Error("Inheritance is not allowed in stateless lexers");if(V.error||V.fallback){if(R)throw!V.fallback==!R.fallback?new Error("Multiple "+(V.fallback?"fallback":"error")+" rules not allowed (for token '"+V.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+V.defaultType+"')");R=V}var ee=V.match.slice();if(N)for(;ee.length&&typeof ee[0]=="string"&&ee[0].length===1;){var X=ee.shift();I[X.charCodeAt(0)]=V}if(V.pop||V.push||V.next){if(!M)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+V.defaultType+"')");if(V.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+V.defaultType+"')")}if(ee.length!==0){N=!1,A.push(V);for(var W=0;W<ee.length;W++){var L=ee[W];if(o(L)){if($===null)$=L.unicode;else if($!==L.unicode&&V.fallback===!1)throw new Error("If one rule is /u then all must be")}}var P=c(ee.map(u)),j=new RegExp(P);if(j.test(""))throw new Error("RegExp matches empty string: "+j);var Y=a(P);if(Y>0)throw new Error("RegExp has capture groups: "+j+`
268
+ Use (?: … ) instead`);if(!V.lineBreaks&&j.test(`
269
+ `))throw new Error("Rule should declare lineBreaks: "+j);z.push(l(P))}}var re=R&&R.fallback,se=r&&!re?"ym":"gm",ie=r||re?"":"|";$===!0&&(se+="u");var _e=new RegExp(c(z)+ie,se);return{regexp:_e,groups:A,fast:I,error:R||b}}function w(O){var M=y(m(O));return new k({start:M},"start")}function S(O,M,R){var I=O&&(O.push||O.next);if(I&&!R[I])throw new Error("Missing state '"+I+"' (in token '"+O.defaultType+"' of state '"+M+"')");if(O&&O.pop&&+O.pop!=1)throw new Error("pop must be 1 (in token '"+O.defaultType+"' of state '"+M+"')")}function C(O,M){var R=O.$all?m(O.$all):[];delete O.$all;var I=Object.getOwnPropertyNames(O);M||(M=I[0]);for(var N=Object.create(null),$=0;$<I.length;$++){var A=I[$];N[A]=m(O[A]).concat(R)}for(var $=0;$<I.length;$++)for(var A=I[$],z=N[A],F=Object.create(null),V=0;V<z.length;V++){var ee=z[V];if(ee.include){var X=[V,1];if(ee.include!==A&&!F[ee.include]){F[ee.include]=!0;var W=N[ee.include];if(!W)throw new Error("Cannot include nonexistent state '"+ee.include+"' (in state '"+A+"')");for(var L=0;L<W.length;L++){var P=W[L];z.indexOf(P)===-1&&X.push(P)}}z.splice.apply(z,X),V--}}for(var j=Object.create(null),$=0;$<I.length;$++){var A=I[$];j[A]=y(N[A],!0)}for(var $=0;$<I.length;$++){for(var Y=I[$],re=j[Y],se=re.groups,V=0;V<se.length;V++)S(se[V],Y,j);for(var ie=Object.getOwnPropertyNames(re.fast),V=0;V<ie.length;V++)S(re.fast[ie[V]],Y,j)}return new k(j,M)}function E(O){for(var M=typeof Map<"u",R=M?new Map:Object.create(null),I=Object.getOwnPropertyNames(O),N=0;N<I.length;N++){var $=I[N],A=O[$],z=Array.isArray(A)?A:[A];z.forEach(function(F){if(typeof F!="string")throw new Error("keyword must be string (in keyword '"+$+"')");M?R.set(F,$):R[F]=$})}return function(F){return M?R.get(F):R[F]}}var k=function(O,M){this.startState=M,this.states=O,this.buffer="",this.stack=[],this.reset()};k.prototype.reset=function(O,M){return this.buffer=O||"",this.index=0,this.line=M?M.line:1,this.col=M?M.col:1,this.queuedToken=M?M.queuedToken:null,this.queuedText=M?M.queuedText:"",this.queuedThrow=M?M.queuedThrow:null,this.setState(M?M.state:this.startState),this.stack=M&&M.stack?M.stack.slice():[],this},k.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},k.prototype.setState=function(O){if(!(!O||this.state===O)){this.state=O;var M=this.states[O];this.groups=M.groups,this.error=M.error,this.re=M.regexp,this.fast=M.fast}},k.prototype.popState=function(){this.setState(this.stack.pop())},k.prototype.pushState=function(O){this.stack.push(this.state),this.setState(O)};var _=r?function(O,M){return O.exec(M)}:function(O,M){var R=O.exec(M);return R[0].length===0?null:R};k.prototype._getGroup=function(O){for(var M=this.groups.length,R=0;R<M;R++)if(O[R+1]!==void 0)return this.groups[R];throw new Error("Cannot find token type for matched text")};function T(){return this.value}if(k.prototype.next=function(){var O=this.index;if(this.queuedGroup){var M=this._token(this.queuedGroup,this.queuedText,O);return this.queuedGroup=null,this.queuedText="",M}var R=this.buffer;if(O!==R.length){var A=this.fast[R.charCodeAt(O)];if(A)return this._token(A,R.charAt(O),O);var I=this.re;I.lastIndex=O;var N=_(I,R),$=this.error;if(N==null)return this._token($,R.slice(O,R.length),O);var A=this._getGroup(N),z=N[0];return $.fallback&&N.index!==O?(this.queuedGroup=A,this.queuedText=z,this._token($,R.slice(O,N.index),O)):this._token(A,z,O)}},k.prototype._token=function(O,M,R){var I=0;if(O.lineBreaks){var N=/\n/g,$=1;if(M===`
270
+ `)I=1;else for(;N.exec(M);)I++,$=N.lastIndex}var A={type:typeof O.type=="function"&&O.type(M)||O.defaultType,value:typeof O.value=="function"?O.value(M):M,text:M,toString:T,offset:R,lineBreaks:I,line:this.line,col:this.col},z=M.length;if(this.index+=z,this.line+=I,I!==0?this.col=z-$+1:this.col+=z,O.shouldThrow){var F=new Error(this.formatError(A,"invalid syntax"));throw F}return O.pop?this.popState():O.push?this.pushState(O.push):O.next&&this.setState(O.next),A},typeof Symbol<"u"&&Symbol.iterator){var D=function(O){this.lexer=O};D.prototype.next=function(){var O=this.lexer.next();return{value:O,done:!O}},D.prototype[Symbol.iterator]=function(){return this},k.prototype[Symbol.iterator]=function(){return new D(this)}}return k.prototype.formatError=function(O,M){if(O==null)var R=this.buffer.slice(this.index),O={text:R,offset:this.index,lineBreaks:R.indexOf(`
271
+ `)===-1?0:1,line:this.line,col:this.col};var I=2,N=Math.max(O.line-I,1),$=O.line+I,A=String($).length,z=f(this.buffer,this.line-O.line+I+1).slice(0,5),F=[];F.push(M+" at line "+O.line+" col "+O.col+":"),F.push("");for(var V=0;V<z.length;V++){var ee=z[V],X=N+V;F.push(d(String(X),A)+" "+ee),X===O.line&&F.push(d("",A+O.col+1)+"^")}return F.join(`
272
+ `)},k.prototype.clone=function(){return new k(this.states,this.state)},k.prototype.has=function(O){return!0},{compile:w,states:C,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:E}})})(jM);var hZ=jM.exports;(function(e){var t=hm&&hm.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.lexer=e.states=void 0;const n=t(hZ);e.states={body:{doubleapos:{match:"''",value:()=>"'"},quoted:{lineBreaks:!0,match:/'[{}#](?:[^]*?[^'])?'(?!')/u,value:r=>r.slice(1,-1).replace(/''/g,"'")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:r=>r.substring(1).trim()},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:r=>r.split(",")[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:r=>r.split(",")[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:r=>r.substring(1).trim()},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:r=>r.split(":")[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:r=>r.substring(0,r.indexOf("{")).trim()},end:{match:/\s*\}/u,pop:1}}},e.lexer=n.default.states(e.states)})(LM);Object.defineProperty(ru,"__esModule",{value:!0});ru.parse=ru.ParseError=void 0;const $M=LM,sd=e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),Ig=e=>e==="plural"||e==="select"||e==="selectordinal";function pZ(e,t){let n="",r="";for(const i of t){const s=i.ctx.text;switch(r+=s,i.type){case"content":n+=i.value;break;case"argument":case"function":case"octothorpe":n+=s;break;default:throw new Dt(e,`Unsupported part in strict mode function arg style: ${s}`)}}return[{type:"content",value:n.trim(),ctx:Object.assign({},t[0].ctx,{text:r})}]}const gZ=["number","date","time","spellout","ordinal","duration"],Qw=["zero","one","two","few","many","other"];class Dt extends Error{constructor(t,n){super($M.lexer.formatError(t,n))}}ru.ParseError=Dt;class mZ{constructor(t,n){var r,o,i,s;this.lexer=$M.lexer.reset(t),this.cardinalKeys=(r=n==null?void 0:n.cardinal)!==null&&r!==void 0?r:Qw,this.ordinalKeys=(o=n==null?void 0:n.ordinal)!==null&&o!==void 0?o:Qw,this.strict=(i=n==null?void 0:n.strict)!==null&&i!==void 0?i:!1,this.strictPluralKeys=(s=n==null?void 0:n.strictPluralKeys)!==null&&s!==void 0?s:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(t,n,r){if(r[0]==="="){if(n==="select")throw new Dt(t,`The case ${r} is not valid with select`)}else if(n!=="select"){const o=n==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&o.length>0&&!o.includes(r)){const i=`The ${n} case ${r} is not valid in this locale`;throw new Dt(t,i)}}}parseSelect({value:t},n,r,o){const i={type:o,arg:t,cases:[],ctx:r};o==="plural"||o==="selectordinal"?n=!0:this.strict&&(n=!1);for(const s of this.lexer)switch(s.type){case"offset":if(o==="select")throw new Dt(s,"Unexpected plural offset for select");if(i.cases.length>0)throw new Dt(s,"Plural offset must be set before cases");i.pluralOffset=Number(s.value),r.text+=s.text,r.lineBreaks+=s.lineBreaks;break;case"case":{this.checkSelectKey(s,o,s.value),i.cases.push({key:s.value,tokens:this.parseBody(n),ctx:sd(s)});break}case"end":return i;default:throw new Dt(s,`Unexpected lexer token: ${s.type}`)}throw new Dt(null,"Unexpected message end")}parseArgToken(t,n){const r=sd(t),o=this.lexer.next();if(!o)throw new Dt(null,"Unexpected message end");if(r.text+=o.text,r.lineBreaks+=o.lineBreaks,this.strict&&(o.type==="func-simple"||o.type==="func-args")&&!gZ.includes(o.value)){const i=`Invalid strict mode function arg type: ${o.value}`;throw new Dt(t,i)}switch(o.type){case"end":return{type:"argument",arg:t.value,ctx:r};case"func-simple":{const i=this.lexer.next();if(!i)throw new Dt(null,"Unexpected message end");if(i.type!=="end")throw new Dt(i,`Unexpected lexer token: ${i.type}`);if(r.text+=i.text,Ig(o.value.toLowerCase()))throw new Dt(o,`Invalid type identifier: ${o.value}`);return{type:"function",arg:t.value,key:o.value,ctx:r}}case"func-args":{if(Ig(o.value.toLowerCase())){const s=`Invalid type identifier: ${o.value}`;throw new Dt(o,s)}let i=this.parseBody(this.strict?!1:n);return this.strict&&i.length>0&&(i=pZ(t,i)),{type:"function",arg:t.value,key:o.value,param:i,ctx:r}}case"select":if(Ig(o.value))return this.parseSelect(t,n,r,o.value);throw new Dt(o,`Unexpected select type ${o.value}`);default:throw new Dt(o,`Unexpected lexer token: ${o.type}`)}}parseBody(t,n){const r=[];let o=null;for(const i of this.lexer)if(i.type==="argument")o&&(o=null),r.push(this.parseArgToken(i,t));else if(i.type==="octothorpe"&&t)o&&(o=null),r.push({type:"octothorpe",ctx:sd(i)});else{if(i.type==="end"&&!n)return r;{let s=i.value;if(!t&&i.type==="quoted"&&s[0]==="#"){if(s.includes("{")){const a=`Unsupported escape pattern: ${s}`;throw new Dt(i,a)}s=i.text}o?(o.value+=s,o.ctx.text+=i.text,o.ctx.lineBreaks+=i.lineBreaks):(o={type:"content",value:s,ctx:sd(i)},r.push(o))}}if(n)return r;throw new Dt(null,"Unexpected message end")}}function vZ(e,t={}){return new mZ(e,t).parse()}ru.parse=vZ;const Es=e=>typeof e=="string",yZ=e=>typeof e=="function",eS=new Map,zM="en";function _y(e){return[...Array.isArray(e)?e:[e],zM]}function BM(e,t,n){const r=_y(e);return Qf(()=>eh("date",r,n),()=>new Intl.DateTimeFormat(r,n)).format(Es(t)?new Date(t):t)}function Ev(e,t,n){const r=_y(e);return Qf(()=>eh("number",r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function tS(e,t,n,{offset:r=0,...o}){const i=_y(e),s=t?Qf(()=>eh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):Qf(()=>eh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[n]??o[s.select(n-r)]??o.other}function Qf(e,t){const n=e();let r=eS.get(n);return r||(r=t(),eS.set(n,r)),r}function eh(e,t,n){const r=t.join("-");return`${e}-${r}-${JSON.stringify(n)}`}const FM=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,HM="%__lingui_octothorpe__%",bZ=(e,t,n={})=>{const r=t||e,o=s=>typeof s=="object"?s:n[s]||{style:s},i=(s,a)=>{const l=Object.keys(n).length?o("number"):void 0,c=Ev(r,s,l);return a.replace(new RegExp(HM,"g"),c)};return{plural:(s,a)=>{const{offset:l=0}=a,c=tS(r,!1,s,a);return i(s-l,c)},selectordinal:(s,a)=>{const{offset:l=0}=a,c=tS(r,!0,s,a);return i(s-l,c)},select:xZ,number:(s,a)=>Ev(r,s,o(a)),date:(s,a)=>BM(r,s,o(a))}},xZ=(e,t)=>t[e]??t.other;function wZ(e,t,n){return(r={},o)=>{const i=bZ(t,n,o),s=(l,c=!1)=>Array.isArray(l)?l.reduce((u,d)=>{if(d==="#"&&c)return u+HM;if(Es(d))return u+d;const[f,h,p]=d;let g={};h==="plural"||h==="selectordinal"||h==="select"?Object.entries(p).forEach(([b,y])=>{g[b]=s(y,h==="plural"||h==="selectordinal")}):g=p;let m;if(h){const b=i[h];m=b(r[f],g)}else m=r[f];return m==null?u:u+m},""):l,a=s(e);return Es(a)&&FM.test(a)?PM.unraw(a.trim()):Es(a)?a.trim():a?String(a):""}}var SZ=Object.defineProperty,CZ=(e,t,n)=>t in e?SZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EZ=(e,t,n)=>(CZ(e,t+"",n),n);class kZ{constructor(){EZ(this,"_events",{})}on(t,n){var r;return(r=this._events)[t]??(r[t]=[]),this._events[t].push(n),()=>this.removeListener(t,n)}removeListener(t,n){const r=this._getListeners(t);if(!r)return;const o=r.indexOf(n);~o&&r.splice(o,1)}emit(t,...n){const r=this._getListeners(t);r&&r.map(o=>o.apply(this,n))}_getListeners(t){const n=this._events[t];return Array.isArray(n)?n:!1}}var OZ=Object.defineProperty,TZ=(e,t,n)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ia=(e,t,n)=>(TZ(e,typeof t!="symbol"?t+"":t,n),n);class _Z extends kZ{constructor(t){super(),ia(this,"_locale",""),ia(this,"_locales"),ia(this,"_localeData",{}),ia(this,"_messages",{}),ia(this,"_missing"),ia(this,"t",this._.bind(this)),t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(typeof t.locale=="string"||t.locales)&&this.activate(t.locale??zM,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,n){const r=this._localeData[t];r?Object.assign(r,n):this._localeData[t]=n}loadLocaleData(t,n){n!=null?this._loadLocaleData(t,n):Object.keys(t).forEach(r=>this._loadLocaleData(r,t[r])),this.emit("change")}_load(t,n){const r=this._messages[t];r?Object.assign(r,n):this._messages[t]=n}load(t,n){typeof t=="string"&&typeof n=="object"?this._load(t,n):Object.entries(t).forEach(([r,o])=>this._load(r,o)),this.emit("change")}loadAndActivate({locale:t,locales:n,messages:r}){this._locale=t,this._locales=n||void 0,this._messages[this._locale]=r,this.emit("change")}activate(t,n){this._locale=t,this._locales=n,this.emit("change")}_(t,n,r){let o=r==null?void 0:r.message;t||(t=""),Es(t)||(n=t.values||n,o=t.message,t=t.id);const i=this.messages[t],s=i===void 0,a=this._missing;if(a&&s)return yZ(a)?a(this._locale,t):a;s&&this.emit("missing",{id:t,locale:this._locale});let l=i||o||t;return Es(l)&&FM.test(l)?JSON.parse(`"${l}"`):Es(l)?l:wZ(l,this._locale,this._locales)(n,r==null?void 0:r.formats)}date(t,n){return BM(this._locales||this._locale,t,n)}number(t,n){return Ev(this._locales||this._locale,t,n)}}function MZ(e={}){return new _Z(e)}const lp=MZ();function G(e,t){return t?"other":e==1?"one":"other"}function Ro(e,t){return t?"other":e==0||e==1?"one":"other"}function Tn(e,t){var n=String(e).split("."),r=!n[1];return t?"other":e==1&&r?"one":"other"}function Le(e,t){return"other"}function qi(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const DZ=Le,RZ=G,IZ=Ro;function NZ(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const PZ=G;function AZ(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function LZ(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function jZ(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const $Z=G,zZ=Tn;function BZ(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-1),i=r.slice(-2),s=r.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":r==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function FZ(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":r&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const HZ=G,VZ=G,WZ=G,UZ=Ro,qZ=Le;function KZ(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const GZ=Le;function YZ(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2),s=r&&n[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&r&&s==0?"many":"other"}const XZ=G;function JZ(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function ZZ(e,t){var n=String(e).split("."),r=!n[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&r?"one":"other"}const QZ=G;function eQ(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const tQ=G,nQ=G,rQ=G;function oQ(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function iQ(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function sQ(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e;return t?"other":e==1||!o&&(r==0||r==1)?"one":"other"}const aQ=Tn;function lQ(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const cQ=G,uQ=Le,dQ=G,fQ=G;function hQ(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&r?"one":"other"}const pQ=G,gQ=G,mQ=Tn,vQ=G;function yQ(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function bQ(e,t){return t?"other":e>=0&&e<2?"one":"other"}const xQ=Tn;function wQ(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const SQ=G;function CQ(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const EQ=G,kQ=Tn;function OQ(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"}function TQ(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"}const _Q=Tn,MQ=G;function DQ(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const RQ=Ro;function IQ(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const NQ=G,PQ=G;function AQ(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function LQ(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function jQ(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function $Q(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function zQ(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function BQ(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const FQ=Tn,HQ=Le,VQ=Le,WQ=Le,UQ=Tn;function qQ(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e,i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function KQ(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const GQ=qi;function YQ(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const XQ=Le,JQ=Le,ZQ=G,QQ=Tn,eee=G,tee=Le,nee=Le;function ree(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-2);return t?r==1?"one":r==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function oee(e,t){return t?"other":e>=0&&e<2?"one":"other"}const iee=G,see=G,aee=Le,lee=Le;function cee(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||r&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const uee=G,dee=G,fee=Le;function hee(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const pee=Le,gee=G,mee=G;function vee(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const yee=G;function bee(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2),i=r&&n[0].slice(-3),s=r&&n[0].slice(-5),a=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||r&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const xee=G;function wee(e,t){var n=String(e).split("."),r=n[0];return t?"other":e==0?"zero":(r==0||r==1)&&e!=0?"one":"other"}const See=G,Cee=G,Eee=Le,kee=Ro;function Oee(e,t){return t&&e==1?"one":"other"}function Tee(e,t){var n=String(e).split("."),r=n[1]||"",o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":r!=0?"many":"other"}function _ee(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const Mee=G,Dee=Ro,Ree=G;function Iee(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const Nee=G,Pee=G;function Aee(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}function Lee(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function jee(e,t){return t&&e==1?"one":"other"}function $ee(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const zee=Le,Bee=G,Fee=qi,Hee=G,Vee=G;function Wee(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const Uee=Tn,qee=G,Kee=G,Gee=G,Yee=Le,Xee=G,Jee=Ro,Zee=G,Qee=G,ete=G;function tte(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==5||r&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const nte=G,rte=Le,ote=Ro,ite=G;function ste(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&r!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function ate(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const lte=G;function cte(e,t){var n=String(e).split("."),r=n[0];return t?"other":r==0||r==1?"one":"other"}const ute=Tn,dte=G;function fte(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}const hte=G,pte=Le;function gte(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const mte=G,vte=Le,yte=G;function bte(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}function xte(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const wte=G,Ste=G,Cte=qi,Ete=G,kte=Le,Ote=Le;function Tte(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function _te(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"}function Mte(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"";return t?"other":e==0||e==1||r==0&&o==1?"one":"other"}function Dte(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function Rte(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const Ite=qi,Nte=qi,Pte=qi,Ate=qi,Lte=qi,jte=G,$te=G;function zte(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function Bte(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const Fte=G,Hte=G,Vte=G,Wte=Le;function Ute(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&r?"one":"other"}const qte=Tn,Kte=G,Gte=G,Yte=G,Xte=G,Jte=Le,Zte=Ro,Qte=G;function ene(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function tne(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const nne=G,rne=Le,one=G,ine=G;function sne(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e==0||e==1||r&&e>=11&&e<=99?"one":"other"}const ane=G;function lne(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const cne=Tn,une=G,dne=G;function fne(e,t){return t&&e==1?"one":"other"}const hne=G,pne=G,gne=Ro,mne=G,vne=Le,yne=G,bne=G,xne=Tn,wne=Le,Sne=Le,Cne=Le;function Ene(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const kne=Object.freeze(Object.defineProperty({__proto__:null,_in:DZ,af:RZ,ak:IZ,am:NZ,an:PZ,ar:AZ,ars:LZ,as:jZ,asa:$Z,ast:zZ,az:BZ,be:FZ,bem:HZ,bez:VZ,bg:WZ,bho:UZ,bm:qZ,bn:KZ,bo:GZ,br:YZ,brx:XZ,bs:JZ,ca:ZZ,ce:QZ,ceb:eQ,cgg:tQ,chr:nQ,ckb:rQ,cs:oQ,cy:iQ,da:sQ,de:aQ,dsb:lQ,dv:cQ,dz:uQ,ee:dQ,el:fQ,en:hQ,eo:pQ,es:gQ,et:mQ,eu:vQ,fa:yQ,ff:bQ,fi:xQ,fil:wQ,fo:SQ,fr:CQ,fur:EQ,fy:kQ,ga:OQ,gd:TQ,gl:_Q,gsw:MQ,gu:DQ,guw:RQ,gv:IQ,ha:NQ,haw:PQ,he:AQ,hi:LQ,hr:jQ,hsb:$Q,hu:zQ,hy:BQ,ia:FQ,id:HQ,ig:VQ,ii:WQ,io:UQ,is:qQ,it:KQ,iu:GQ,iw:YQ,ja:XQ,jbo:JQ,jgo:ZQ,ji:QQ,jmc:eee,jv:tee,jw:nee,ka:ree,kab:oee,kaj:iee,kcg:see,kde:aee,kea:lee,kk:cee,kkj:uee,kl:dee,km:fee,kn:hee,ko:pee,ks:gee,ksb:mee,ksh:vee,ku:yee,kw:bee,ky:xee,lag:wee,lb:See,lg:Cee,lkt:Eee,ln:kee,lo:Oee,lt:Tee,lv:_ee,mas:Mee,mg:Dee,mgo:Ree,mk:Iee,ml:Nee,mn:Pee,mo:Aee,mr:Lee,ms:jee,mt:$ee,my:zee,nah:Bee,naq:Fee,nb:Hee,nd:Vee,ne:Wee,nl:Uee,nn:qee,nnh:Kee,no:Gee,nqo:Yee,nr:Xee,nso:Jee,ny:Zee,nyn:Qee,om:ete,or:tte,os:nte,osa:rte,pa:ote,pap:ite,pl:ste,prg:ate,ps:lte,pt:cte,pt_PT:ute,rm:dte,ro:fte,rof:hte,root:pte,ru:gte,rwk:mte,sah:vte,saq:yte,sc:bte,scn:xte,sd:wte,sdh:Ste,se:Cte,seh:Ete,ses:kte,sg:Ote,sh:Tte,shi:_te,si:Mte,sk:Dte,sl:Rte,sma:Ite,smi:Nte,smj:Pte,smn:Ate,sms:Lte,sn:jte,so:$te,sq:zte,sr:Bte,ss:Fte,ssy:Hte,st:Vte,su:Wte,sv:Ute,sw:qte,syr:Kte,ta:Gte,te:Yte,teo:Xte,th:Jte,ti:Zte,tig:Qte,tk:ene,tl:tne,tn:nne,to:rne,tr:one,ts:ine,tzm:sne,ug:ane,uk:lne,ur:cne,uz:une,ve:dne,vi:fne,vo:hne,vun:pne,wa:gne,wae:mne,wo:vne,xh:yne,xog:bne,yi:xne,yo:wne,yue:Sne,zh:Cne,zu:Ene},Symbol.toStringTag,{value:"Module"}));var One=Object.defineProperty,Tne=Object.getOwnPropertyDescriptor,_ne=Object.getOwnPropertyNames,Mne=Object.prototype.hasOwnProperty,Dne=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _ne(t))!Mne.call(e,o)&&o!==n&&One(e,o,{get:()=>t[o],enumerable:!(r=Tne(t,o))||r.enumerable});return e},Rne=(e,t,n)=>(Dne(e,t,"default"),n),Ine=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),VM={};Rne(VM,kne);lp.loadLocaleData("en",{plurals:VM.en});lp.load("en",Ine);lp.activate("en");var Nne=Object.getOwnPropertyDescriptor,Pne=(e,t,n,r)=>{for(var o=r>1?void 0:r?Nne(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o},Ane={...zi.defaultOptions,...nu.defaultOptions},Lne=[...zi.staticKeys,...nu.staticKeys],ou=class extends Je{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(zi).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new zi({emptyNodeClass:e,placeholder:t,priority:Be.Low}),new nu({defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};ou=Pne([ze({defaultOptions:Ane,staticKeys:Lne})],ou);var WM={};Object.defineProperty(WM,"__esModule",{value:!0});function jne(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return rS(e[0],e[1])||null;var n=e.slice(1).reduce(function(r,o){return rS(r,o)},e[0]);return n||null}var Al=WM.default=jne,nS=new WeakMap;function rS(e,t){if(e&&t){var n=nS.get(e)||new WeakMap;nS.set(e,n);var r=n.get(t)||function(o){oS(e,o),oS(t,o)};return n.set(t,r),r}return e||t}function oS(e,t){typeof e=="function"?e(t):e.current=t}var UM=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ng=(e,t,n)=>(UM(e,t,"read from private field"),t.get(e)),$ne=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},zne=(e,t,n,r)=>(UM(e,t,"write to private field"),t.set(e,n),n);function Bne(){const[,e]=x.useState(le());return x.useCallback(()=>{e(le())},[])}var qM=x.createContext(null);function My(e){const t=x.useContext(qM),n=x.useRef(Bne());fe(t,{code:K.REACT_PROVIDER_CONTEXT});const{addHandler:r}=t;return x.useEffect(()=>{let o=e;if(o){if(Bs(o)){const{autoUpdate:i}=o;o=i?()=>n.current():void 0}if(Xe(o))return r("updated",o)}},[r,e]),t}function Fne(e=!0){return My({autoUpdate:e}).active}function Hne(){return My().commands}var[Vne,$he]=fZ(({props:e})=>{const t=e.locale??"en",n=e.i18n??lp,r=e.supportedLocales??[t],o=n._.bind(n);return{locale:t,i18n:n,supportedLocales:r,t:o}});function iS(e,t={}){const{core:n,react:r,...o}=t;return GK(e)?e:KK.create(()=>[...nT(e),new ou(r),...ZJ(n)],o)}function Wne(e,t={}){const n=x.useRef(e),r=x.useRef(t),[o,i]=x.useState(()=>iS(e,t));return n.current=e,r.current=t,x.useEffect(()=>o.addHandler("destroy",()=>{i(()=>iS(n.current,r.current))}),[o]),o}var Une=typeof Al=="object"&&Al.__esModule&&Al.default?Al.default:Al,ga,qne=class extends HK{constructor(e){if(super(e),$ne(this,ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,n)=>{this.rootPropsConfig.called=!0;const{refKey:r="ref",ref:o,...i}=t??le();return{[r]:Une(o,this.onRef),key:this.uid,...i,children:n}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,fe(this.rootPropsConfig.count<=1,{code:K.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),zne(this,ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(zi).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new c7(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:n=!0,tr:r,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;fe(i,{code:K.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),fe(n,{code:K.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:r,transactions:o});return}!r&&!o&&(e=e.apply(e.tr.setMeta(Q1,{}))),this.view.updateState(e),n&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:r,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:r,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Q1,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){fe(Ng(this,ga),{code:K.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Ng(this,ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Ng(this,ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};ga=new WeakMap;var KM=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Kne(e){const t=x.useRef();return KM(()=>{t.current=e}),t.current}function Gne(e){const{manager:t,state:n}=e,{placeholder:r,editable:o}=e;x.useRef(!0).current&&!Ri(r)&&t.getExtension(ou).setOptions({placeholder:r}),x.useEffect(()=>{r!=null&&t.getExtension(ou).setOptions({placeholder:r})},[r,t]);const[s]=x.useState(()=>{if(n)return n;const l=t.createEmptyDoc(),[c,u]=Et(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=Yne({initialEditorState:s,getProps:()=>e});return x.useEffect(()=>()=>{a.destroy()},[a]),x.useEffect(()=>{a.onUpdate()},[o,a]),Xne(a),a.frameworkOutput}function Yne(e){const t=x.useRef(e);t.current=e;const n=x.useMemo(()=>new qne(t.current),[]);return n.update(e),n}function Xne(e){const{state:t}=e.props,n=x.useRef(!!t),r=Kne(t);KM(()=>{const o=t?n.current===!0:n.current===!1;fe(o,{code:K.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===r)&&e.updateControlledState(t,r??void 0)},[t,r,e])}function Jne(e={}){const{content:t,document:n,selection:r,extensions:o,...i}=e,s=Wne(o??(()=>[]),i),[a,l]=x.useState(()=>s.createState({selection:r,content:t??s.createEmptyDoc()})),c=x.useCallback(({state:d})=>{l(d)},[]),u=x.useCallback(()=>s.output,[s]);return x.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var kv=()=>U.createElement("div",{className:iY.EDITOR_WRAPPER,...My().getRootProps()}),Zne=e=>(e.hook(),null);function Qne(e){const{children:t,autoRender:n,i18n:r,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=Gne(a),c=rZ(l.portalContainer),u=n==="start"||n===!0||!t&&Ri(n),d=n==="end";return U.createElement(Vne,{i18n:r,locale:o,supportedLocales:i},U.createElement(qM.Provider,{value:l},U.createElement(nZ,{portals:c}),s.map((f,h)=>U.createElement(Zne,{hook:f,key:h})),u&&U.createElement(kv,null),t,d&&U.createElement(kv,null)))}function Bi(e){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(e)}function ere(e,t){if(Bi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tre(e){var t=ere(e,"string");return Bi(t)=="symbol"?t:t+""}var GM={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(GM);var nre=GM.exports;const rre=KE(GA),ore="_richTextToolbar_1gbkk_1",ire="_richTextToolbarContainer_1gbkk_5",sS={richTextToolbar:ore,richTextToolbarContainer:ire};var ma=(e=>(e.BOLD="bold",e.ITALIC="italic",e.CODE="code",e.UL="ul",e.OL="ol",e))(ma||{});const sre=({disabled:e=!1,toolbarComponent:t=null})=>{const{focus:n,toggleBold:r,toggleBulletList:o,toggleCode:i,toggleItalic:s,toggleOrderedList:a}=Hne(),l=Fne(),c=[{icon:ma.BOLD,onClick:r,active:l.bold()},{icon:ma.ITALIC,onClick:s,active:l.italic()},{icon:ma.CODE,onClick:i,active:l.code()},{icon:ma.UL,onClick:o,active:l.bulletList()},{icon:ma.OL,onClick:a,active:l.orderedList()}];return v.jsxs("div",{className:sS.richTextToolbarContainer,children:[v.jsx("div",{className:sS.richTextToolbar,children:c.map((u,d)=>v.jsx(ln,{small:!0,round:!0,basic:!0,icon:u.icon,colored:li.MUTED,onClick:()=>{u.onClick(),n()},active:u.active,disabled:e},d))}),t]})},are="_richTextInput_1fb4l_77",lre={richTextInput:are};x.forwardRef(({placeholder:e,onChange:t,value:n,disabled:r,toolbarComponent:o},i)=>{const s=x.useContext(ht),a=r||s,{manager:l,state:c,setState:u,getContext:d}=Jne({extensions:()=>[new Ns({}),new eu({}),new Zc,new Qc,new tl({}),new tu,new zi({placeholder:e})],content:n,selection:"start",stringHandler:"markdown"});x.useImperativeHandle(i,()=>d(),[d]);const f=({helpers:h,state:p})=>{const g=h.getMarkdown(p);t&&t(g),u(p)};return v.jsx("div",{className:lre.richTextInput,children:v.jsxs(Qne,{manager:l,state:c,placeholder:e,onChange:f,editable:!a,children:[v.jsx(sre,{disabled:a,toolbarComponent:o}),v.jsx(kv,{})]})})});var cre=typeof Element<"u",ure=typeof Map=="function",dre=typeof Set=="function",fre=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Zd(e[r],t[r]))return!1;return!0}var i;if(ure&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!Zd(r.value[1],t.get(r.value[0])))return!1;return!0}if(dre&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(fre&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(cre&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!Zd(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var hre=function(t,n){try{return Zd(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const Dy=_o(hre),pre="_sidebar_1oy1z_82",gre="_inner_1oy1z_93",mre="_title_1oy1z_103",vre="_subtitle_1oy1z_104",yre="_label_1oy1z_105",bre="_collapsed_1oy1z_109",xre="_list_1oy1z_134",wre="_item_1oy1z_140",Sre="_experimental_1oy1z_155",Cre="_active_1oy1z_159",Ere="_icon_1oy1z_163",kr={sidebar:pre,inner:gre,title:mre,subtitle:vre,label:yre,collapsed:bre,list:xre,item:wre,experimental:Sre,active:Cre,icon:Ere},kre=x.memo(({isOpen:e,label:t,icon:n,invalid:r})=>v.jsxs(v.Fragment,{children:[v.jsx(hn,{text:t,enabled:!e,placement:"right-center",possiblePlacements:["right-center"],fontSize:16,padding:"var(--padding-sm)",display:"block",children:v.jsx("span",{className:kr.icon,children:v.jsx(ll,{small:!0,title:r?"!":void 0,margin:4,children:v.jsx(Ae,{icon:n})})})}),v.jsx("span",{className:kr.label,children:t})]}),(e,t)=>Dy(e,t)),Ore=({isOpen:e,items:t,sectionIndex:n,onClick:r,testId:o})=>v.jsx("div",{className:kr.list,children:t.map((i,s)=>{const a=`${n}_${s}`;return v.jsx("a",{href:i.value,className:oe(kr.item,i.isActive?kr.active:"",i.isExperimental?kr.experimental:""),onClick:l=>r(l,i.value,i.label,i.onClick),"data-testid":o,children:v.jsx(kre,{label:i.label,icon:i.icon,invalid:i.invalid,isOpen:e},a)},a)})}),Tre=({isOpen:e,sections:t,onClick:n})=>v.jsx(v.Fragment,{children:t.map((r,o)=>v.jsxs(U.Fragment,{children:[v.jsx("h5",{className:kr.subtitle,children:r.heading.toUpperCase()}),v.jsx(Ore,{isOpen:e,items:r.items,sectionIndex:o,onClick:n,testId:r.testId})]},o))});x.memo(({options:e,startOpen:t=!1,onShiftClickToggleOpen:n=()=>{},top:r})=>{const[o,i]=x.useState(t),s=(l,c,u,d)=>{l.preventDefault(),typeof d=="function"&&(l.currentTarget.value=c,l.currentTarget.label=u,d(l)),i(!1)},a=e.sections.length>0;return v.jsx(YH,{fixed:!0,open:o,top:r,background:"var(--color-background-sidebar)",closedWidth:"var(--size-sidebar)",buttonPosition:b0.BOTTOM,buttonAnimate:!0,button:a&&v.jsx(ln,{onClick:l=>{l.shiftKey&&n&&n(l),i(!o)},colored:!0,round:!0,icon:Ce.LEFT}),children:v.jsx("div",{className:oe(kr.sidebar,o?"":kr.collapsed),children:a&&v.jsxs("div",{className:kr.inner,children:[v.jsx("h4",{className:kr.title,children:e.title}),v.jsx(Tre,{isOpen:o,sections:e.sections,onClick:s})]})})})},(e,t)=>Dy(e,t));function Or(e,t,n){return(t=tre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ov(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _re(e){if(Array.isArray(e))return Ov(e)}function Mre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YM(e,t){if(e){if(typeof e=="string")return Ov(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ov(e,t):void 0}}function Dre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
273
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vi(e){return _re(e)||Mre(e)||YM(e)||Dre()}function Rre(e){if(Array.isArray(e))return e}function Ire(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function Nre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
274
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ln(e,t){return Rre(e)||Ire(e,t)||YM(e,t)||Nre()}var Tv={},Pre=function(t){};function Are(e,t){}function Lre(e,t){}function jre(){Tv={}}function XM(e,t,n){!t&&!Tv[n]&&(e(!1,n),Tv[n]=!0)}function cp(e,t){XM(Are,e,t)}function $re(e,t){XM(Lre,e,t)}cp.preMessage=Pre;cp.resetWarned=jre;cp.noteOnce=$re;function zre(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function o(i,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=r.has(i);if(cp(!l,"Warning: There may be circular references"),l)return!1;if(i===s)return!0;if(n&&a>1)return!1;r.add(i);var c=a+1;if(Array.isArray(i)){if(!Array.isArray(s)||i.length!==s.length)return!1;for(var u=0;u<i.length;u++)if(!o(i[u],s[u],c))return!1;return!0}if(i&&s&&Bi(i)==="object"&&Bi(s)==="object"){var d=Object.keys(i);return d.length!==Object.keys(s).length?!1:d.every(function(f){return o(i[f],s[f],c)})}return!1}return o(e,t)}function aS(e){var t=x.useRef();t.current=e;var n=x.useCallback(function(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(i))},[]);return n}function Bre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var lS=Bre()?x.useLayoutEffect:x.useEffect,Fre=function(t,n){var r=x.useRef(!0);lS(function(){return t(r.current)},n),lS(function(){return r.current=!1,function(){r.current=!0}},[])},cS=function(t,n){Fre(function(r){if(!r)return t()},n)};function uS(e){var t=x.useRef(!1),n=x.useState(e),r=Ln(n,2),o=r[0],i=r[1];x.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function s(a,l){l&&t.current||i(a)}return[o,s]}function Pg(e){return e!==void 0}function Hre(e,t){var n=t||{},r=n.defaultValue,o=n.value,i=n.onChange,s=n.postState,a=uS(function(){return Pg(o)?o:Pg(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),l=Ln(a,2),c=l[0],u=l[1],d=o!==void 0?o:c,f=s?s(d):d,h=aS(i),p=uS([d]),g=Ln(p,2),m=g[0],b=g[1];cS(function(){var w=m[0];c!==w&&h(c,w)},[m]),cS(function(){Pg(o)||u(o)},[o]);var y=aS(function(w,S){u(w,S),b([d],S)});return[f,y]}function JM(e,t){if(e==null)return{};var n,r,o=JE(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function dS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dS(Object(n),!0).forEach(function(r){Or(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Go={PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},Ws=x.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0});function _v(e,t,n){return(e-t)/(n-t)}function Ry(e,t,n,r){var o=_v(t,n,r),i={};switch(e){case"rtl":i.right="".concat(o*100,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(o*100,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(o*100,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(o*100,"%"),i.transform="translateX(-50%)";break}return i}function xa(e,t){return Array.isArray(e)?e[t]:e}var Vre=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],Wre=x.forwardRef(function(e,t){var n,r,o=e.prefixCls,i=e.value,s=e.valueIndex,a=e.onStartMove,l=e.style,c=e.render,u=e.dragging,d=e.onOffsetChange,f=JM(e,Vre),h=x.useContext(Ws),p=h.min,g=h.max,m=h.direction,b=h.disabled,y=h.keyboard,w=h.range,S=h.tabIndex,C=h.ariaLabelForHandle,E=h.ariaLabelledByForHandle,k=h.ariaValueTextFormatterForHandle,_="".concat(o,"-handle"),T=function(I){b||a(I,s)},D=function(I){if(!b&&y){var N=null;switch(I.which||I.keyCode){case Go.LEFT:N=m==="ltr"||m==="btt"?-1:1;break;case Go.RIGHT:N=m==="ltr"||m==="btt"?1:-1;break;case Go.UP:N=m!=="ttb"?1:-1;break;case Go.DOWN:N=m!=="ttb"?-1:1;break;case Go.HOME:N="min";break;case Go.END:N="max";break;case Go.PAGE_UP:N=2;break;case Go.PAGE_DOWN:N=-2;break}N!==null&&(I.preventDefault(),d(N,s))}},O=Ry(m,i,p,g),M=x.createElement("div",Di({ref:t,className:oe(_,(n={},Or(n,"".concat(_,"-").concat(s+1),w),Or(n,"".concat(_,"-dragging"),u),n)),style:Gr(Gr({},O),l),onMouseDown:T,onTouchStart:T,onKeyDown:D,tabIndex:b?null:xa(S,s),role:"slider","aria-valuemin":p,"aria-valuemax":g,"aria-valuenow":i,"aria-disabled":b,"aria-label":xa(C,s),"aria-labelledby":xa(E,s),"aria-valuetext":(r=xa(k,s))===null||r===void 0?void 0:r(i),"aria-orientation":m==="ltr"||m==="rtl"?"horizontal":"vertical"},f));return c&&(M=c(M,{index:s,prefixCls:o,value:i,dragging:u})),M}),Ure=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],qre=x.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,o=e.onStartMove,i=e.onOffsetChange,s=e.values,a=e.handleRender,l=e.draggingIndex,c=JM(e,Ure),u=x.useRef({});return x.useImperativeHandle(t,function(){return{focus:function(f){var h;(h=u.current[f])===null||h===void 0||h.focus()}}}),x.createElement(x.Fragment,null,s.map(function(d,f){return x.createElement(Wre,Di({ref:function(p){p?u.current[f]=p:delete u.current[f]},dragging:l===f,prefixCls:n,style:xa(r,f),key:f,value:d,valueIndex:f,onStartMove:o,onOffsetChange:i,render:a},c))}))});function fS(e){var t="touches"in e?e.touches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function Kre(e,t,n,r,o,i,s,a,l){var c=x.useState(null),u=Ln(c,2),d=u[0],f=u[1],h=x.useState(-1),p=Ln(h,2),g=p[0],m=p[1],b=x.useState(n),y=Ln(b,2),w=y[0],S=y[1],C=x.useState(n),E=Ln(C,2),k=E[0],_=E[1],T=x.useRef(null),D=x.useRef(null);x.useEffect(function(){g===-1&&S(n)},[n,g]),x.useEffect(function(){return function(){document.removeEventListener("mousemove",T.current),document.removeEventListener("mouseup",D.current),document.removeEventListener("touchmove",T.current),document.removeEventListener("touchend",D.current)}},[]);var O=function(A,z){w.some(function(F,V){return F!==A[V]})&&(z!==void 0&&f(z),S(A),s(A))},M=function(A,z){if(A===-1){var F=k[0],V=k[k.length-1],ee=r-F,X=o-V,W=z*(o-r);W=Math.max(W,ee),W=Math.min(W,X);var L=i(F+W);W=L-F;var P=k.map(function(se){return se+W});O(P)}else{var j=(o-r)*z,Y=vi(w);Y[A]=k[A];var re=l(Y,j,A,"dist");O(re.values,re.value)}},R=x.useRef(M);R.current=M;var I=function(A,z){A.stopPropagation();var F=n[z];m(z),f(F),_(n);var V=fS(A),ee=V.pageX,X=V.pageY,W=function(j){j.preventDefault();var Y=fS(j),re=Y.pageX,se=Y.pageY,ie=re-ee,_e=se-X,Me=e.current.getBoundingClientRect(),Ot=Me.width,Ue=Me.height,it;switch(t){case"btt":it=-_e/Ue;break;case"ttb":it=_e/Ue;break;case"rtl":it=-ie/Ot;break;default:it=ie/Ot}R.current(z,it)},L=function P(j){j.preventDefault(),document.removeEventListener("mouseup",P),document.removeEventListener("mousemove",W),document.removeEventListener("touchend",P),document.removeEventListener("touchmove",W),T.current=null,D.current=null,m(-1),a()};document.addEventListener("mouseup",L),document.addEventListener("mousemove",W),document.addEventListener("touchend",L),document.addEventListener("touchmove",W),T.current=W,D.current=L},N=x.useMemo(function(){var $=vi(n).sort(function(z,F){return z-F}),A=vi(w).sort(function(z,F){return z-F});return $.every(function(z,F){return z===A[F]})?w:n},[n,w]);return[g,d,N,I]}function Gre(e){var t,n=e.prefixCls,r=e.style,o=e.start,i=e.end,s=e.index,a=e.onStartMove,l=x.useContext(Ws),c=l.direction,u=l.min,d=l.max,f=l.disabled,h=l.range,p="".concat(n,"-track"),g=_v(o,u,d),m=_v(i,u,d),b=function(S){!f&&a&&a(S,-1)},y={};switch(c){case"rtl":y.right="".concat(g*100,"%"),y.width="".concat(m*100-g*100,"%");break;case"btt":y.bottom="".concat(g*100,"%"),y.height="".concat(m*100-g*100,"%");break;case"ttb":y.top="".concat(g*100,"%"),y.height="".concat(m*100-g*100,"%");break;default:y.left="".concat(g*100,"%"),y.width="".concat(m*100-g*100,"%")}return x.createElement("div",{className:oe(p,(t={},Or(t,"".concat(p,"-").concat(s+1),h),Or(t,"".concat(n,"-track-draggable"),a),t)),style:Gr(Gr({},y),r),onMouseDown:b,onTouchStart:b})}function Yre(e){var t=e.prefixCls,n=e.style,r=e.values,o=e.startPoint,i=e.onStartMove,s=x.useContext(Ws),a=s.included,l=s.range,c=s.min,u=x.useMemo(function(){if(!l){if(r.length===0)return[];var d=o??c,f=r[0];return[{start:Math.min(d,f),end:Math.max(d,f)}]}for(var h=[],p=0;p<r.length-1;p+=1)h.push({start:r[p],end:r[p+1]});return h},[r,l,o,c]);return a?u.map(function(d,f){var h=d.start,p=d.end;return x.createElement(Gre,{index:f,prefixCls:t,style:xa(n,f),start:h,end:p,key:f,onStartMove:i})}):null}function Xre(e){var t=e.prefixCls,n=e.style,r=e.children,o=e.value,i=e.onClick,s=x.useContext(Ws),a=s.min,l=s.max,c=s.direction,u=s.includedStart,d=s.includedEnd,f=s.included,h="".concat(t,"-text"),p=Ry(c,o,a,l);return x.createElement("span",{className:oe(h,Or({},"".concat(h,"-active"),f&&u<=o&&o<=d)),style:Gr(Gr({},p),n),onMouseDown:function(m){m.stopPropagation()},onClick:function(){i(o)}},r)}function Jre(e){var t=e.prefixCls,n=e.marks,r=e.onClick,o="".concat(t,"-mark");return n.length?x.createElement("div",{className:o},n.map(function(i){var s=i.value,a=i.style,l=i.label;return x.createElement(Xre,{key:s,prefixCls:o,style:a,value:s,onClick:r},l)})):null}function Zre(e){var t=e.prefixCls,n=e.value,r=e.style,o=e.activeStyle,i=x.useContext(Ws),s=i.min,a=i.max,l=i.direction,c=i.included,u=i.includedStart,d=i.includedEnd,f="".concat(t,"-dot"),h=c&&u<=n&&n<=d,p=Gr(Gr({},Ry(l,n,s,a)),typeof r=="function"?r(n):r);return h&&(p=Gr(Gr({},p),typeof o=="function"?o(n):o)),x.createElement("span",{className:oe(f,Or({},"".concat(f,"-active"),h)),style:p})}function Qre(e){var t=e.prefixCls,n=e.marks,r=e.dots,o=e.style,i=e.activeStyle,s=x.useContext(Ws),a=s.min,l=s.max,c=s.step,u=x.useMemo(function(){var d=new Set;if(n.forEach(function(h){d.add(h.value)}),r&&c!==null)for(var f=a;f<=l;)d.add(f),f+=c;return Array.from(d)},[a,l,c,r,n]);return x.createElement("div",{className:"".concat(t,"-step")},u.map(function(d){return x.createElement(Zre,{prefixCls:t,key:d,value:d,style:o,activeStyle:i})}))}function eoe(e,t,n,r,o,i){var s=x.useCallback(function(h){var p=isFinite(h)?h:e;return p=Math.min(t,h),p=Math.max(e,p),p},[e,t]),a=x.useCallback(function(h){if(n!==null){var p=e+Math.round((s(h)-e)/n)*n,g=function(w){return(String(w).split(".")[1]||"").length},m=Math.max(g(n),g(t),g(e)),b=Number(p.toFixed(m));return e<=b&&b<=t?b:null}return null},[n,e,t,s]),l=x.useCallback(function(h){var p=s(h),g=r.map(function(y){return y.value});n!==null&&g.push(a(h)),g.push(e,t);var m=g[0],b=t-e;return g.forEach(function(y){var w=Math.abs(p-y);w<=b&&(m=y,b=w)}),m},[e,t,r,n,s,a]),c=function h(p,g,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof g=="number"){var y,w=p[m],S=w+g,C=[];r.forEach(function(D){C.push(D.value)}),C.push(e,t),C.push(a(w));var E=g>0?1:-1;b==="unit"?C.push(a(w+E*n)):C.push(a(S)),C=C.filter(function(D){return D!==null}).filter(function(D){return g<0?D<=w:D>=w}),b==="unit"&&(C=C.filter(function(D){return D!==w}));var k=b==="unit"?w:S;y=C[0];var _=Math.abs(y-k);if(C.forEach(function(D){var O=Math.abs(D-k);O<_&&(y=D,_=O)}),y===void 0)return g<0?e:t;if(b==="dist")return y;if(Math.abs(g)>1){var T=vi(p);return T[m]=y,h(T,g-E,m,b)}return y}else{if(g==="min")return e;if(g==="max")return t}},u=function(p,g,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",y=p[m],w=c(p,g,m,b);return{value:w,changed:w!==y}},d=function(p){return i===null&&p===0||typeof i=="number"&&p<i},f=function(p,g,m){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",y=p.map(l),w=y[m],S=c(y,g,m,b);if(y[m]=S,o===!1){var C=i||0;m>0&&y[m-1]!==w&&(y[m]=Math.max(y[m],y[m-1]+C)),m<y.length-1&&y[m+1]!==w&&(y[m]=Math.min(y[m],y[m+1]-C))}else if(typeof i=="number"||i===null){for(var E=m+1;E<y.length;E+=1)for(var k=!0;d(y[E]-y[E-1])&&k;){var _=u(y,1,E);y[E]=_.value,k=_.changed}for(var T=m;T>0;T-=1)for(var D=!0;d(y[T]-y[T-1])&&D;){var O=u(y,-1,T-1);y[T-1]=O.value,D=O.changed}for(var M=y.length-1;M>0;M-=1)for(var R=!0;d(y[M]-y[M-1])&&R;){var I=u(y,-1,M-1);y[M-1]=I.value,R=I.changed}for(var N=0;N<y.length-1;N+=1)for(var $=!0;d(y[N+1]-y[N])&&$;){var A=u(y,1,N+1);y[N+1]=A.value,$=A.changed}}return{value:y[m],values:y}};return[l,f]}var toe=x.forwardRef(function(e,t){var n,r=e.prefixCls,o=r===void 0?"rc-slider":r,i=e.className,s=e.style,a=e.disabled,l=a===void 0?!1:a,c=e.keyboard,u=c===void 0?!0:c,d=e.autoFocus,f=e.onFocus,h=e.onBlur,p=e.min,g=p===void 0?0:p,m=e.max,b=m===void 0?100:m,y=e.step,w=y===void 0?1:y,S=e.value,C=e.defaultValue,E=e.range,k=e.count,_=e.onChange,T=e.onBeforeChange,D=e.onAfterChange,O=e.allowCross,M=O===void 0?!0:O,R=e.pushable,I=R===void 0?!1:R,N=e.draggableTrack,$=e.reverse,A=e.vertical,z=e.included,F=z===void 0?!0:z,V=e.startPoint,ee=e.trackStyle,X=e.handleStyle,W=e.railStyle,L=e.dotStyle,P=e.activeDotStyle,j=e.marks,Y=e.dots,re=e.handleRender,se=e.tabIndex,ie=se===void 0?0:se,_e=e.ariaLabelForHandle,Me=e.ariaLabelledByForHandle,Ot=e.ariaValueTextFormatterForHandle,Ue=x.useRef(),it=x.useRef(),st=x.useMemo(function(){return A?$?"ttb":"btt":$?"rtl":"ltr"},[$,A]),jt=x.useMemo(function(){return isFinite(g)?g:0},[g]),lr=x.useMemo(function(){return isFinite(b)?b:100},[b]),_n=x.useMemo(function(){return w!==null&&w<=0?1:w},[w]),Bn=x.useMemo(function(){return typeof I=="boolean"?I?_n:!1:I>=0?I:!1},[I,_n]),Fn=x.useMemo(function(){var Ke=Object.keys(j||{});return Ke.map(function(je){var Se=j[je],Tt={value:Number(je)};return Se&&Bi(Se)==="object"&&!x.isValidElement(Se)&&("label"in Se||"style"in Se)?(Tt.style=Se.style,Tt.label=Se.label):Tt.label=Se,Tt}).filter(function(je){var Se=je.label;return Se||typeof Se=="number"}).sort(function(je,Se){return je.value-Se.value})},[j]),Po=eoe(jt,lr,_n,Fn,M,Bn),Gi=Ln(Po,2),ro=Gi[0],Ks=Gi[1],Yi=Hre(C,{value:S}),Hn=Ln(Yi,2),$t=Hn[0],oo=Hn[1],zt=x.useMemo(function(){var Ke=$t==null?[]:Array.isArray($t)?$t:[$t],je=Ln(Ke,1),Se=je[0],Tt=Se===void 0?jt:Se,tt=$t===null?[]:[Tt];if(E){if(tt=vi(Ke),k||$t===void 0){var Ys=k>=0?k+1:2;for(tt=tt.slice(0,Ys);tt.length<Ys;){var Zi;tt.push((Zi=tt[tt.length-1])!==null&&Zi!==void 0?Zi:jt)}}tt.sort(function($o,El){return $o-El})}return tt.forEach(function($o,El){tt[El]=ro($o)}),tt},[$t,E,jt,k,ro]),Wt=x.useRef(zt);Wt.current=zt;var Pr=function(je){return E?je:je[0]},xl=function(je){var Se=vi(je).sort(function(Tt,tt){return Tt-tt});_&&!zre(Se,Wt.current,!0)&&_(Pr(Se)),oo(Se)},zu=function(je){if(!l){var Se=0,Tt=lr-jt;zt.forEach(function(Ys,Zi){var $o=Math.abs(je-Ys);$o<=Tt&&(Tt=$o,Se=Zi)});var tt=vi(zt);tt[Se]=je,E&&!zt.length&&k===void 0&&tt.push(je),T==null||T(Pr(tt)),xl(tt),D==null||D(Pr(tt))}},Bu=function(je){je.preventDefault();var Se=it.current.getBoundingClientRect(),Tt=Se.width,tt=Se.height,Ys=Se.left,Zi=Se.top,$o=Se.bottom,El=Se.right,rb=je.clientX,ob=je.clientY,kl;switch(st){case"btt":kl=($o-ob)/tt;break;case"ttb":kl=(ob-Zi)/tt;break;case"rtl":kl=(El-rb)/Tt;break;default:kl=(rb-Ys)/Tt}var tI=jt+kl*(lr-jt);zu(ro(tI))},wp=x.useState(null),wl=Ln(wp,2),Sl=wl[0],Fu=wl[1],Sp=function(je,Se){if(!l){var Tt=Ks(zt,je,Se);T==null||T(Pr(zt)),xl(Tt.values),D==null||D(Pr(Tt.values)),Fu(Tt.value)}};x.useEffect(function(){if(Sl!==null){var Ke=zt.indexOf(Sl);Ke>=0&&Ue.current.focus(Ke)}Fu(null)},[Sl]);var pt=x.useMemo(function(){return N&&_n===null?!1:N},[N,_n]),en=function(){D==null||D(Pr(Wt.current))},tn=Kre(it,st,zt,jt,lr,ro,xl,en,Ks),Mn=Ln(tn,4),nn=Mn[0],Dn=Mn[1],mn=Mn[2],Ao=Mn[3],vn=function(je,Se){Ao(je,Se),T==null||T(Pr(Wt.current))},Lo=nn!==-1;x.useEffect(function(){if(!Lo){var Ke=zt.lastIndexOf(Dn);Ue.current.focus(Ke)}},[Lo]);var Vn=x.useMemo(function(){return vi(mn).sort(function(Ke,je){return Ke-je})},[mn]),Gs=x.useMemo(function(){return E?[Vn[0],Vn[Vn.length-1]]:[jt,Vn[0]]},[Vn,E,jt]),Xi=Ln(Gs,2),Cl=Xi[0],jo=Xi[1];x.useImperativeHandle(t,function(){return{focus:function(){Ue.current.focus(0)},blur:function(){var je=document,Se=je.activeElement;it.current.contains(Se)&&(Se==null||Se.blur())}}}),x.useEffect(function(){d&&Ue.current.focus(0)},[]);var Ji=x.useMemo(function(){return{min:jt,max:lr,direction:st,disabled:l,keyboard:u,step:_n,included:F,includedStart:Cl,includedEnd:jo,range:E,tabIndex:ie,ariaLabelForHandle:_e,ariaLabelledByForHandle:Me,ariaValueTextFormatterForHandle:Ot}},[jt,lr,st,l,u,_n,F,Cl,jo,E,ie,_e,Me,Ot]);return x.createElement(Ws.Provider,{value:Ji},x.createElement("div",{ref:it,className:oe(o,i,(n={},Or(n,"".concat(o,"-disabled"),l),Or(n,"".concat(o,"-vertical"),A),Or(n,"".concat(o,"-horizontal"),!A),Or(n,"".concat(o,"-with-marks"),Fn.length),n)),style:s,onMouseDown:Bu},x.createElement("div",{className:"".concat(o,"-rail"),style:W}),x.createElement(Yre,{prefixCls:o,style:ee,values:Vn,startPoint:V,onStartMove:pt?vn:null}),x.createElement(Qre,{prefixCls:o,marks:Fn,dots:Y,style:L,activeStyle:P}),x.createElement(qre,{ref:Ue,prefixCls:o,style:X,values:mn,draggingIndex:nn,onStartMove:vn,onOffsetChange:Sp,onFocus:f,onBlur:h,handleRender:re}),x.createElement(Jre,{prefixCls:o,marks:Fn,onClick:zu})))}),Iy={},Ll={},hS;function noe(){if(hS)return Ll;hS=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.default=void 0;var e={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(n){var r=n.keyCode;if(n.altKey&&!n.ctrlKey||n.metaKey||r>=e.F1&&r<=e.F12)return!1;switch(r){case e.ALT:case e.CAPS_LOCK:case e.CONTEXT_MENU:case e.CTRL:case e.DOWN:case e.END:case e.ESC:case e.HOME:case e.INSERT:case e.LEFT:case e.MAC_FF_META:case e.META:case e.NUMLOCK:case e.NUM_CENTER:case e.PAGE_DOWN:case e.PAGE_UP:case e.PAUSE:case e.PRINT_SCREEN:case e.RIGHT:case e.SHIFT:case e.UP:case e.WIN_KEY:case e.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(n){if(n>=e.ZERO&&n<=e.NINE||n>=e.NUM_ZERO&&n<=e.NUM_MULTIPLY||n>=e.A&&n<=e.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&n===0)return!0;switch(n){case e.SPACE:case e.QUESTION_MARK:case e.NUM_PLUS:case e.NUM_MINUS:case e.NUM_PERIOD:case e.NUM_DIVISION:case e.SEMICOLON:case e.DASH:case e.EQUALS:case e.COMMA:case e.PERIOD:case e.SLASH:case e.APOSTROPHE:case e.SINGLE_QUOTE:case e.OPEN_SQUARE_BRACKET:case e.BACKSLASH:case e.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};return Ll.default=e,Ll}var jl={},pS;function roe(){if(pS)return jl;pS=1;var e=ip;Object.defineProperty(jl,"__esModule",{value:!0}),jl.default=void 0;var t=r(U);function n(s){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(n=function(u){return u?l:a})(s)}function r(s,a){if(s&&s.__esModule)return s;if(s===null||e(s)!=="object"&&typeof s!="function")return{default:s};var l=n(a);if(l&&l.has(s))return l.get(s);var c={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var f=u?Object.getOwnPropertyDescriptor(s,d):null;f&&(f.get||f.set)?Object.defineProperty(c,d,f):c[d]=s[d]}return c.default=s,l&&l.set(s,c),c}var o=t.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0}),i=o;return jl.default=i,jl}var sa={},gS;function ooe(){if(gS)return sa;gS=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.getDirectionStyle=t,sa.getIndex=n,sa.getOffset=e;function e(r,o,i){return(r-o)/(i-o)}function t(r,o,i,s){var a=e(o,i,s),l={};switch(r){case"rtl":l.right="".concat(a*100,"%"),l.transform="translateX(50%)";break;case"btt":l.bottom="".concat(a*100,"%"),l.transform="translateY(50%)";break;case"ttb":l.top="".concat(a*100,"%"),l.transform="translateY(-50%)";break;default:l.left="".concat(a*100,"%"),l.transform="translateX(-50%)";break}return l}function n(r,o){return Array.isArray(r)?r[o]:r}return sa}var Us=nre,ioe=ip;Object.defineProperty(Iy,"__esModule",{value:!0});var ZM=Iy.default=void 0,soe=Us(rre),mS=Us(JY()),vS=Us(lM()),aoe=Us(QY()),Ag=doe(U),loe=Us(YE),Yo=Us(noe()),coe=Us(roe()),$l=ooe(),uoe=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"];function QM(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(QM=function(o){return o?n:t})(e)}function doe(e,t){if(e&&e.__esModule)return e;if(e===null||ioe(e)!=="object"&&typeof e!="function")return{default:e};var n=QM(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var foe=Ag.forwardRef(function(e,t){var n,r,o=e.prefixCls,i=e.value,s=e.valueIndex,a=e.onStartMove,l=e.style,c=e.render,u=e.dragging,d=e.onOffsetChange,f=(0,aoe.default)(e,uoe),h=Ag.useContext(coe.default),p=h.min,g=h.max,m=h.direction,b=h.disabled,y=h.keyboard,w=h.range,S=h.tabIndex,C=h.ariaLabelForHandle,E=h.ariaLabelledByForHandle,k=h.ariaValueTextFormatterForHandle,_="".concat(o,"-handle"),T=function(I){b||a(I,s)},D=function(I){if(!b&&y){var N=null;switch(I.which||I.keyCode){case Yo.default.LEFT:N=m==="ltr"||m==="btt"?-1:1;break;case Yo.default.RIGHT:N=m==="ltr"||m==="btt"?1:-1;break;case Yo.default.UP:N=m!=="ttb"?1:-1;break;case Yo.default.DOWN:N=m!=="ttb"?-1:1;break;case Yo.default.HOME:N="min";break;case Yo.default.END:N="max";break;case Yo.default.PAGE_UP:N=2;break;case Yo.default.PAGE_DOWN:N=-2;break}N!==null&&(I.preventDefault(),d(N,s))}},O=(0,$l.getDirectionStyle)(m,i,p,g),M=Ag.createElement("div",(0,soe.default)({ref:t,className:(0,loe.default)(_,(n={},(0,vS.default)(n,"".concat(_,"-").concat(s+1),w),(0,vS.default)(n,"".concat(_,"-dragging"),u),n)),style:(0,mS.default)((0,mS.default)({},O),l),onMouseDown:T,onTouchStart:T,onKeyDown:D,tabIndex:b?null:(0,$l.getIndex)(S,s),role:"slider","aria-valuemin":p,"aria-valuemax":g,"aria-valuenow":i,"aria-disabled":b,"aria-label":(0,$l.getIndex)(C,s),"aria-labelledby":(0,$l.getIndex)(E,s),"aria-valuetext":(r=(0,$l.getIndex)(k,s))===null||r===void 0?void 0:r(i),"aria-orientation":m==="ltr"||m==="rtl"?"horizontal":"vertical"},f));return c&&(M=c(M,{index:s,prefixCls:o,value:i,dragging:u})),M}),hoe=foe;ZM=Iy.default=hoe;const poe="_container_1bhdk_1",goe="_small_1bhdk_7",moe="_vertical_1bhdk_10",voe="_hasArrows_1bhdk_14",yoe="_button_1bhdk_18",boe="_label_1bhdk_21",xoe="_dot_1bhdk_29",fo={container:poe,small:goe,vertical:moe,hasArrows:voe,button:yoe,label:boe,dot:xoe},woe=e=>e.reduce((t,{label:n,tooltip:r,value:o})=>(t[o]=v.jsx(hn,{text:v.jsxs(v.Fragment,{children:[r,r?": ":"",n??o]}),children:v.jsx("div",{className:fo.dot})}),t),{}),Soe=Nd(woe,Dy),Coe=({name:e,label:t,width:n="100%",labelWidth:r="auto",value:o,min:i,max:s,step:a=1,marks:l=[],showArrows:c=!1,showTooltip:u=!1,tooltipFormatter:d=b=>b,disabled:f=!1,range:h=!1,small:p=!1,vertical:g={enabled:!1,width:"100px",height:"400px"},onChange:m=We.noop})=>{const b=x.useContext(ht),y=Soe(l),w=k=>{const _=typeof t=="string"?t:String(t);m({target:{name:e??"",value:k,label:_}})},S=()=>v.jsx("div",{className:fo.button,children:v.jsx(ln,{basic:!0,small:!0,round:!0,onClick:()=>w(h?[i,o==null?void 0:o[1]]:i),disabled:f||o===i||b,icon:Ce.FAST_BACKWARD})}),C=()=>v.jsx("div",{className:fo.button,children:v.jsx(ln,{basic:!0,small:!0,round:!0,onClick:()=>w(h?[o==null?void 0:o[0],s]:s),disabled:f||o===s||b,icon:Ce.FAST_FORWARD})}),E=(k,_)=>{const T=u&&_.dragging;return v.jsx(ZM,{...k.props,..._,children:T&&v.jsx(hn,{display:"block",text:d(o),forceOpen:!0,children:v.jsx("div",{style:{position:"absolute",inset:0}})})})};return v.jsxs("div",{className:oe(fo.container,p?fo.small:"",g.enabled?fo.vertical:""),style:g.enabled?{width:g.width,height:g.height}:{width:n},children:[c&&(g.enabled?v.jsx(C,{}):v.jsx(S,{})),v.jsx(toe,{range:h,allowCross:!1,className:oe((f||b)&&fo.rcSliderDisabled,c&&fo.hasArrows),value:o,max:s,min:i,step:a,marks:y,onChange:k=>w(k),disabled:f||b,vertical:g.enabled,handleRender:E}),c&&(g.enabled?v.jsx(S,{}):v.jsx(C,{})),t&&v.jsx("label",{className:fo.label,style:{width:r},children:t})]})},zhe=({height:e="var(--padding)",width:t=null,flex:n=!1})=>v.jsx("div",{style:{height:e,width:t||"auto",flexGrow:n?1:0,flexShrink:0,display:t?"inline-block":"block"}}),Eoe="_wrapper_xkoxm_85",koe="_bordered_xkoxm_93",Ooe="_scroll_xkoxm_98",Toe="_table_xkoxm_109",_oe="_dragOverlay_xkoxm_145",Moe="_striped_xkoxm_194",yi={wrapper:Eoe,bordered:koe,scroll:Ooe,table:Toe,dragOverlay:_oe,striped:Moe},Doe="_title_zn5s7_1",Roe={title:Doe},Ioe=({name:e=null,actions:t=null,actionsRight:n=!1,testId:r})=>{const o=e!==null,i=t!==null;if(!o&&!i)return null;const s=()=>{if(!i)return null;const a=v.jsx(Vi,{actions:t});return n?a:v.jsx("div",{children:a})};return v.jsxs("div",{className:Roe.title,children:[o?v.jsx(Vk,{children:v.jsx("span",{"data-testid":r,children:e})}):null,s()]})},Noe="_footer_4sumy_1",Poe="_section_4sumy_7",Lg={footer:Noe,section:Poe},Aoe=({colSpan:e,pagination:t,actions:n,content:r,testId:o})=>{const i=n&&n.length,s=r!=null,a=()=>{var c,u;if(t){const{rowCount:d,rowsPerPage:f}=t,h=Number((u=(c=f==null?void 0:f.options)==null?void 0:c[0])==null?void 0:u.value);return d>h}return!1};return i||s||a()?v.jsxs("div",{className:Lg.footer,"data-testid":`${o??"pagination"}-footer`,children:[s?v.jsx("div",{className:Lg.section,children:v.jsx("div",{children:r})}):null,i||a()?v.jsxs("div",{className:Lg.section,children:[a()?v.jsx(r6,{pagination:t}):v.jsx("div",{}),i&&v.jsx("div",{children:v.jsx(Vi,{actions:n})})]}):null]}):null},yS=e=>{const t=Math.max(...e.reduce((n,r)=>{const o=r.cells.map(i=>i.colSpan?i.colSpan:1).reduce((i,s)=>i+s,0);return n.concat(o)},[]));return isNaN(t)?0:t},Loe=(e,t)=>{const n=[yS(t),yS(e)];return Math.max(...n)},bS=e=>e.reduce((t,n)=>n.actions&&n.actions.length>0?1:t,0),joe=(e,t)=>bS(t)>0||bS(e)>0,$oe="_clickableRow_kqvtd_1",zoe="_hoverableRow_kqvtd_4",Boe="_rowActive_kqvtd_4",Foe="_expandableRow_kqvtd_8",Hoe="_flush_kqvtd_8",Voe="_dragIconCell_kqvtd_34",Woe="_dragIcon_kqvtd_34",Uoe="_dragIconDisabled_kqvtd_55",Hr={clickableRow:$oe,hoverableRow:zoe,rowActive:Boe,expandableRow:Foe,flush:Hoe,dragIconCell:Voe,dragIcon:Woe,dragIconDisabled:Uoe},xS=({colSpan:e,children:t,flush:n})=>v.jsx("tr",{children:v.jsx("td",{colSpan:e,className:oe(Hr.expandableRow,n?Hr.flush:""),children:t})}),wS=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},n=!1)=>{if(!e)return null;const{bodyAlignment:r,headerAlignment:o,isHeader:i}=e;switch(i&&o?o:r){case Xt.LEFT:return n?Xt.LEFT:t.leftAligned;case Xt.RIGHT:return n?Xt.RIGHT:t.rightAligned;case Xt.CENTER:return n?Xt.CENTER:t.centerAligned;default:return n?Xt.LEFT:t.leftAligned}},qoe=(e,t=!1,n=0)=>{if(!e||e.length===0)return[];const r=e.every(i=>Array.isArray(i)),o=e.every(i=>typeof i=="string");return r&&t?e[n]||[]:o?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},Koe="_cell_ie6ng_77",Goe="_disabledLink_ie6ng_87",Yoe="_inputWrapper_ie6ng_91",Xoe="_numberInputWrapper_ie6ng_106",Joe="_breakWord_ie6ng_113",Zoe="_inputCell_ie6ng_116",Qoe="_sliderCell_ie6ng_119",eie="_staticCell_ie6ng_123",tie="_staticCellContent_ie6ng_126",nie="_unit_ie6ng_148",rie="_sortingCell_ie6ng_151",oie="_sortingCellIcon_ie6ng_162",iie="_icon_ie6ng_173",sie="_checkBoxCell_ie6ng_177",aie="_iconCellWrapper_ie6ng_181",lie="_actionsCell_ie6ng_185",cie="_rightAligned_ie6ng_193",uie="_centerAligned_ie6ng_199",die="_leftAligned_ie6ng_205",fie="_popover_ie6ng_208",Ge={cell:Koe,disabledLink:Goe,inputWrapper:Yoe,numberInputWrapper:Xoe,breakWord:Joe,inputCell:Zoe,sliderCell:Qoe,staticCell:eie,staticCellContent:tie,unit:nie,sortingCell:rie,sortingCellIcon:oie,icon:iie,checkBoxCell:sie,iconCellWrapper:aie,actionsCell:lie,rightAligned:cie,centerAligned:uie,leftAligned:die,popover:fie},SS=({cell:e,columnAlignment:t,testId:n,type:r})=>v.jsx(P0,{name:e.name,value:e.value,onChange:o=>{var i;return(i=e.onChange)==null?void 0:i.call(e,o)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:o=>{var i;return(i=e.onPaste)==null?void 0:i.call(e,o)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===Xt.RIGHT,selectOnFocus:e.selectOnFocus,testId:n,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:r}),hie=14,ls=e=>String(vr.toString(e)),pie=e=>vr.isScientificStringNum(e)?e:ls(vr.roundToPrecision(vr.toNum(e),hie)),gie=e=>e?typeof e=="string"?e:We.isArray(e)?e[0]:e.fieldName:"",mie=({name:e,placeholder:t="",disabled:n=!1,error:r=!1,left:o=!1,small:i=!1,width:s="100%",value:a="",onChange:l=()=>{},onFocus:c=()=>{},onBlur:u=()=>{},selectOnFocus:d,tabIndex:f=0,testId:h,tooltip:p=null,warning:g=!1,validationCallback:m=()=>{},allowEmpty:b=!1,isInTable:y,groupOrder:w,enableCosmeticRounding:S=!0,enableDisplayRounding:C=!1,roundDisplayValue:E,disableInternalErrorValidationMessages:k=!1})=>{const _=P=>{const j=vr.validateNumber(P),Y=t&&Ef(P);return[1/0,-1/0].includes(Number(P))?{valid:!0,errors:[]}:Y?{valid:!0,errors:[]}:b&&P===""||j.valid?{...j,valid:!0,errors:void 0}:j},T=P=>{var j;const Y=!!(P!=null&&P.endsWith("0")),se=S&&P&&!Y&&((j=_(P))==null?void 0:j.valid)?pie(P):P;return ls(se)},D=x.useRef(null),[O,M]=x.useState(T(ls(a))),[R,I]=x.useState(!1),N=gie(e),{valid:$,errors:A}=_(O),z=A&&A.length&&!k?A[0]:null;x.useEffect(()=>{const P=T(ls(a));vr.toNum(O)!==vr.toNum(P)&&M(P)},[a,S,C]),x.useEffect(()=>{!R&&!$?m(N,z):m(N,null)},[R,$,r]);const F=P=>{var j,Y;const re=P instanceof KeyboardEvent?O:(j=P==null?void 0:P.target)==null?void 0:j.value,se=vr.cleanNumStr(re.replaceAll(" ","").replaceAll("|",""));if(M(se),(Y=_(se))!=null&&Y.valid||t&&Ef(re)){const ie={...P,target:{...P.target,value:vr.stripLeadingZeros(ls(se)),name:N}};l(ie)}};x.useEffect(()=>{if(D&&(D!=null&&D.current)&&C&&R){const P=D.current;P&&!d&&setTimeout(()=>{const{length:j}=ls(O);P.setSelectionRange(j,j)},0)}},[R]);const V=P=>{I(!0),c(P)},ee=P=>{I(!1),u(P)},L=C&&!R&&$?E?ls(E(O)):(P=>y?vr.roundToFixed(P,2):vr.roundByMagnitude(P,4))(a):O;return v.jsx(AO,{handleKeys:[Wr.ENTER],onKeyEvent:(P,j)=>F(j),children:v.jsx(P0,{type:"text",name:N,testId:h,disabled:n,placeholder:t,value:L,onChange:F,onFocus:V,onBlur:ee,error:z||r,warning:g,right:!o,small:i,width:s,isInTable:y,groupOrder:w,selectOnFocus:d,tabIndex:f,tooltip:p,ref:D},N)})},vie=({cell:e,columnAlignment:t,testId:n})=>v.jsx(mie,{name:e.name,value:e.value,onChange:r=>{var o;return(o=e.onChange)==null?void 0:o.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left??t===Xt.LEFT,selectOnFocus:e.selectOnFocus,tabIndex:e.disabled?-1:0,testId:n,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableCosmeticRounding:e.enableCosmeticRounding,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue}),yie=({cell:e,columnAlignment:t,testId:n})=>v.jsx(VO,{name:e.name,borderRadius:0,options:e.options,onChange:r=>{var o;return(o=e.onChange)==null?void 0:o.call(e,r)},onCreate:e.onCreate?r=>e.onCreate&&e.onCreate(r):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===Xt.RIGHT,testId:n,tabIndex:e.disabled?-1:0}),bie=({cell:e,columnAlignment:t,testId:n})=>v.jsx("div",{className:oe(Ge.inputWrapper,e.type==="NumberInput"?Ge.numberInputWrapper:""),children:e.type==="Input"?v.jsx(SS,{cell:e,columnAlignment:t,testId:n}):e.type==="NumberInput"?v.jsx(vie,{cell:e,columnAlignment:t,testId:n}):e.type==="DateInput"?v.jsx(SS,{cell:e,testId:n,type:"date"}):e.type==="Select"?v.jsx(yie,{cell:e,columnAlignment:t,testId:n}):null}),xie=({cell:e,testId:t})=>{const n=x.useContext(ht),{error:r,warning:o,tooltip:i,maxTooltipWidth:s}=e,a=l=>ft(l);return v.jsx("div",{className:Ge.inputWrapper,children:v.jsx(hn,{error:!!r,warning:!!o,text:i||r||o,enabled:a(i)||a(r)||a(o)||!1,maxWidth:s,children:v.jsx("div",{className:Ge.staticCellContent,"data-error":r||null,"data-warning":o||null,children:v.jsx("a",{className:oe((e.disabled||n)&&Ge.disabledLink),onClick:e.disabled||n?void 0:l=>{var c;l.stopPropagation(),(c=e.onClick)==null||c.call(e,l)},"data-testid":t,children:e.value})})})})},wie=({cell:e,testId:t})=>v.jsx(E$,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:n=>e.onChange(n),testId:t,tabIndex:e.disabled?-1:0}),Sie=({cell:e})=>v.jsx("div",{className:Ge.inputWrapper,children:v.jsx(Coe,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})}),Cie=({cell:e})=>{const{tooltip:t,icon:n}=e;return v.jsx("div",{className:Ge.iconCellWrapper,children:v.jsx(hn,{text:t,enabled:!!t&&ft(t),display:"flex",placement:"top-center",children:v.jsx(Ae,{icon:n})})})},Eie=({cell:e})=>v.jsx(Vi,{actions:e.actions}),kie=({cell:e})=>{const{helpIcon:t}=e;return t?v.jsx("div",{className:Ge.icon,children:v.jsx(Er,{onClick:t.onClick,text:t.tooltip})}):null},Oie=({cell:e})=>{const{libraryIcon:t}=e;return t?v.jsx("div",{className:Ge.icon,children:v.jsx(Er,{onClick:t.onClick,text:t.tooltip,icon:Ce.LIBRARY})}):null},Tie=({cell:e})=>{const{hasSort:t,sort:n,sortPriority:r}=e;return t?v.jsxs("span",{className:Ge.sortingCellIcon,children:[n==="down"?v.jsx(bs,{link:!0,children:v.jsx(Ae,{icon:Ce.SORT_ASCENDING})}):n==="up"?v.jsx(bs,{link:!0,children:v.jsx(Ae,{icon:Ce.SORT_DESCENDING})}):v.jsx(bs,{faint:!0,children:v.jsx(Ae,{icon:Ce.SORT_DESCENDING})}),r&&n?v.jsx("sup",{children:r}):null]}):null},eD=({cell:e,isHeader:t,testId:n})=>{const{error:r,warning:o,tooltip:i,maxTooltipWidth:s,hasSort:a,onSort:l,type:c}=e,u=v.jsxs("div",{className:oe(Ge.staticCellContent,c==="Unit"?Ge.unit:""),onClick:a?d=>l&&l(d):()=>{},"data-error":r||null,"data-warning":o||null,"data-testid":n,children:[e.value,t?v.jsxs(v.Fragment,{children:[v.jsx(kie,{cell:e}),v.jsx(Oie,{cell:e}),v.jsx(Tie,{cell:e})]}):null]});return v.jsx("div",{className:Ge.inputWrapper,children:v.jsx(hn,{error:!!r,warning:!!o,text:i||r||o,enabled:i&&ft(i)||r&&ft(r)||o&&ft(o)||!1,maxWidth:s,display:"block",children:u})})},_ie=({cell:e,testId:t})=>{const{content:n,fullWidth:r,closeOnOutsideClick:o,disabled:i}=e;return v.jsx(a6,{content:n,fullWidth:r,closeOnOutsideClick:o,disabled:i,children:v.jsx("div",{className:Ge.popover,children:v.jsx(eD,{cell:e,testId:t})})})},Mie=({cell:e,isHeader:t,columnAlignment:n,testId:r})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return v.jsx(bie,{cell:e,columnAlignment:n,testId:r});case"Link":return v.jsx(xie,{cell:e,testId:r});case"CheckBox":return v.jsx(wie,{cell:e,testId:r});case"Slider":return v.jsx(Sie,{cell:e});case"Icon":return v.jsx(Cie,{cell:e});case"Actions":return v.jsx(Eie,{cell:e});case"Popover":return v.jsx(_ie,{cell:e});default:return v.jsx(eD,{cell:e,isHeader:t,testId:r})}};var go=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(go||{});const CS=({cell:e,isHeader:t,columnHeaderAlignment:n,columnAlignment:r=Xt.LEFT,width:o,testId:i})=>{if(!e)return null;const{style:s,colSpan:a,rowSpan:l,width:c}=e,u=x.useRef(null),d={bodyAlignment:r,headerAlignment:n,isHeader:t},f=wS(d,Ge),h=wS(d,Ge,!0),p=e.type===go.INPUT||e.type===go.NUMBER_INPUT||e.type===go.SELECT||e.type===go.POPOVER?Ge.inputCell:e.type===go.SLIDER?Ge.sliderCell:e.type===go.CHECKBOX?Ge.checkBoxCell:e.type===go.ACTIONS?Ge.actionsCell:Ge.staticCell,g=oe(Ge.cell,p,e.hasSort?Ge.sortingCell:null,f,e.breakWord?Ge.breakWord:""),m=c??o??void 0,b={width:m,minWidth:m,...s},y=t?"th":"td";return v.jsx(y,{ref:u,className:g,style:b,colSpan:a,rowSpan:l,children:v.jsx(Mie,{cell:e,columnAlignment:h??Xt.RIGHT,isHeader:t,testId:i})})},Qd=({row:e,rowIndex:t,isHeader:n=!1,columnCount:r,colSpan:o,columnHeaderAlignments:i=[],columnAlignment:s=[],hasRowActions:a,draggableTable:l=!1,columnWidths:c,dropDisabled:u=!1,height:d,testId:f})=>{const h=qoe(i,n,t),{onRowClick:p,onRowFocus:g,onRowMouseEnter:m,onRowMouseLeave:b,expandedContent:y,error:w,warning:S,active:C}=e,E=e.cells.map(($,A)=>{const z=`${n?0:1}_${t}_${A}`;return v.jsx(CS,{cell:$,isHeader:n,columnAlignment:s[A],columnHeaderAlignment:h[A],width:c?c[A]:void 0,testId:$.testId},z)}),k=a&&v.jsx(CS,{cell:{type:go.ACTIONS,actions:e.actions},isHeader:n},r),{attributes:_,listeners:T,setNodeRef:D,transform:O,transition:M,isDragging:R}=DO({id:t.toString(),animateLayoutChanges:()=>!1}),I={transform:u?void 0:So.Translate.toString(O),height:d,transition:M,opacity:R?0:void 0},N=()=>e.noDrag?v.jsx("td",{"aria-labelledby":"unique-label-id"}):v.jsx("td",{className:Hr.dragIconCell,children:v.jsx("div",{className:oe(Hr.dragIcon,u?Hr.dragIconDisabled:""),..._,...T,children:v.jsx(Ae,{icon:Ce.DRAG})})});return n?v.jsxs(v.Fragment,{children:[v.jsxs("tr",{onClick:p,onMouseEnter:m,onMouseLeave:b,onFocus:g,className:oe(p?Hr.clickableRow:null,m?Hr.hoverableRow:null),children:[l?v.jsx("th",{}):null,E,k]},t),y&&y.content?v.jsx(xS,{colSpan:o,flush:y.flush===!0,children:y.content},`${t}_expanded_content`):null]}):v.jsxs(v.Fragment,{children:[v.jsxs("tr",{ref:e.noDrag?null:D,onClick:p,onMouseEnter:m,onMouseLeave:b,onFocus:g,className:oe(p&&!p.noStyle?Hr.clickableRow:null,m&&!m.noStyle?Hr.hoverableRow:null,C?Hr.rowActive:null),"data-error":w||null,"data-warning":S||null,"data-index":t,"data-even":t%2===0,style:I,children:[l?N():null,E,k]},t),y&&y.content?v.jsx(xS,{colSpan:o,flush:y.flush===!0,children:y.content},`${t}_expanded_content`):null]})},Die=e=>{const{children:t,colSpan:n,columnAlignment:r,columnCount:o,draggable:i,onListReorder:s=()=>{},canListReorder:a=()=>!0,rowActions:l,rows:c=[],tbodyRef:u}=e,[d,f]=x.useState(null),[h,p]=x.useState(!1),g=x.useMemo(()=>c.map((S,C)=>C.toString()),[c]),m=S=>{f(S.active.id)},b=S=>{f(null),p(!1);const{active:C,over:E}=S;if(!C||!E||C.id===E.id)return;const k=Number(C.id),_=Number(E==null?void 0:E.id);a({from:k,to:_})&&s({from:k,to:_})},y=S=>{const{active:C,over:E}=S,k=Number(C.id),_=Number(E==null?void 0:E.id),T=k!==_&&!a({from:k,to:_});p(T)},w=()=>{if(!(u!=null&&u.current))return[];const C=u.current.querySelectorAll("tr")[Number(d)],E=C==null?void 0:C.querySelectorAll("td");if(!E)return[];const k=Array.from(E).map(_=>`${_.getBoundingClientRect().width}px`);return k.shift(),k};return i?v.jsxs(a5,{collisionDetection:hV,onDragStart:m,onDragEnd:b,onDragOver:y,children:[v.jsx(I5,{items:g,strategy:D5,children:t({dropDisabled:h})}),!!d&&xr.createPortal(v.jsx(O5,{dropAnimation:null,children:v.jsx("table",{className:oe(yi.table,yi.dragOverlay),children:v.jsx("tbody",{children:v.jsx(Qd,{rowIndex:Number(d),row:c[Number(d)],columnCount:o,columnWidths:w(),colSpan:n,hasRowActions:l,columnAlignment:r,draggableTable:i,dropDisabled:h})})})}),document.body)]}):t({})},Rie=({table:e,theadRef:t,children:n})=>{var r;const o=x.useRef(null),i=30,s=1,a=rW({count:((r=e.rows)==null?void 0:r.length)??0,getScrollElement:()=>o.current,estimateSize:()=>i+s,overscan:10}),l=()=>{var c;const u=((c=t.current)==null?void 0:c.clientHeight)??0,d=a.getTotalSize()+u,f=a.getVirtualItems(),h=f.length>0?f[0].start:0,p=f.length>0?a.getTotalSize()-f[f.length-1].end:0;return{"--virtualPaddingTop":h+"px","--virtualPaddingBottom":p+"px",height:d}};return v.jsx("div",{id:"scrollWrapper",className:yi.scroll,ref:o,children:n({virtualizer:a,tableStyle:l()})})},Iie=({table:e,theadRef:t,children:n})=>{const{infiniteScroll:r=!1}=e;return r?v.jsx(Rie,{table:e,theadRef:t,children:({virtualizer:o,tableStyle:i})=>n({virtualizer:o,tableStyle:i})}):v.jsx("div",{id:"scrollWrapper",className:yi.scroll,children:n({})})},Bhe=e=>{var t,n,r,o,i,s,a;const{onListReorder:l=()=>{},canListReorder:c=()=>!0,table:u}=e,{columnWidths:d,footer:f,name:h,rows:p=[],actions:g,actionsRight:m,columnHeaderAlignments:b,columnAlignment:y,striped:w=!0,testId:S,draggable:C,defaultEmptyRow:E=null,onAddRow:k=null,bordered:_=!0,maxHeight:T,fixedWidth:D}=u,O=x.useRef(null),M=x.useRef(null),R=We.get(e,"table.headers",[]),I=Loe(p,R),N=joe(p,R),$=I+(N?1:0),A=f?((n=(t=f==null?void 0:f.pagination)==null?void 0:t.rowsPerPage)==null?void 0:n.value)===0||Number((r=f==null?void 0:f.pagination)==null?void 0:r.selectedPage)>=Number((o=f==null?void 0:f.pagination)==null?void 0:o.rowCount)/Number((s=(i=f==null?void 0:f.pagination)==null?void 0:i.rowsPerPage)==null?void 0:s.value):!0,z=((a=E==null?void 0:E.cells)==null?void 0:a.length)&&k&&A,V={cells:z?E.cells.map((P,j)=>(P==null?void 0:P.type)==="Input"?{...P,onChange:Y=>{var re;const se=(re=Y==null?void 0:Y.target)==null?void 0:re.value,ie={...E,cells:E.cells.map((_e,Me)=>({..._e,value:Me===j?se:_e==null?void 0:_e.value}))};k({newRow:ie})}}:{...P,disabled:!0}):null,testId:S?`${S}-last-empty-row`:void 0},ee=z?p.concat(V):p,X={...u,rows:ee},W=oe(yi.wrapper,_?yi.bordered:""),L={maxHeight:T,width:D,display:D==="auto"?"inline-flex":"flex"};return v.jsxs("div",{className:W,style:L,children:[v.jsx(Ioe,{actions:g,actionsRight:m,name:h,testId:S&&`${S}-title`}),v.jsx(Die,{colSpan:$,columnAlignment:y,columnCount:I,draggable:C,onListReorder:l,rowActions:N,rows:ee,tbodyRef:M,canListReorder:c,children:({dropDisabled:P})=>v.jsx(Iie,{table:X,theadRef:O,children:({virtualizer:j,tableStyle:Y})=>v.jsxs("table",{className:oe(yi.table,w?yi.striped:""),"data-testid":S,style:Y,children:[v.jsx("thead",{ref:O,children:R.map((re,se)=>v.jsx(Qd,{rowIndex:se,isHeader:!0,row:re,columnCount:I,columnWidths:d,colSpan:$,hasRowActions:N,columnAlignment:y,columnHeaderAlignments:b,draggableTable:C},`0_${se}`))}),v.jsx("tbody",{ref:M,children:j?j.getVirtualItems().map(re=>v.jsx(Qd,{rowIndex:re.index,row:ee[re.index],columnCount:I,columnWidths:d,colSpan:$,hasRowActions:N,columnAlignment:y,draggableTable:C,height:re.size,dropDisabled:P},`1_${re.index}`)):ee.map((re,se)=>v.jsx(Qd,{rowIndex:se,row:re,columnCount:I,columnWidths:d,colSpan:$,hasRowActions:N,columnAlignment:y,draggableTable:C,dropDisabled:P},`1_${se}`))})]})})}),f&&v.jsx(Aoe,{pagination:f.pagination,actions:f.actions,content:f.content})]})};function Mv(){return Mv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mv.apply(this,arguments)}function Nie(e){return typeof e=="number"&&!isNaN(e)}function Pie(e){return typeof e=="string"}var Aie={TOP_RIGHT:"top-right"},Nu={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function Lie(e,t,n){n===void 0&&(n=300);var r=e.scrollHeight,o=e.style;requestAnimationFrame(function(){o.minHeight="initial",o.height=r+"px",o.transition="all "+n+"ms",requestAnimationFrame(function(){o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function jie(e){var t=e.enter,n=e.exit,r=e.appendPosition,o=r===void 0?!1:r,i=e.collapse,s=i===void 0?!0:i,a=e.collapseDuration,l=a===void 0?300:a;return function(u){var d=u.children,f=u.position,h=u.preventExitTransition,p=u.done,g=u.nodeRef,m=u.isIn,b=o?t+"--"+f:t,y=o?n+"--"+f:n,w=x.useRef(),S=x.useRef(0);x.useLayoutEffect(function(){C()},[]),x.useEffect(function(){m||(h?_():k())},[m]);function C(){var T=g.current;w.current=T.className,T.className+=" "+b,T.addEventListener("animationend",E),T.addEventListener("animationcancel",E)}function E(T){if(T.target===g.current){var D=g.current;D.dispatchEvent(new Event("d")),D.removeEventListener("animationend",E),D.removeEventListener("animationcancel",E),S.current===0&&(D.className=w.current)}}function k(){S.current=1;var T=g.current;T.className+=" "+y,T.addEventListener("animationend",_)}function _(){var T=g.current;T.removeEventListener("animationend",_),s?Lie(T,p,l):p()}return U.createElement(U.Fragment,null,d)}}var ef={list:new Map,emitQueue:new Map,on:function(t,n){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(n),this},off:function(t,n){if(n){var r=this.list.get(t).filter(function(o){return o!==n});return this.list.set(t,r),this}return this.list.delete(t),this},cancelEmit:function(t){var n=this.emitQueue.get(t);return n&&(n.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit:function(t){for(var n=this,r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];this.list.has(t)&&this.list.get(t).forEach(function(s){var a=setTimeout(function(){s.apply(void 0,o)},0);n.emitQueue.has(t)||n.emitQueue.set(t,[]),n.emitQueue.get(t).push(a)})}};function $ie(e){var t=e.closeToast,n=e.theme,r=e.ariaLabel,o=r===void 0?"close":r;return x.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:function(s){s.stopPropagation(),t(s)},"aria-label":o},x.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},x.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}Nu.DEFAULT;var zie=jie({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0});Aie.TOP_RIGHT;var tf=new Map,ES,Dv=[];function Bie(){return Math.random().toString(36).substring(2,9)}function Fie(e){return e&&(Pie(e.toastId)||Nie(e.toastId))?e.toastId:Bie()}function Hie(e,t){return tf.size>0?ef.emit(0,e,t):Dv.push({content:e,options:t}),t.toastId}function Vie(e,t){return Mv({},t,{type:t&&t.type||e,toastId:Fie(t)})}function up(e){return function(t,n){return Hie(t,Vie(e,n))}}Nu.SUCCESS;Nu.INFO;Nu.ERROR;Nu.WARNING;ef.on(2,function(e){ES=e.containerId||e,tf.set(ES,e),Dv.forEach(function(t){ef.emit(0,t.content,t.options)}),Dv=[]}).on(3,function(e){tf.delete(e.containerId||e),tf.size===0&&ef.off(0).off(1).off(5)});const Wie="_toggle_1mo1i_9",Uie="_small_1mo1i_25",qie="_disabled_1mo1i_102",Kie="_noMargin_1mo1i_113",Gie="_helpIconEnabled_1mo1i_116",zl={toggle:Wie,small:Uie,disabled:qie,noMargin:Kie,helpIconEnabled:Gie},Fhe=({name:e,label:t,checked:n=!1,disabled:r,display:o,small:i=!1,onChange:s,noMargin:a=!1,testId:l,helpText:c,onClickHelp:u})=>{const d=x.useContext(ht),f=c||u,h=r||d;return v.jsxs("div",{className:oe(zl.toggle,h?zl.disabled:null,i?zl.small:null,a?zl.noMargin:null),style:{display:o},onClick:p=>{h||(p.target.name=e,p.target.checked=!n,p.target.value=!n,s(p))},"data-testid":l,children:[v.jsx("input",{type:XE.CHECKBOX,name:e,value:n==null?void 0:n.toString(),disabled:h,checked:n,onChange:()=>{}}),v.jsx("label",{children:t}),f&&v.jsx("div",{className:zl.helpIconEnabled,onClick:u,children:v.jsx(Er,{text:c})})]})},Yie=x.createContext({dragDropManager:void 0});var kS=function(){return Math.random().toString(36).substring(7).split("").join(".")};""+kS(),""+kS();function Fi(e,t,...n){if(Xie()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(t.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Xie(){return typeof process<"u"&&!0}const OS=typeof global<"u"?global:self,tD=OS.MutationObserver||OS.WebKitMutationObserver;function nD(e){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),e()}}}function Jie(e){let t=1;const n=new tD(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const Zie=typeof tD=="function"?Jie:nD;class Qie{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,o=t.length-this.index;r<o;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Zie(this.flush),this.requestErrorThrow=nD(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ese{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class tse{create(t){const n=this.freeTasks,r=n.length?n.pop():new ese(this.onError,o=>n[n.length]=o);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const nse=new Qie;new tse(nse.registerPendingError);var TS;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(TS||(TS={}));const As=typeof window<"u"?x.useLayoutEffect:x.useEffect;function rD(e,t,n){const[r,o]=x.useState(()=>t(e)),i=x.useCallback(()=>{const s=t(e);k6(r,s)||(o(s),n&&n())},[r,e,n]);return As(i),[r,i]}function rse(e,t,n){const[r,o]=rD(e,t,n);return As(function(){const s=e.getHandlerId();if(s!=null)return e.subscribeToStateChange(o,{handlerIds:[s]})},[e,o]),r}function oD(e,t,n){return rse(t,e||(()=>({})),()=>n.reconnect())}function iD(e,t){const n=[];return typeof e!="function"&&n.push(e),x.useMemo(()=>typeof e=="function"?e():e,n)}function ose(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function ise(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let jg=!1,$g=!1;class sse{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fi(!jg,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jg=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jg=!1}}isDragging(){if(!this.sourceId)return!1;Fi(!$g,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return $g=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{$g=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let zg=!1;class ase{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;Fi(!zg,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return zg=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{zg=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function lse(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}function cse(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}function Rv(e,t,n,r){let o;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<i.length;l++){const c=i[l];if(!a(c))return!1;const u=e[c],d=t[c];if(o=void 0,o===!1||o===void 0&&u!==d)return!1}return!0}function Iv(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function use(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function dse(e){return(t=null,n=null)=>{if(!x.isValidElement(t)){const i=t;return e(i,n),i}const r=t;return use(r),fse(r,n?i=>e(i,n):e)}}function sD(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const o=dse(r);t[n]=()=>o}}),t}function _S(e,t){typeof e=="function"?e(t):e.current=t}function fse(e,t){const n=e.ref;return Fi(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?x.cloneElement(e,{ref:r=>{_S(n,r),_S(t,r)}}):x.cloneElement(e,{ref:t})}class hse{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Rv(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Rv(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sD({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Iv(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Iv(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class pse{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Rv(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sD({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Iv(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=x.useContext(Yie);return Fi(e!=null,"Expected drag drop context"),e}function gse(e,t){const n=Io(),r=x.useMemo(()=>new hse(n.getBackend()),[n]);return As(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),As(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function mse(){const e=Io();return x.useMemo(()=>new sse(e),[e])}class vse{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return typeof t.item=="object"?r=t.item:typeof t.item=="function"?r=t.item(n):r={},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const r=this.spec,o=this.monitor,{isDragging:i}=r;return i?i(o):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:o}=t;o&&o(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}}function yse(e,t,n){const r=x.useMemo(()=>new vse(e,t,n),[t,n]);return x.useEffect(()=>{r.spec=e},[e]),r}function bse(e){return x.useMemo(()=>{const t=e.type;return Fi(t!=null,"spec.type must be defined"),t},[e])}function xse(e,t,n){const r=Io(),o=yse(e,t,n),i=bse(e);As(function(){if(i!=null){const[a,l]=cse(i,o,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,t,n,o,i])}function wse(e,t){const n=iD(e);Fi(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=mse(),o=gse(n.options,n.previewOptions);return xse(n,r,o),[oD(n.collect,r,o),ose(o),ise(o)]}function Sse(e){const n=Io().getMonitor(),[r,o]=rD(n,e);return x.useEffect(()=>n.subscribeToOffsetChange(o)),x.useEffect(()=>n.subscribeToStateChange(o)),r}function Cse(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function Ese(e){const t=Io(),n=x.useMemo(()=>new pse(t.getBackend()),[t]);return As(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function kse(){const e=Io();return x.useMemo(()=>new ase(e),[e])}function Ose(e){const{accept:t}=e;return x.useMemo(()=>(Fi(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Tse{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function _se(e,t){const n=x.useMemo(()=>new Tse(e,t),[t]);return x.useEffect(()=>{n.spec=e},[e]),n}function Mse(e,t,n){const r=Io(),o=_se(e,t),i=Ose(e);As(function(){const[a,l]=lse(i,o,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,t,o,n,i.map(s=>s.toString()).join("|")])}function aD(e,t){const n=iD(e),r=kse(),o=Ese(n.options);return Mse(n,r,o),[oD(n.collect,r,o),Cse(o)]}let ad;function Dse(){return ad||(ad=new Image,ad.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ad}var ks=[],Rse=function(){return ks.some(function(e){return e.activeTargets.length>0})},Ise=function(){return ks.some(function(e){return e.skippedTargets.length>0})},MS="ResizeObserver loop completed with undelivered notifications.",Nse=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:MS}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=MS),window.dispatchEvent(e)},iu;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(iu||(iu={}));var Os=function(e){return Object.freeze(e)},Pse=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,Os(this)}return e}(),lD=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Os(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,o=t.top,i=t.right,s=t.bottom,a=t.left,l=t.width,c=t.height;return{x:n,y:r,top:o,right:i,bottom:s,left:a,width:l,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ny=function(e){return e instanceof SVGElement&&"getBBox"in e},cD=function(e){if(Ny(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||e.getClientRects().length)},DS=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Ase=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Oc=typeof window<"u"?window:{},ld=new WeakMap,RS=/auto|scroll/,Lse=/^tb|vertical/,jse=/msie|trident/i.test(Oc.navigator&&Oc.navigator.userAgent),$r=function(e){return parseFloat(e||"0")},Ma=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Pse((n?t:e)||0,(n?e:t)||0)},IS=Os({devicePixelContentBoxSize:Ma(),borderBoxSize:Ma(),contentBoxSize:Ma(),contentRect:new lD(0,0,0,0)}),uD=function(e,t){if(t===void 0&&(t=!1),ld.has(e)&&!t)return ld.get(e);if(cD(e))return ld.set(e,IS),IS;var n=getComputedStyle(e),r=Ny(e)&&e.ownerSVGElement&&e.getBBox(),o=!jse&&n.boxSizing==="border-box",i=Lse.test(n.writingMode||""),s=!r&&RS.test(n.overflowY||""),a=!r&&RS.test(n.overflowX||""),l=r?0:$r(n.paddingTop),c=r?0:$r(n.paddingRight),u=r?0:$r(n.paddingBottom),d=r?0:$r(n.paddingLeft),f=r?0:$r(n.borderTopWidth),h=r?0:$r(n.borderRightWidth),p=r?0:$r(n.borderBottomWidth),g=r?0:$r(n.borderLeftWidth),m=d+c,b=l+u,y=g+h,w=f+p,S=a?e.offsetHeight-w-e.clientHeight:0,C=s?e.offsetWidth-y-e.clientWidth:0,E=o?m+y:0,k=o?b+w:0,_=r?r.width:$r(n.width)-E-C,T=r?r.height:$r(n.height)-k-S,D=_+m+C+y,O=T+b+S+w,M=Os({devicePixelContentBoxSize:Ma(Math.round(_*devicePixelRatio),Math.round(T*devicePixelRatio),i),borderBoxSize:Ma(D,O,i),contentBoxSize:Ma(_,T,i),contentRect:new lD(d,l,_,T)});return ld.set(e,M),M},dD=function(e,t,n){var r=uD(e,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case iu.DEVICE_PIXEL_CONTENT_BOX:return s;case iu.BORDER_BOX:return o;default:return i}},$se=function(){function e(t){var n=uD(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=Os([n.borderBoxSize]),this.contentBoxSize=Os([n.contentBoxSize]),this.devicePixelContentBoxSize=Os([n.devicePixelContentBoxSize])}return e}(),fD=function(e){if(cD(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},zse=function(){var e=1/0,t=[];ks.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(c){var u=new $se(c.target),d=fD(c.target);a.push(u),c.lastReportedSize=dD(c.target,c.observedBox),d<e&&(e=d)}),t.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},NS=function(e){ks.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(fD(o.target)>e?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Bse=function(){var e=0;for(NS(e);Rse();)e=zse(),NS(e);return Ise()&&Nse(),e>0},Bg,hD=[],Fse=function(){return hD.splice(0).forEach(function(e){return e()})},Hse=function(e){if(!Bg){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Fse()}).observe(n,r),Bg=function(){n.textContent="".concat(t?t--:t++)}}hD.push(e),Bg()},Vse=function(e){Hse(function(){requestAnimationFrame(e)})},nf=0,Wse=function(){return!!nf},Use=250,qse={attributes:!0,characterData:!0,childList:!0,subtree:!0},PS=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],AS=function(e){return e===void 0&&(e=0),Date.now()+e},Fg=!1,Kse=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Use),!Fg){Fg=!0;var r=AS(t);Vse(function(){var o=!1;try{o=Bse()}finally{if(Fg=!1,t=r-AS(),!Wse())return;o?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,qse)};document.body?n():Oc.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),PS.forEach(function(n){return Oc.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),PS.forEach(function(n){return Oc.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Nv=new Kse,LS=function(e){!nf&&e>0&&Nv.start(),nf+=e,!nf&&Nv.stop()},Gse=function(e){return!Ny(e)&&!Ase(e)&&getComputedStyle(e).display==="inline"},Yse=function(){function e(t,n){this.target=t,this.observedBox=n||iu.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=dD(this.target,this.observedBox,!0);return Gse(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Xse=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),cd=new WeakMap,jS=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ud=function(){function e(){}return e.connect=function(t,n){var r=new Xse(t,n);cd.set(t,r)},e.observe=function(t,n,r){var o=cd.get(t),i=o.observationTargets.length===0;jS(o.observationTargets,n)<0&&(i&&ks.push(o),o.observationTargets.push(new Yse(n,r&&r.box)),LS(1),Nv.schedule())},e.unobserve=function(t,n){var r=cd.get(t),o=jS(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&ks.splice(ks.indexOf(r),1),r.observationTargets.splice(o,1),LS(-1))},e.disconnect=function(t){var n=this,r=cd.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Jse=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ud.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!DS(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ud.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!DS(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ud.unobserve(this,t)},e.prototype.disconnect=function(){ud.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Zse="production",pD=typeof process>"u"||xn===void 0?Zse:"production",lo=function(e){return{isEnabled:function(t){return e.some(function(n){return!!t[n]})}}},su={measureLayout:lo(["layout","layoutId","drag"]),animation:lo(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:lo(["exit"]),drag:lo(["drag","dragControls"]),focus:lo(["whileFocus"]),hover:lo(["whileHover","onHoverStart","onHoverEnd"]),tap:lo(["whileTap","onTap","onTapStart","onTapCancel"]),pan:lo(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:lo(["whileInView","onViewportEnter","onViewportLeave"])};function Qse(e){for(var t in e)e[t]!==null&&(t==="projectionNodeConstructor"?su.projectionNodeConstructor=e[t]:su[t].Component=e[t])}var th=function(){},gD=x.createContext({strict:!1}),mD=Object.keys(su),eae=mD.length;function tae(e,t,n){var r=[],o=x.useContext(gD);if(!t)return null;pD!=="production"&&n&&o.strict;for(var i=0;i<eae;i++){var s=mD[i],a=su[s],l=a.isEnabled,c=a.Component;l(e)&&c&&r.push(x.createElement(c,q({key:s},e,{visualElement:t})))}return r}var Py=x.createContext({transformPagePoint:function(e){return e},isStatic:!1,reducedMotion:"never"}),dp=x.createContext({});function nae(){return x.useContext(dp).visualElement}var fp=x.createContext(null),bl=typeof document<"u",$S=bl?x.useLayoutEffect:x.useEffect,Pv={current:null},vD=!1;function rae(){if(vD=!0,!!bl)if(window.matchMedia){var e=window.matchMedia("(prefers-reduced-motion)"),t=function(){return Pv.current=e.matches};e.addListener(t),t()}else Pv.current=!1}function oae(){!vD&&rae();var e=Ct(x.useState(Pv.current),1),t=e[0];return t}function iae(){var e=oae(),t=x.useContext(Py).reducedMotion;return t==="never"?!1:t==="always"?!0:e}function sae(e,t,n,r){var o=x.useContext(gD),i=nae(),s=x.useContext(fp),a=iae(),l=x.useRef(void 0);r||(r=o.renderer),!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:s==null?void 0:s.id,blockInitialAnimation:(s==null?void 0:s.initial)===!1,shouldReduceMotion:a}));var c=l.current;return $S(function(){c==null||c.syncRender()}),x.useEffect(function(){var u;(u=c==null?void 0:c.animationState)===null||u===void 0||u.animateChanges()}),$S(function(){return function(){return c==null?void 0:c.notifyUnmount()}},[]),c}function wa(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function aae(e,t,n){return x.useCallback(function(r){var o;r&&((o=e.mount)===null||o===void 0||o.call(e,r)),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):wa(n)&&(n.current=r))},[t])}function yD(e){return Array.isArray(e)}function yr(e){return typeof e=="string"||yD(e)}function lae(e){var t={};return e.forEachValue(function(n,r){return t[r]=n.get()}),t}function cae(e){var t={};return e.forEachValue(function(n,r){return t[r]=n.getVelocity()}),t}function bD(e,t,n,r,o){var i;return r===void 0&&(r={}),o===void 0&&(o={}),typeof t=="function"&&(t=t(n??e.custom,r,o)),typeof t=="string"&&(t=(i=e.variants)===null||i===void 0?void 0:i[t]),typeof t=="function"&&(t=t(n??e.custom,r,o)),t}function hp(e,t,n){var r=e.getProps();return bD(r,t,n??r.custom,lae(e),cae(e))}function pp(e){var t;return typeof((t=e.animate)===null||t===void 0?void 0:t.start)=="function"||yr(e.initial)||yr(e.animate)||yr(e.whileHover)||yr(e.whileDrag)||yr(e.whileTap)||yr(e.whileFocus)||yr(e.exit)}function xD(e){return!!(pp(e)||e.variants)}function uae(e,t){if(pp(e)){var n=e.initial,r=e.animate;return{initial:n===!1||yr(n)?n:void 0,animate:yr(r)?r:void 0}}return e.inherit!==!1?t:{}}function dae(e){var t=uae(e,x.useContext(dp)),n=t.initial,r=t.animate;return x.useMemo(function(){return{initial:n,animate:r}},[zS(n),zS(r)])}function zS(e){return Array.isArray(e)?e.join(" "):e}function gp(e){var t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}var Tc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},fae=1;function hae(){return gp(function(){if(Tc.hasEverUpdated)return fae++})}var wD=x.createContext({}),SD=x.createContext({});function pae(e,t,n,r){var o,i=t.layoutId,s=t.layout,a=t.drag,l=t.dragConstraints,c=t.layoutScroll,u=x.useContext(SD);!r||!n||n!=null&&n.projection||(n.projection=new r(e,n.getLatestValues(),(o=n.parent)===null||o===void 0?void 0:o.projection),n.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||l&&wa(l),visualElement:n,scheduleRender:function(){return n.scheduleRender()},animationType:typeof s=="string"?s:"both",initialPromotionConfig:u,layoutScroll:c}))}var gae=function(e){QE(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},t.prototype.componentDidUpdate=function(){},t.prototype.updateProps=function(){var n=this.props,r=n.visualElement,o=n.props;r&&r.setProps(o)},t.prototype.render=function(){return this.props.children},t}(U.Component);function mae(e){var t=e.preloadedFeatures,n=e.createVisualElement,r=e.projectionNodeConstructor,o=e.useRender,i=e.useVisualState,s=e.Component;t&&Qse(t);function a(l,c){var u=vae(l);l=q(q({},l),{layoutId:u});var d=x.useContext(Py),f=null,h=dae(l),p=d.isStatic?void 0:hae(),g=i(l,d.isStatic);return!d.isStatic&&bl&&(h.visualElement=sae(s,g,q(q({},d),l),n),pae(p,l,h.visualElement,r||su.projectionNodeConstructor),f=tae(l,h.visualElement,t)),x.createElement(gae,{visualElement:h.visualElement,props:q(q({},d),l)},f,x.createElement(dp.Provider,{value:h},o(s,l,p,aae(g,h.visualElement,c),g,d.isStatic,h.visualElement)))}return x.forwardRef(a)}function vae(e){var t,n=e.layoutId,r=(t=x.useContext(wD))===null||t===void 0?void 0:t.id;return r&&n!==void 0?r+"-"+n:n}function yae(e){function t(r,o){return o===void 0&&(o={}),mae(e(r,o))}if(typeof Proxy>"u")return t;var n=new Map;return new Proxy(t,{get:function(r,o){return n.has(o)||n.set(o,t(o)),n.get(o)}})}var bae=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function Ay(e){return typeof e!="string"||e.includes("-")?!1:!!(bae.indexOf(e)>-1||/[A-Z]/.test(e))}var nh={};function xae(e){Object.assign(nh,e)}var Av=["","X","Y","Z"],wae=["translate","scale","rotate","skew"],au=["transformPerspective","x","y","z"];wae.forEach(function(e){return Av.forEach(function(t){return au.push(e+t)})});function Sae(e,t){return au.indexOf(e)-au.indexOf(t)}var Cae=new Set(au);function Pu(e){return Cae.has(e)}var Eae=new Set(["originX","originY","originZ"]);function CD(e){return Eae.has(e)}function ED(e,t){var n=t.layout,r=t.layoutId;return Pu(e)||CD(e)||(n||r!==void 0)&&(!!nh[e]||e==="opacity")}var Eo=function(e){return!!(e!==null&&typeof e=="object"&&e.getVelocity)},kae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Oae(e,t,n,r){var o=e.transform,i=e.transformKeys,s=t.enableHardwareAcceleration,a=s===void 0?!0:s,l=t.allowTransformNone,c=l===void 0?!0:l,u="";i.sort(Sae);for(var d=!1,f=i.length,h=0;h<f;h++){var p=i[h];u+="".concat(kae[p]||p,"(").concat(o[p],") "),p==="z"&&(d=!0)}return!d&&a?u+="translateZ(0)":u=u.trim(),r?u=r(o,n?"":u):c&&n&&(u="none"),u}function Tae(e){var t=e.originX,n=t===void 0?"50%":t,r=e.originY,o=r===void 0?"50%":r,i=e.originZ,s=i===void 0?0:i;return"".concat(n," ").concat(o," ").concat(s)}function kD(e){return e.startsWith("--")}var _ae=function(e,t){return t&&typeof e=="number"?t.transform(e):e};const OD=(e,t)=>n=>Math.max(Math.min(n,t),e),_c=e=>e%1?Number(e.toFixed(5)):e,lu=/(-)?([\d]*\.?[\d])+/g,Lv=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,Mae=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Au(e){return typeof e=="string"}const qs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Mc=Object.assign(Object.assign({},qs),{transform:OD(0,1)}),dd=Object.assign(Object.assign({},qs),{default:1}),Lu=e=>({test:t=>Au(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ni=Lu("deg"),Yr=Lu("%"),pe=Lu("px"),Dae=Lu("vh"),Rae=Lu("vw"),BS=Object.assign(Object.assign({},Yr),{parse:e=>Yr.parse(e)/100,transform:e=>Yr.transform(e*100)}),Ly=(e,t)=>n=>!!(Au(n)&&Mae.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),TD=(e,t,n)=>r=>{if(!Au(r))return r;const[o,i,s,a]=r.match(lu);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},ms={test:Ly("hsl","hue"),parse:TD("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Yr.transform(_c(t))+", "+Yr.transform(_c(n))+", "+_c(Mc.transform(r))+")"},Iae=OD(0,255),Hg=Object.assign(Object.assign({},qs),{transform:e=>Math.round(Iae(e))}),bi={test:Ly("rgb","red"),parse:TD("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hg.transform(e)+", "+Hg.transform(t)+", "+Hg.transform(n)+", "+_c(Mc.transform(r))+")"};function Nae(e){let t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const jv={test:Ly("#"),parse:Nae,transform:bi.transform},sn={test:e=>bi.test(e)||jv.test(e)||ms.test(e),parse:e=>bi.test(e)?bi.parse(e):ms.test(e)?ms.parse(e):jv.parse(e),transform:e=>Au(e)?e:e.hasOwnProperty("red")?bi.transform(e):ms.transform(e)},_D="${c}",MD="${n}";function Pae(e){var t,n,r,o;return isNaN(e)&&Au(e)&&((n=(t=e.match(lu))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((o=(r=e.match(Lv))===null||r===void 0?void 0:r.length)!==null&&o!==void 0?o:0)>0}function DD(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(Lv);r&&(n=r.length,e=e.replace(Lv,_D),t.push(...r.map(sn.parse)));const o=e.match(lu);return o&&(e=e.replace(lu,MD),t.push(...o.map(qs.parse))),{values:t,numColors:n,tokenised:e}}function RD(e){return DD(e).values}function ID(e){const{values:t,numColors:n,tokenised:r}=DD(e),o=t.length;return i=>{let s=r;for(let a=0;a<o;a++)s=s.replace(a<n?_D:MD,a<n?sn.transform(i[a]):_c(i[a]));return s}}const Aae=e=>typeof e=="number"?0:e;function Lae(e){const t=RD(e);return ID(e)(t.map(Aae))}const ko={test:Pae,parse:RD,createTransformer:ID,getAnimatableNone:Lae},jae=new Set(["brightness","contrast","saturate","opacity"]);function $ae(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(lu)||[];if(!r)return e;const o=n.replace(r,"");let i=jae.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const zae=/([a-z-]*)\(.*?\)/g,$v=Object.assign(Object.assign({},ko),{getAnimatableNone:e=>{const t=e.match(zae);return t?t.map($ae).join(" "):e}});var FS=q(q({},qs),{transform:Math.round}),ND={borderWidth:pe,borderTopWidth:pe,borderRightWidth:pe,borderBottomWidth:pe,borderLeftWidth:pe,borderRadius:pe,radius:pe,borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomRightRadius:pe,borderBottomLeftRadius:pe,width:pe,maxWidth:pe,height:pe,maxHeight:pe,size:pe,top:pe,right:pe,bottom:pe,left:pe,padding:pe,paddingTop:pe,paddingRight:pe,paddingBottom:pe,paddingLeft:pe,margin:pe,marginTop:pe,marginRight:pe,marginBottom:pe,marginLeft:pe,rotate:ni,rotateX:ni,rotateY:ni,rotateZ:ni,scale:dd,scaleX:dd,scaleY:dd,scaleZ:dd,skew:ni,skewX:ni,skewY:ni,distance:pe,translateX:pe,translateY:pe,translateZ:pe,x:pe,y:pe,z:pe,perspective:pe,transformPerspective:pe,opacity:Mc,originX:BS,originY:BS,originZ:pe,zIndex:FS,fillOpacity:Mc,strokeOpacity:Mc,numOctaves:FS};function jy(e,t,n,r){var o,i=e.style,s=e.vars,a=e.transform,l=e.transformKeys,c=e.transformOrigin;l.length=0;var u=!1,d=!1,f=!0;for(var h in t){var p=t[h];if(kD(h)){s[h]=p;continue}var g=ND[h],m=_ae(p,g);if(Pu(h)){if(u=!0,a[h]=m,l.push(h),!f)continue;p!==((o=g.default)!==null&&o!==void 0?o:0)&&(f=!1)}else CD(h)?(c[h]=m,d=!0):i[h]=m}u?i.transform=Oae(e,n,f,r):r?i.transform=r({},""):!t.transform&&i.transform&&(i.transform="none"),d&&(i.transformOrigin=Tae(c))}var $y=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function PD(e,t,n){for(var r in t)!Eo(t[r])&&!ED(r,n)&&(e[r]=t[r])}function Bae(e,t,n){var r=e.transformTemplate;return x.useMemo(function(){var o=$y();jy(o,t,{enableHardwareAcceleration:!n},r);var i=o.vars,s=o.style;return q(q({},i),s)},[t])}function Fae(e,t,n){var r=e.style||{},o={};return PD(o,r,e),Object.assign(o,Bae(e,t,n)),e.transformValues&&(o=e.transformValues(o)),o}function Hae(e,t,n){var r={},o=Fae(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":"pan-".concat(e.drag==="x"?"y":"x")),r.style=o,r}var Vae=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function rh(e){return Vae.has(e)}var AD=function(e){return!rh(e)};function Wae(e){e&&(AD=function(t){return t.startsWith("on")?!rh(t):e(t)})}try{Wae(require("@emotion/is-prop-valid").default)}catch{}function Uae(e,t,n){var r={};for(var o in e)(AD(o)||n===!0&&rh(o)||!t&&!rh(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function HS(e,t,n){return typeof e=="string"?e:pe.transform(t+n*e)}function qae(e,t,n){var r=HS(t,e.x,e.width),o=HS(n,e.y,e.height);return"".concat(r," ").concat(o)}var Kae={offset:"strokeDashoffset",array:"strokeDasharray"};function Gae(e,t,n,r,o){n===void 0&&(n=1),r===void 0&&(r=0),e.pathLength=1;var i=Kae;e[i.offset]=pe.transform(-r);var s=pe.transform(t),a=pe.transform(n);e[i.array]="".concat(s," ").concat(a)}function zy(e,t,n,r){var o=t.attrX,i=t.attrY,s=t.originX,a=t.originY,l=t.pathLength,c=t.pathSpacing,u=c===void 0?1:c,d=t.pathOffset,f=d===void 0?0:d,h=ir(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]);jy(e,h,n,r),e.attrs=e.style,e.style={};var p=e.attrs,g=e.style,m=e.dimensions;p.transform&&(m&&(g.transform=p.transform),delete p.transform),m&&(s!==void 0||a!==void 0||g.transform)&&(g.transformOrigin=qae(m,s!==void 0?s:.5,a!==void 0?a:.5)),o!==void 0&&(p.x=o),i!==void 0&&(p.y=i),l!==void 0&&Gae(p,l,u,f)}var LD=function(){return q(q({},$y()),{attrs:{}})};function Yae(e,t){var n=x.useMemo(function(){var o=LD();return zy(o,t,{enableHardwareAcceleration:!1},e.transformTemplate),q(q({},o.attrs),{style:q({},o.style)})},[t]);if(e.style){var r={};PD(r,e.style,e),n.style=q(q({},r),n.style)}return n}function Xae(e){e===void 0&&(e=!1);var t=function(n,r,o,i,s,a){var l=s.latestValues,c=Ay(n)?Yae:Hae,u=c(r,l,a),d=Uae(r,typeof n=="string",e),f=q(q(q({},d),u),{ref:i});return o&&(f["data-projection-id"]=o),x.createElement(n,f)};return t}var Jae=/([a-z])([A-Z])/g,Zae="$1-$2",jD=function(e){return e.replace(Jae,Zae).toLowerCase()};function $D(e,t,n,r){var o=t.style,i=t.vars;Object.assign(e.style,o,r&&r.getProjectionStyles(n));for(var s in i)e.style.setProperty(s,i[s])}var zD=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function BD(e,t,n,r){$D(e,t,void 0,r);for(var o in t.attrs)e.setAttribute(zD.has(o)?o:jD(o),t.attrs[o])}function By(e){var t=e.style,n={};for(var r in t)(Eo(t[r])||ED(r,e))&&(n[r]=t[r]);return n}function FD(e){var t=By(e);for(var n in e)if(Eo(e[n])){var r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function Fy(e){return typeof e=="object"&&typeof e.start=="function"}var cu=function(e){return Array.isArray(e)},Qae=function(e){return!!(e&&typeof e=="object"&&e.mix&&e.toValue)},HD=function(e){return cu(e)?e[e.length-1]||0:e};function rf(e){var t=Eo(e)?e.get():e;return Qae(t)?t.toValue():t}function VS(e,t,n,r){var o=e.scrapeMotionValuesFromProps,i=e.createRenderState,s=e.onMount,a={latestValues:ele(t,n,r,o),renderState:i()};return s&&(a.mount=function(l){return s(t,l,a)}),a}var VD=function(e){return function(t,n){var r=x.useContext(dp),o=x.useContext(fp);return n?VS(e,t,r,o):gp(function(){return VS(e,t,r,o)})}};function ele(e,t,n,r){var o={},i=(n==null?void 0:n.initial)===!1,s=r(e);for(var a in s)o[a]=rf(s[a]);var l=e.initial,c=e.animate,u=pp(e),d=xD(e);t&&d&&!u&&e.inherit!==!1&&(l??(l=t.initial),c??(c=t.animate));var f=i||l===!1,h=f?c:l;if(h&&typeof h!="boolean"&&!Fy(h)){var p=Array.isArray(h)?h:[h];p.forEach(function(g){var m=bD(e,g);if(m){var b=m.transitionEnd;m.transition;var y=ir(m,["transitionEnd","transition"]);for(var w in y){var S=y[w];if(Array.isArray(S)){var C=f?S.length-1:0;S=S[C]}S!==null&&(o[w]=S)}for(var w in b)o[w]=b[w]}})}return o}var tle={useVisualState:VD({scrapeMotionValuesFromProps:FD,createRenderState:LD,onMount:function(e,t,n){var r=n.renderState,o=n.latestValues;try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}zy(r,o,{enableHardwareAcceleration:!1},e.transformTemplate),BD(t,r)}})},nle={useVisualState:VD({scrapeMotionValuesFromProps:By,createRenderState:$y})};function rle(e,t,n,r,o){var i=t.forwardMotionProps,s=i===void 0?!1:i,a=Ay(e)?tle:nle;return q(q({},a),{preloadedFeatures:n,useRender:Xae(s),createVisualElement:r,projectionNodeConstructor:o,Component:e})}var Ve;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(Ve||(Ve={}));function mp(e,t,n,r){return r===void 0&&(r={passive:!0}),e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n)}}function zv(e,t,n,r){x.useEffect(function(){var o=e.current;if(n&&o)return mp(o,t,n,r)},[e,t,n,r])}function ole(e){var t=e.whileFocus,n=e.visualElement,r=function(){var i;(i=n.animationState)===null||i===void 0||i.setActive(Ve.Focus,!0)},o=function(){var i;(i=n.animationState)===null||i===void 0||i.setActive(Ve.Focus,!1)};zv(n,"focus",t?r:void 0),zv(n,"blur",t?o:void 0)}function WD(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function UD(e){var t=!!e.touches;return t}function ile(e){return function(t){var n=t instanceof MouseEvent,r=!n||n&&t.button===0;r&&e(t)}}var sle={pageX:0,pageY:0};function ale(e,t){t===void 0&&(t="page");var n=e.touches[0]||e.changedTouches[0],r=n||sle;return{x:r[t+"X"],y:r[t+"Y"]}}function lle(e,t){return t===void 0&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function Hy(e,t){return t===void 0&&(t="page"),{point:UD(e)?ale(e,t):lle(e,t)}}var qD=function(e,t){t===void 0&&(t=!1);var n=function(r){return e(r,Hy(r))};return t?ile(n):n},cle=function(){return bl&&window.onpointerdown===null},ule=function(){return bl&&window.ontouchstart===null},dle=function(){return bl&&window.onmousedown===null},fle={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},hle={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function KD(e){return cle()?e:ule()?hle[e]:dle()?fle[e]:e}function Da(e,t,n,r){return mp(e,KD(t),qD(n,t==="pointerdown"),r)}function oh(e,t,n,r){return zv(e,KD(t),n&&qD(n,t==="pointerdown"),r)}function GD(e){var t=null;return function(){var n=function(){t=null};return t===null?(t=e,n):!1}}var WS=GD("dragHorizontal"),US=GD("dragVertical");function YD(e){var t=!1;if(e==="y")t=US();else if(e==="x")t=WS();else{var n=WS(),r=US();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}function XD(){var e=YD(!0);return e?(e(),!1):!0}function qS(e,t,n){return function(r,o){var i;!WD(r)||XD()||((i=e.animationState)===null||i===void 0||i.setActive(Ve.Hover,t),n==null||n(r,o))}}function ple(e){var t=e.onHoverStart,n=e.onHoverEnd,r=e.whileHover,o=e.visualElement;oh(o,"pointerenter",t||r?qS(o,!0,t):void 0,{passive:!t}),oh(o,"pointerleave",n||r?qS(o,!1,n):void 0,{passive:!n})}var JD=function(e,t){return t?e===t?!0:JD(e,t.parentElement):!1};function ZD(e){return x.useEffect(function(){return function(){return e()}},[])}const ih=(e,t,n)=>Math.min(Math.max(n,e),t),KS=.001,gle=.01,mle=10,vle=.05,yle=1;function ble({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i,s=1-t;s=ih(vle,yle,s),e=ih(gle,mle,e/1e3),s<1?(o=c=>{const u=c*s,d=u*e,f=u-n,h=Bv(c,s),p=Math.exp(-d);return KS-f/h*p},i=c=>{const d=c*s*e,f=d*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,p=Math.exp(-d),g=Bv(Math.pow(c,2),s);return(-o(c)+KS>0?-1:1)*((f-h)*p)/g}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-.001+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=wle(o,i,a);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const xle=12;function wle(e,t,n){let r=n;for(let o=1;o<xle;o++)r=r-e(r)/t(r);return r}function Bv(e,t){return e*Math.sqrt(1-t*t)}const Sle=["duration","bounce"],Cle=["stiffness","damping","mass"];function GS(e,t){return t.some(n=>e[n]!==void 0)}function Ele(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!GS(e,Cle)&&GS(e,Sle)){const n=ble(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Vy(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:o}=e,i=ir(e,["from","to","restSpeed","restDelta"]);const s={done:!1,value:t};let{stiffness:a,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=Ele(i),h=YS,p=YS;function g(){const m=u?-(u/1e3):0,b=n-t,y=l/(2*Math.sqrt(a*c)),w=Math.sqrt(a/c)/1e3;if(o===void 0&&(o=Math.min(Math.abs(n-t)/100,.4)),y<1){const S=Bv(w,y);h=C=>{const E=Math.exp(-y*w*C);return n-E*((m+y*w*b)/S*Math.sin(S*C)+b*Math.cos(S*C))},p=C=>{const E=Math.exp(-y*w*C);return y*w*E*(Math.sin(S*C)*(m+y*w*b)/S+b*Math.cos(S*C))-E*(Math.cos(S*C)*(m+y*w*b)-S*b*Math.sin(S*C))}}else if(y===1)h=S=>n-Math.exp(-w*S)*(b+(m+w*b)*S);else{const S=w*Math.sqrt(y*y-1);h=C=>{const E=Math.exp(-y*w*C),k=Math.min(S*C,300);return n-E*((m+y*w*b)*Math.sinh(k)+S*b*Math.cosh(k))/S}}}return g(),{next:m=>{const b=h(m);if(f)s.done=m>=d;else{const y=p(m)*1e3,w=Math.abs(y)<=r,S=Math.abs(n-b)<=o;s.done=w&&S}return s.value=s.done?n:b,s},flipTarget:()=>{u=-u,[t,n]=[n,t],g()}}}Vy.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const YS=e=>0,uu=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},rt=(e,t,n)=>-n*e+n*t+e;function Vg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function XS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Vg(l,a,e+1/3),i=Vg(l,a,e),s=Vg(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}const kle=(e,t,n)=>{const r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},Ole=[jv,bi,ms],JS=e=>Ole.find(t=>t.test(e)),QD=(e,t)=>{let n=JS(e),r=JS(t),o=n.parse(e),i=r.parse(t);n===ms&&(o=XS(o),n=bi),r===ms&&(i=XS(i),r=bi);const s=Object.assign({},o);return a=>{for(const l in s)l!=="alpha"&&(s[l]=kle(o[l],i[l],a));return s.alpha=rt(o.alpha,i.alpha,a),n.transform(s)}},Fv=e=>typeof e=="number",Tle=(e,t)=>n=>t(e(n)),vp=(...e)=>e.reduce(Tle);function eR(e,t){return Fv(e)?n=>rt(e,t,n):sn.test(e)?QD(e,t):nR(e,t)}const tR=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,s)=>eR(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}},_le=(e,t)=>{const n=Object.assign(Object.assign({},e),t),r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=eR(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}};function ZS(e){const t=ko.parse(e),n=t.length;let r=0,o=0,i=0;for(let s=0;s<n;s++)r||typeof t[s]=="number"?r++:t[s].hue!==void 0?i++:o++;return{parsed:t,numNumbers:r,numRGB:o,numHSL:i}}const nR=(e,t)=>{const n=ko.createTransformer(t),r=ZS(e),o=ZS(t);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?vp(tR(r.parsed,o.parsed),n):s=>`${s>0?t:e}`},Mle=(e,t)=>n=>rt(e,t,n);function Dle(e){if(typeof e=="number")return Mle;if(typeof e=="string")return sn.test(e)?QD:nR;if(Array.isArray(e))return tR;if(typeof e=="object")return _le}function Rle(e,t,n){const r=[],o=n||Dle(e[0]),i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]:t;a=vp(l,a)}r.push(a)}return r}function Ile([e,t],[n]){return r=>n(uu(e,t,r))}function Nle(e,t){const n=e.length,r=n-1;return o=>{let i=0,s=!1;if(o<=e[0]?s=!0:o>=e[r]&&(i=r-1,s=!0),!s){let l=1;for(;l<n&&!(e[l]>o||l===r);l++);i=l-1}const a=uu(e[i],e[i+1],o);return t[i](a)}}function rR(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;th(i===t.length),th(!r||!Array.isArray(r)||r.length===i-1),e[0]>e[i-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const s=Rle(t,r,o),a=i===2?Ile(e,s):Nle(e,s);return n?l=>a(ih(e[0],e[i-1],l)):a}const yp=e=>t=>1-e(1-t),Wy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ple=e=>t=>Math.pow(t,e),oR=e=>t=>t*t*((e+1)*t-e),Ale=e=>{const t=oR(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},iR=1.525,Lle=4/11,jle=8/11,$le=9/10,Uy=e=>e,qy=Ple(2),zle=yp(qy),sR=Wy(qy),aR=e=>1-Math.sin(Math.acos(e)),Ky=yp(aR),Ble=Wy(Ky),Gy=oR(iR),Fle=yp(Gy),Hle=Wy(Gy),Vle=Ale(iR),Wle=4356/361,Ule=35442/1805,qle=16061/1805,sh=e=>{if(e===1||e===0)return e;const t=e*e;return e<Lle?7.5625*t:e<jle?9.075*t-9.9*e+3.4:e<$le?Wle*t-Ule*e+qle:10.8*e*e-20.52*e+10.72},Kle=yp(sh),Gle=e=>e<.5?.5*(1-sh(1-e*2)):.5*sh(e*2-1)+.5;function Yle(e,t){return e.map(()=>t||sR).splice(0,e.length-1)}function Xle(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function Jle(e,t){return e.map(n=>n*t)}function of({from:e=0,to:t=1,ease:n,offset:r,duration:o=300}){const i={done:!1,value:e},s=Array.isArray(t)?t:[e,t],a=Jle(r&&r.length===s.length?r:Xle(s),o);function l(){return rR(a,s,{ease:Array.isArray(n)?n:Yle(s,n)})}let c=l();return{next:u=>(i.value=c(u),i.done=u>=o,i),flipTarget:()=>{s.reverse(),c=l()}}}function Zle({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const s={done:!1,value:t};let a=n*e;const l=t+a,c=i===void 0?l:i(l);return c!==l&&(a=c-t),{next:u=>{const d=-a*Math.exp(-u/r);return s.done=!(d>o||d<-o),s.value=s.done?c:c+d,s},flipTarget:()=>{}}}const QS={keyframes:of,spring:Vy,decay:Zle};function Qle(e){if(Array.isArray(e.to))return of;if(QS[e.type])return QS[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?of:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Vy:of}const lR=1/60*1e3,ece=typeof performance<"u"?()=>performance.now():()=>Date.now(),cR=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(ece()),lR);function tce(e){let t=[],n=[],r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&o,f=d?t:n;return c&&s.add(l),f.indexOf(l)===-1&&(f.push(l),d&&o&&(r=t.length)),l},cancel:l=>{const c=n.indexOf(l);c!==-1&&n.splice(c,1),s.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let c=0;c<r;c++){const u=t[c];u(l),s.has(u)&&(a.schedule(u),e())}o=!1,i&&(i=!1,a.process(l))}};return a}const nce=40;let Hv=!0,du=!1,Vv=!1;const Ra={delta:0,timestamp:0},ju=["read","update","preRender","render","postRender"],bp=ju.reduce((e,t)=>(e[t]=tce(()=>du=!0),e),{}),Xr=ju.reduce((e,t)=>{const n=bp[t];return e[t]=(r,o=!1,i=!1)=>(du||oce(),n.schedule(r,o,i)),e},{}),nl=ju.reduce((e,t)=>(e[t]=bp[t].cancel,e),{}),Wg=ju.reduce((e,t)=>(e[t]=()=>bp[t].process(Ra),e),{}),rce=e=>bp[e].process(Ra),uR=e=>{du=!1,Ra.delta=Hv?lR:Math.max(Math.min(e-Ra.timestamp,nce),1),Ra.timestamp=e,Vv=!0,ju.forEach(rce),Vv=!1,du&&(Hv=!1,cR(uR))},oce=()=>{du=!0,Hv=!0,Vv||cR(uR)},ah=()=>Ra;function dR(e,t,n=0){return e-t-n}function ice(e,t,n=0,r=!0){return r?dR(t+-e,t,n):t-(e-t)+n}function sce(e,t,n,r){return r?e>=t+n:e<=-n}const ace=e=>{const t=({delta:n})=>e(n);return{start:()=>Xr.update(t,!0),stop:()=>nl.update(t)}};function fR(e){var t,n,{from:r,autoplay:o=!0,driver:i=ace,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:d,onComplete:f,onRepeat:h,onUpdate:p}=e,g=ir(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:m}=g,b,y=0,w=g.duration,S,C=!1,E=!0,k;const _=Qle(g);!((n=(t=_).needsInterpolation)===null||n===void 0)&&n.call(t,r,m)&&(k=rR([0,100],[r,m],{clamp:!1}),r=0,m=100);const T=_(Object.assign(Object.assign({},g),{from:r,to:m}));function D(){y++,l==="reverse"?(E=y%2===0,s=ice(s,w,c,E)):(s=dR(s,w,c),l==="mirror"&&T.flipTarget()),C=!1,h&&h()}function O(){b.stop(),f&&f()}function M(I){if(E||(I=-I),s+=I,!C){const N=T.next(Math.max(0,s));S=N.value,k&&(S=k(S)),C=E?N.done:s<=0}p==null||p(S),C&&(y===0&&(w??(w=s)),y<a?sce(s,w,c,E)&&D():O())}function R(){u==null||u(),b=i(M),b.start()}return o&&R(),{stop:()=>{d==null||d(),b.stop()}}}function hR(e,t){return t?e*(1e3/t):0}function lce({from:e=0,velocity:t=0,min:n,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:d,onComplete:f,onStop:h}){let p;function g(w){return n!==void 0&&w<n||r!==void 0&&w>r}function m(w){return n===void 0?r:r===void 0||Math.abs(n-w)<Math.abs(r-w)?n:r}function b(w){p==null||p.stop(),p=fR(Object.assign(Object.assign({},w),{driver:u,onUpdate:S=>{var C;d==null||d(S),(C=w.onUpdate)===null||C===void 0||C.call(w,S)},onComplete:f,onStop:h}))}function y(w){b(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},w))}if(g(e))y({from:e,velocity:t,to:m(e)});else{let w=o*t+e;typeof c<"u"&&(w=c(w));const S=m(w),C=S===n?-1:1;let E,k;const _=T=>{E=k,k=T,t=hR(T-E,ah().delta),(C===1&&T>S||C===-1&&T<S)&&y({from:T,to:S,velocity:t})};b({type:"decay",from:e,velocity:t,timeConstant:i,power:o,restDelta:l,modifyTarget:c,onUpdate:g(w)?_:void 0})}return{stop:()=>p==null?void 0:p.stop()}}const Wv=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),eC=e=>Wv(e)&&e.hasOwnProperty("z"),fd=(e,t)=>Math.abs(e-t);function pR(e,t){if(Fv(e)&&Fv(t))return fd(e,t);if(Wv(e)&&Wv(t)){const n=fd(e.x,t.x),r=fd(e.y,t.y),o=eC(e)&&eC(t)?fd(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}}const gR=(e,t)=>1-3*t+3*e,mR=(e,t)=>3*t-6*e,vR=e=>3*e,lh=(e,t,n)=>((gR(t,n)*e+mR(t,n))*e+vR(t))*e,yR=(e,t,n)=>3*gR(t,n)*e*e+2*mR(t,n)*e+vR(t),cce=1e-7,uce=10;function dce(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=lh(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>cce&&++a<uce);return s}const fce=8,hce=.001;function pce(e,t,n,r){for(let o=0;o<fce;++o){const i=yR(t,n,r);if(i===0)return t;const s=lh(t,n,r)-e;t-=s/i}return t}const sf=11,hd=1/(sf-1);function gce(e,t,n,r){if(e===t&&n===r)return Uy;const o=new Float32Array(sf);for(let s=0;s<sf;++s)o[s]=lh(s*hd,e,n);function i(s){let a=0,l=1;const c=sf-1;for(;l!==c&&o[l]<=s;++l)a+=hd;--l;const u=(s-o[l])/(o[l+1]-o[l]),d=a+u*hd,f=yR(d,e,n);return f>=hce?pce(s,d,e,n):f===0?d:dce(s,a,a+hd,e,n)}return s=>s===0||s===1?s:lh(i(s),t,r)}function mce(e){var t=e.onTap,n=e.onTapStart,r=e.onTapCancel,o=e.whileTap,i=e.visualElement,s=t||n||r||o,a=x.useRef(!1),l=x.useRef(null),c={passive:!(n||t||r||p)};function u(){var g;(g=l.current)===null||g===void 0||g.call(l),l.current=null}function d(){var g;return u(),a.current=!1,(g=i.animationState)===null||g===void 0||g.setActive(Ve.Tap,!1),!XD()}function f(g,m){d()&&(JD(i.getInstance(),g.target)?t==null||t(g,m):r==null||r(g,m))}function h(g,m){d()&&(r==null||r(g,m))}function p(g,m){var b;u(),!a.current&&(a.current=!0,l.current=vp(Da(window,"pointerup",f,c),Da(window,"pointercancel",h,c)),(b=i.animationState)===null||b===void 0||b.setActive(Ve.Tap,!0),n==null||n(g,m))}oh(i,"pointerdown",s?p:void 0,c),ZD(u)}var tC=new Set;function vce(e,t,n){tC.has(t)||(console.warn(t),tC.add(t))}var Uv=new WeakMap,Ug=new WeakMap,yce=function(e){var t;(t=Uv.get(e.target))===null||t===void 0||t(e)},bce=function(e){e.forEach(yce)};function xce(e){var t=e.root,n=ir(e,["root"]),r=t||document;Ug.has(r)||Ug.set(r,{});var o=Ug.get(r),i=JSON.stringify(n);return o[i]||(o[i]=new IntersectionObserver(bce,q({root:t},n))),o[i]}function wce(e,t,n){var r=xce(t);return Uv.set(e,n),r.observe(e),function(){Uv.delete(e),r.unobserve(e)}}function Sce(e){var t=e.visualElement,n=e.whileInView,r=e.onViewportEnter,o=e.onViewportLeave,i=e.viewport,s=i===void 0?{}:i,a=x.useRef({hasEnteredView:!1,isInView:!1}),l=!!(n||r||o);s.once&&a.current.hasEnteredView&&(l=!1);var c=typeof IntersectionObserver>"u"?kce:Ece;c(l,a.current,t,s)}var Cce={some:0,all:1};function Ece(e,t,n,r){var o=r.root,i=r.margin,s=r.amount,a=s===void 0?"some":s,l=r.once;x.useEffect(function(){if(e){var c={root:o==null?void 0:o.current,rootMargin:i,threshold:typeof a=="number"?a:Cce[a]},u=function(d){var f,h=d.isIntersecting;if(t.isInView!==h&&(t.isInView=h,!(l&&!h&&t.hasEnteredView))){h&&(t.hasEnteredView=!0),(f=n.animationState)===null||f===void 0||f.setActive(Ve.InView,h);var p=n.getProps(),g=h?p.onViewportEnter:p.onViewportLeave;g==null||g(d)}};return wce(n.getInstance(),c,u)}},[e,o,i,a])}function kce(e,t,n,r){var o=r.fallback,i=o===void 0?!0:o;x.useEffect(function(){!e||!i||(pD!=="production"&&vce(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var s;t.hasEnteredView=!0;var a=n.getProps().onViewportEnter;a==null||a(null),(s=n.animationState)===null||s===void 0||s.setActive(Ve.InView,!0)}))},[e])}var xi=function(e){return function(t){return e(t),null}},Oce={inView:xi(Sce),tap:xi(mce),focus:xi(ole),hover:xi(ple)},Tce=0,_ce=function(){return Tce++},Mce=function(){return gp(_ce)};function bR(){var e=x.useContext(fp);if(e===null)return[!0,null];var t=e.isPresent,n=e.onExitComplete,r=e.register,o=Mce();x.useEffect(function(){return r(o)},[]);var i=function(){return n==null?void 0:n(o)};return!t&&n?[!1,i]:[!0]}function xR(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ch=function(e){return e*1e3},Dce={linear:Uy,easeIn:qy,easeInOut:sR,easeOut:zle,circIn:aR,circInOut:Ble,circOut:Ky,backIn:Gy,backInOut:Hle,backOut:Fle,anticipate:Vle,bounceIn:Kle,bounceInOut:Gle,bounceOut:sh},nC=function(e){if(Array.isArray(e)){th(e.length===4);var t=Ct(e,4),n=t[0],r=t[1],o=t[2],i=t[3];return gce(n,r,o,i)}else if(typeof e=="string")return Dce[e];return e},Rce=function(e){return Array.isArray(e)&&typeof e[0]!="number"},rC=function(e,t){return e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&ko.test(t)&&!t.startsWith("url("))},es=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},pd=function(e){return{type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}},qg=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ice=function(e){return{type:"keyframes",duration:.8,values:e}},oC={x:es,y:es,z:es,rotate:es,rotateX:es,rotateY:es,rotateZ:es,scaleX:pd,scaleY:pd,scale:pd,opacity:qg,backgroundColor:qg,color:qg,default:pd},Nce=function(e,t){var n;return cu(t)?n=Ice:n=oC[e]||oC.default,q({to:t},n(t))},Pce=q(q({},ND),{color:sn,backgroundColor:sn,outlineColor:sn,fill:sn,stroke:sn,borderColor:sn,borderTopColor:sn,borderRightColor:sn,borderBottomColor:sn,borderLeftColor:sn,filter:$v,WebkitFilter:$v}),Yy=function(e){return Pce[e]};function Xy(e,t){var n,r=Yy(e);return r!==$v&&(r=ko),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}function Ace(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=ir(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}function Lce(e){var t=e.ease,n=e.times,r=e.yoyo,o=e.flip,i=e.loop,s=ir(e,["ease","times","yoyo","flip","loop"]),a=q({},s);return n&&(a.offset=n),s.duration&&(a.duration=ch(s.duration)),s.repeatDelay&&(a.repeatDelay=ch(s.repeatDelay)),t&&(a.ease=Rce(t)?t.map(nC):nC(t)),s.type==="tween"&&(a.type="keyframes"),(r||i||o)&&(r?a.repeatType="reverse":i?a.repeatType="loop":o&&(a.repeatType="mirror"),a.repeat=i||r||o||s.repeat),s.type!=="spring"&&(a.type="keyframes"),a}function jce(e,t){var n,r,o=Jy(e,t)||{};return(r=(n=o.delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function $ce(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=$n([],Ct(e.to),!1),e.to[0]=e.from),e}function zce(e,t,n){var r;return Array.isArray(t.to)&&((r=e.duration)!==null&&r!==void 0||(e.duration=.8)),$ce(t),Ace(e)||(e=q(q({},e),Nce(n,t.to))),q(q({},t),Lce(e))}function Bce(e,t,n,r,o){var i,s=Jy(r,e),a=(i=s.from)!==null&&i!==void 0?i:t.get(),l=rC(e,n);a==="none"&&l&&typeof n=="string"?a=Xy(e,n):iC(a)&&typeof n=="string"?a=sC(n):!Array.isArray(n)&&iC(n)&&typeof a=="string"&&(n=sC(a));var c=rC(e,a);function u(){var f={from:a,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(h){return t.set(h)}};return s.type==="inertia"||s.type==="decay"?lce(q(q({},f),s)):fR(q(q({},zce(s,f,e)),{onUpdate:function(h){var p;f.onUpdate(h),(p=s.onUpdate)===null||p===void 0||p.call(s,h)},onComplete:function(){var h;f.onComplete(),(h=s.onComplete)===null||h===void 0||h.call(s)}}))}function d(){var f,h,p=HD(n);return t.set(p),o(),(f=s==null?void 0:s.onUpdate)===null||f===void 0||f.call(s,p),(h=s==null?void 0:s.onComplete)===null||h===void 0||h.call(s),{stop:function(){}}}return!c||!l||s.type===!1?d:u}function iC(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function sC(e){return typeof e=="number"?0:Xy("",e)}function Jy(e,t){return e[t]||e.default||e}function Zy(e,t,n,r){return r===void 0&&(r={}),t.start(function(o){var i,s,a=Bce(e,t,n,r,o),l=jce(r,e),c=function(){return s=a()};return l?i=window.setTimeout(c,ch(l)):c(),function(){clearTimeout(i),s==null||s.stop()}})}var Fce=function(e){return/^\-?\d*\.?\d+$/.test(e)},Hce=function(e){return/^0[^.\s]+$/.test(e)};function Qy(e,t){e.indexOf(t)===-1&&e.push(t)}function eb(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var Dc=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(t){var n=this;return Qy(this.subscriptions,t),function(){return eb(n.subscriptions,t)}},e.prototype.notify=function(t,n,r){var o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(var i=0;i<o;i++){var s=this.subscriptions[i];s&&s(t,n,r)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),Vce=function(e){return!isNaN(parseFloat(e))},Wce=function(){function e(t){var n=this;this.version="6.5.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Dc,this.velocityUpdateSubscribers=new Dc,this.renderSubscribers=new Dc,this.canTrackVelocity=!1,this.updateAndNotify=function(r,o){o===void 0&&(o=!0),n.prev=n.current,n.current=r;var i=ah(),s=i.delta,a=i.timestamp;n.lastUpdated!==a&&(n.timeDelta=s,n.lastUpdated=a,Xr.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),o&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Xr.postRender(n.velocityCheck)},this.velocityCheck=function(r){var o=r.timestamp;o!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=Vce(this.current)}return e.prototype.onChange=function(t){return this.updateSubscribers.add(t)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},e.prototype.attach=function(t){this.passiveEffect=t},e.prototype.set=function(t,n){n===void 0&&(n=!0),!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?hR(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(t){var n=this;return this.stop(),new Promise(function(r){n.hasAnimated=!0,n.stopAnimation=t(r)}).then(function(){return n.clearAnimation()})},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function rl(e){return new Wce(e)}var wR=function(e){return function(t){return t.test(e)}},Uce={test:function(e){return e==="auto"},parse:function(e){return e}},SR=[qs,pe,Yr,ni,Rae,Dae,Uce],Bl=function(e){return SR.find(wR(e))},qce=$n($n([],Ct(SR),!1),[sn,ko],!1),Kce=function(e){return qce.find(wR(e))};function Gce(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rl(n))}function Yce(e,t){var n=hp(e,t),r=n?e.makeTargetAnimatable(n,!1):{},o=r.transitionEnd,i=o===void 0?{}:o;r.transition;var s=ir(r,["transitionEnd","transition"]);s=q(q({},s),i);for(var a in s){var l=HD(s[a]);Gce(e,a,l)}}function Xce(e,t,n){var r,o,i,s,a=Object.keys(t).filter(function(h){return!e.hasValue(h)}),l=a.length;if(l)for(var c=0;c<l;c++){var u=a[c],d=t[u],f=null;Array.isArray(d)&&(f=d[0]),f===null&&(f=(o=(r=n[u])!==null&&r!==void 0?r:e.readValue(u))!==null&&o!==void 0?o:t[u]),f!=null&&(typeof f=="string"&&(Fce(f)||Hce(f))?f=parseFloat(f):!Kce(f)&&ko.test(d)&&(f=Xy(u,d)),e.addValue(u,rl(f)),(i=(s=n)[u])!==null&&i!==void 0||(s[u]=f),e.setBaseTarget(u,f))}}function Jce(e,t){if(t){var n=t[e]||t.default||t;return n.from}}function Zce(e,t,n){var r,o,i={};for(var s in e)i[s]=(r=Jce(s,t))!==null&&r!==void 0?r:(o=n.getValue(s))===null||o===void 0?void 0:o.get();return i}function Qce(e,t,n){n===void 0&&(n={}),e.notifyAnimationStart(t);var r;if(Array.isArray(t)){var o=t.map(function(s){return qv(e,s,n)});r=Promise.all(o)}else if(typeof t=="string")r=qv(e,t,n);else{var i=typeof t=="function"?hp(e,t,n.custom):t;r=CR(e,i,n)}return r.then(function(){return e.notifyAnimationComplete(t)})}function qv(e,t,n){var r;n===void 0&&(n={});var o=hp(e,t,n.custom),i=(o||{}).transition,s=i===void 0?e.getDefaultTransition()||{}:i;n.transitionOverride&&(s=n.transitionOverride);var a=o?function(){return CR(e,o,n)}:function(){return Promise.resolve()},l=!((r=e.variantChildren)===null||r===void 0)&&r.size?function(h){h===void 0&&(h=0);var p=s.delayChildren,g=p===void 0?0:p,m=s.staggerChildren,b=s.staggerDirection;return eue(e,t,g+h,m,b,n)}:function(){return Promise.resolve()},c=s.when;if(c){var u=Ct(c==="beforeChildren"?[a,l]:[l,a],2),d=u[0],f=u[1];return d().then(f)}else return Promise.all([a(),l(n.delay)])}function CR(e,t,n){var r,o=n===void 0?{}:n,i=o.delay,s=i===void 0?0:i,a=o.transitionOverride,l=o.type,c=e.makeTargetAnimatable(t),u=c.transition,d=u===void 0?e.getDefaultTransition():u,f=c.transitionEnd,h=ir(c,["transition","transitionEnd"]);a&&(d=a);var p=[],g=l&&((r=e.animationState)===null||r===void 0?void 0:r.getState()[l]);for(var m in h){var b=e.getValue(m),y=h[m];if(!(!b||y===void 0||g&&nue(g,m))){var w=q({delay:s},d);e.shouldReduceMotion&&Pu(m)&&(w=q(q({},w),{type:!1,delay:0}));var S=Zy(m,b,y,w);p.push(S)}}return Promise.all(p).then(function(){f&&Yce(e,f)})}function eue(e,t,n,r,o,i){n===void 0&&(n=0),r===void 0&&(r=0),o===void 0&&(o=1);var s=[],a=(e.variantChildren.size-1)*r,l=o===1?function(c){return c===void 0&&(c=0),c*r}:function(c){return c===void 0&&(c=0),a-c*r};return Array.from(e.variantChildren).sort(tue).forEach(function(c,u){s.push(qv(c,t,q(q({},i),{delay:n+l(u)})).then(function(){return c.notifyAnimationComplete(t)}))}),Promise.all(s)}function tue(e,t){return e.sortNodePosition(t)}function nue(e,t){var n=e.protectedKeys,r=e.needsAnimating,o=n.hasOwnProperty(t)&&r[t]!==!0;return r[t]=!1,o}var tb=[Ve.Animate,Ve.InView,Ve.Focus,Ve.Hover,Ve.Tap,Ve.Drag,Ve.Exit],rue=$n([],Ct(tb),!1).reverse(),oue=tb.length;function iue(e){return function(t){return Promise.all(t.map(function(n){var r=n.animation,o=n.options;return Qce(e,r,o)}))}}function sue(e){var t=iue(e),n=lue(),r={},o=!0,i=function(u,d){var f=hp(e,d);if(f){f.transition;var h=f.transitionEnd,p=ir(f,["transition","transitionEnd"]);u=q(q(q({},u),p),h)}return u};function s(u){return r[u]!==void 0}function a(u){t=u(e)}function l(u,d){for(var f,h=e.getProps(),p=e.getVariantContext(!0)||{},g=[],m=new Set,b={},y=1/0,w=function(k){var _=rue[k],T=n[_],D=(f=h[_])!==null&&f!==void 0?f:p[_],O=yr(D),M=_===d?T.isActive:null;M===!1&&(y=k);var R=D===p[_]&&D!==h[_]&&O;if(R&&o&&e.manuallyAnimateOnMount&&(R=!1),T.protectedKeys=q({},b),!T.isActive&&M===null||!D&&!T.prevProp||Fy(D)||typeof D=="boolean")return"continue";var I=aue(T.prevProp,D),N=I||_===d&&T.isActive&&!R&&O||k>y&&O,$=Array.isArray(D)?D:[D],A=$.reduce(i,{});M===!1&&(A={});var z=T.prevResolvedValues,F=z===void 0?{}:z,V=q(q({},F),A),ee=function(P){N=!0,m.delete(P),T.needsAnimating[P]=!0};for(var X in V){var W=A[X],L=F[X];b.hasOwnProperty(X)||(W!==L?cu(W)&&cu(L)?!xR(W,L)||I?ee(X):T.protectedKeys[X]=!0:W!==void 0?ee(X):m.add(X):W!==void 0&&m.has(X)?ee(X):T.protectedKeys[X]=!0)}T.prevProp=D,T.prevResolvedValues=A,T.isActive&&(b=q(q({},b),A)),o&&e.blockInitialAnimation&&(N=!1),N&&!R&&g.push.apply(g,$n([],Ct($.map(function(P){return{animation:P,options:q({type:_},u)}})),!1))},S=0;S<oue;S++)w(S);if(r=q({},b),m.size){var C={};m.forEach(function(k){var _=e.getBaseTarget(k);_!==void 0&&(C[k]=_)}),g.push({animation:C})}var E=!!g.length;return o&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),o=!1,E?t(g):Promise.resolve()}function c(u,d,f){var h;if(n[u].isActive===d)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(function(m){var b;return(b=m.animationState)===null||b===void 0?void 0:b.setActive(u,d)}),n[u].isActive=d;var p=l(f,u);for(var g in n)n[g].protectedKeys={};return p}return{isAnimated:s,animateChanges:l,setActive:c,setAnimateFunction:a,getState:function(){return n}}}function aue(e,t){return typeof t=="string"?t!==e:yD(t)?!xR(t,e):!1}function ts(e){return e===void 0&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lue(){var e;return e={},e[Ve.Animate]=ts(!0),e[Ve.InView]=ts(),e[Ve.Hover]=ts(),e[Ve.Tap]=ts(),e[Ve.Drag]=ts(),e[Ve.Focus]=ts(),e[Ve.Exit]=ts(),e}var cue={animation:xi(function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=sue(t)),Fy(n)&&x.useEffect(function(){return n.subscribe(t)},[n])}),exit:xi(function(e){var t=e.custom,n=e.visualElement,r=Ct(bR(),2),o=r[0],i=r[1],s=x.useContext(fp);x.useEffect(function(){var a,l;n.isPresent=o;var c=(a=n.animationState)===null||a===void 0?void 0:a.setActive(Ve.Exit,!o,{custom:(l=s==null?void 0:s.custom)!==null&&l!==void 0?l:t});!o&&(c==null||c.then(i))},[o])})},ER=function(){function e(t,n,r){var o=this,i=r===void 0?{}:r,s=i.transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var f=Gg(o.lastMoveEventInfo,o.history),h=o.startEvent!==null,p=pR(f.offset,{x:0,y:0})>=3;if(!(!h&&!p)){var g=f.point,m=ah().timestamp;o.history.push(q(q({},g),{timestamp:m}));var b=o.handlers,y=b.onStart,w=b.onMove;h||(y&&y(o.lastMoveEvent,f),o.startEvent=o.lastMoveEvent),w&&w(o.lastMoveEvent,f)}}},this.handlePointerMove=function(f,h){if(o.lastMoveEvent=f,o.lastMoveEventInfo=Kg(h,o.transformPagePoint),WD(f)&&f.buttons===0){o.handlePointerUp(f,h);return}Xr.update(o.updatePoint,!0)},this.handlePointerUp=function(f,h){o.end();var p=o.handlers,g=p.onEnd,m=p.onSessionEnd,b=Gg(Kg(h,o.transformPagePoint),o.history);o.startEvent&&g&&g(f,b),m&&m(f,b)},!(UD(t)&&t.touches.length>1)){this.handlers=n,this.transformPagePoint=s;var a=Hy(t),l=Kg(a,this.transformPagePoint),c=l.point,u=ah().timestamp;this.history=[q(q({},c),{timestamp:u})];var d=n.onSessionStart;d&&d(t,Gg(l,this.history)),this.removeListeners=vp(Da(window,"pointermove",this.handlePointerMove),Da(window,"pointerup",this.handlePointerUp),Da(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(t){this.handlers=t},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),nl.update(this.updatePoint)},e}();function Kg(e,t){return t?{point:t(e.point)}:e}function aC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gg(e,t){var n=e.point;return{point:n,delta:aC(n,kR(t)),offset:aC(n,uue(t)),velocity:due(t,.1)}}function uue(e){return e[0]}function kR(e){return e[e.length-1]}function due(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=kR(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ch(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(i===0)return{x:0,y:0};var s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Oo(e){return e.max-e.min}function lC(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=.01),pR(e,t)<n}function cC(e,t,n,r){r===void 0&&(r=.5),e.origin=r,e.originPoint=rt(t.min,t.max,e.origin),e.scale=Oo(n)/Oo(t),(lC(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=rt(n.min,n.max,e.origin)-e.originPoint,(lC(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Rc(e,t,n,r){cC(e.x,t.x,n.x,r==null?void 0:r.originX),cC(e.y,t.y,n.y,r==null?void 0:r.originY)}function uC(e,t,n){e.min=n.min+t.min,e.max=e.min+Oo(t)}function fue(e,t,n){uC(e.x,t.x,n.x),uC(e.y,t.y,n.y)}function dC(e,t,n){e.min=t.min-n.min,e.max=e.min+Oo(t)}function Ic(e,t,n){dC(e.x,t.x,n.x),dC(e.y,t.y,n.y)}function hue(e,t,n){var r=t.min,o=t.max;return r!==void 0&&e<r?e=n?rt(r,e,n.min):Math.max(e,r):o!==void 0&&e>o&&(e=n?rt(o,e,n.max):Math.min(e,o)),e}function fC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function pue(e,t){var n=t.top,r=t.left,o=t.bottom,i=t.right;return{x:fC(e.x,r,i),y:fC(e.y,n,o)}}function hC(e,t){var n,r=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&(n=Ct([o,r],2),r=n[0],o=n[1]),{min:r,max:o}}function gue(e,t){return{x:hC(e.x,t.x),y:hC(e.y,t.y)}}function mue(e,t){var n=.5,r=Oo(e),o=Oo(t);return o>r?n=uu(t.min,t.max-r,e.min):r>o&&(n=uu(e.min,e.max-o,t.min)),ih(0,1,n)}function vue(e,t){var n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Kv=.35;function yue(e){return e===void 0&&(e=Kv),e===!1?e=0:e===!0&&(e=Kv),{x:pC(e,"left","right"),y:pC(e,"top","bottom")}}function pC(e,t,n){return{min:gC(e,t),max:gC(e,n)}}function gC(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}var mC=function(){return{translate:0,scale:1,origin:0,originPoint:0}},Nc=function(){return{x:mC(),y:mC()}},vC=function(){return{min:0,max:0}},qt=function(){return{x:vC(),y:vC()}};function Vr(e){return[e("x"),e("y")]}function OR(e){var t=e.top,n=e.left,r=e.right,o=e.bottom;return{x:{min:n,max:r},y:{min:t,max:o}}}function bue(e){var t=e.x,n=e.y;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function xue(e,t){if(!t)return e;var n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Yg(e){return e===void 0||e===1}function TR(e){var t=e.scale,n=e.scaleX,r=e.scaleY;return!Yg(t)||!Yg(n)||!Yg(r)}function ri(e){return TR(e)||yC(e.x)||yC(e.y)||e.z||e.rotate||e.rotateX||e.rotateY}function yC(e){return e&&e!=="0%"}function uh(e,t,n){var r=e-n,o=t*r;return n+o}function bC(e,t,n,r,o){return o!==void 0&&(e=uh(e,o,r)),uh(e,n,r)+t}function Gv(e,t,n,r,o){t===void 0&&(t=0),n===void 0&&(n=1),e.min=bC(e.min,t,n,r,o),e.max=bC(e.max,t,n,r,o)}function _R(e,t){var n=t.x,r=t.y;Gv(e.x,n.translate,n.scale,n.originPoint),Gv(e.y,r.translate,r.scale,r.originPoint)}function wue(e,t,n,r){var o,i;r===void 0&&(r=!1);var s=n.length;if(s){t.x=t.y=1;for(var a,l,c=0;c<s;c++)a=n[c],l=a.projectionDelta,((i=(o=a.instance)===null||o===void 0?void 0:o.style)===null||i===void 0?void 0:i.display)!=="contents"&&(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Sa(e,{x:-a.scroll.x,y:-a.scroll.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,_R(e,l)),r&&ri(a.latestValues)&&Sa(e,a.latestValues))}}function ai(e,t){e.min=e.min+t,e.max=e.max+t}function xC(e,t,n){var r=Ct(n,3),o=r[0],i=r[1],s=r[2],a=t[s]!==void 0?t[s]:.5,l=rt(e.min,e.max,a);Gv(e,t[o],t[i],l,t.scale)}var Sue=["x","scaleX","originX"],Cue=["y","scaleY","originY"];function Sa(e,t){xC(e.x,t,Sue),xC(e.y,t,Cue)}function MR(e,t){return OR(xue(e.getBoundingClientRect(),t))}function Eue(e,t,n){var r=MR(e,n),o=t.scroll;return o&&(ai(r.x,o.x),ai(r.y,o.y)),r}var kue=new WeakMap,Oue=function(){function e(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qt(),this.visualElement=t}return e.prototype.start=function(t,n){var r=this,o=n===void 0?{}:n,i=o.snapToCursor,s=i===void 0?!1:i;if(this.visualElement.isPresent!==!1){var a=function(d){r.stopAnimation(),s&&r.snapToCursor(Hy(d,"page").point)},l=function(d,f){var h,p=r.getProps(),g=p.drag,m=p.dragPropagation,b=p.onDragStart;g&&!m&&(r.openGlobalLock&&r.openGlobalLock(),r.openGlobalLock=YD(g),!r.openGlobalLock)||(r.isDragging=!0,r.currentDirection=null,r.resolveConstraints(),r.visualElement.projection&&(r.visualElement.projection.isAnimationBlocked=!0,r.visualElement.projection.target=void 0),Vr(function(y){var w,S,C=r.getAxisMotionValue(y).get()||0;if(Yr.test(C)){var E=(S=(w=r.visualElement.projection)===null||w===void 0?void 0:w.layout)===null||S===void 0?void 0:S.actual[y];if(E){var k=Oo(E);C=k*(parseFloat(C)/100)}}r.originPoint[y]=C}),b==null||b(d,f),(h=r.visualElement.animationState)===null||h===void 0||h.setActive(Ve.Drag,!0))},c=function(d,f){var h=r.getProps(),p=h.dragPropagation,g=h.dragDirectionLock,m=h.onDirectionLock,b=h.onDrag;if(!(!p&&!r.openGlobalLock)){var y=f.offset;if(g&&r.currentDirection===null){r.currentDirection=Tue(y),r.currentDirection!==null&&(m==null||m(r.currentDirection));return}r.updateAxis("x",f.point,y),r.updateAxis("y",f.point,y),r.visualElement.syncRender(),b==null||b(d,f)}},u=function(d,f){return r.stop(d,f)};this.panSession=new ER(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:u},{transformPagePoint:this.visualElement.getTransformPagePoint()})}},e.prototype.stop=function(t,n){var r=this.isDragging;if(this.cancel(),!!r){var o=n.velocity;this.startAnimation(o);var i=this.getProps().onDragEnd;i==null||i(t,n)}},e.prototype.cancel=function(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;var r=this.getProps().dragPropagation;!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(Ve.Drag,!1)},e.prototype.updateAxis=function(t,n,r){var o=this.getProps().drag;if(!(!r||!gd(t,o,this.currentDirection))){var i=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=hue(s,this.constraints[t],this.elastic[t])),i.set(s)}},e.prototype.resolveConstraints=function(){var t=this,n=this.getProps(),r=n.dragConstraints,o=n.dragElastic,i=(this.visualElement.projection||{}).layout,s=this.constraints;r&&wa(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=pue(i.actual,r):this.constraints=!1,this.elastic=yue(o),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vr(function(a){t.getAxisMotionValue(a)&&(t.constraints[a]=vue(i.actual[a],t.constraints[a]))})},e.prototype.resolveRefConstraints=function(){var t=this.getProps(),n=t.dragConstraints,r=t.onMeasureDragConstraints;if(!n||!wa(n))return!1;var o=n.current,i=this.visualElement.projection;if(!i||!i.layout)return!1;var s=Eue(o,i.root,this.visualElement.getTransformPagePoint()),a=gue(i.layout.actual,s);if(r){var l=r(bue(a));this.hasMutatedConstraints=!!l,l&&(a=OR(l))}return a},e.prototype.startAnimation=function(t){var n=this,r=this.getProps(),o=r.drag,i=r.dragMomentum,s=r.dragElastic,a=r.dragTransition,l=r.dragSnapToOrigin,c=r.onDragTransitionEnd,u=this.constraints||{},d=Vr(function(f){var h;if(gd(f,o,n.currentDirection)){var p=(h=u==null?void 0:u[f])!==null&&h!==void 0?h:{};l&&(p={min:0,max:0});var g=s?200:1e6,m=s?40:1e7,b=q(q({type:"inertia",velocity:i?t[f]:0,bounceStiffness:g,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),p);return n.startAxisValueAnimation(f,b)}});return Promise.all(d).then(c)},e.prototype.startAxisValueAnimation=function(t,n){var r=this.getAxisMotionValue(t);return Zy(t,r,0,n)},e.prototype.stopAnimation=function(){var t=this;Vr(function(n){return t.getAxisMotionValue(n).stop()})},e.prototype.getAxisMotionValue=function(t){var n,r,o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)},e.prototype.snapToCursor=function(t){var n=this;Vr(function(r){var o=n.getProps().drag;if(gd(r,o,n.currentDirection)){var i=n.visualElement.projection,s=n.getAxisMotionValue(r);if(i&&i.layout){var a=i.layout.actual[r],l=a.min,c=a.max;s.set(t[r]-rt(l,c,.5))}}})},e.prototype.scalePositionWithinConstraints=function(){var t=this,n,r=this.getProps(),o=r.drag,i=r.dragConstraints,s=this.visualElement.projection;if(!(!wa(i)||!s||!this.constraints)){this.stopAnimation();var a={x:0,y:0};Vr(function(c){var u=t.getAxisMotionValue(c);if(u){var d=u.get();a[c]=mue({min:d,max:d},t.constraints[c])}});var l=this.visualElement.getProps().transformTemplate;this.visualElement.getInstance().style.transform=l?l({},""):"none",(n=s.root)===null||n===void 0||n.updateScroll(),s.updateLayout(),this.resolveConstraints(),Vr(function(c){if(gd(c,o,null)){var u=t.getAxisMotionValue(c),d=t.constraints[c],f=d.min,h=d.max;u.set(rt(f,h,a[c]))}})}},e.prototype.addListeners=function(){var t=this,n;kue.set(this.visualElement,this);var r=this.visualElement.getInstance(),o=Da(r,"pointerdown",function(c){var u=t.getProps(),d=u.drag,f=u.dragListener,h=f===void 0?!0:f;d&&h&&t.start(c)}),i=function(){var c=t.getProps().dragConstraints;wa(c)&&(t.constraints=t.resolveRefConstraints())},s=this.visualElement.projection,a=s.addEventListener("measure",i);s&&!s.layout&&((n=s.root)===null||n===void 0||n.updateScroll(),s.updateLayout()),i();var l=mp(window,"resize",function(){return t.scalePositionWithinConstraints()});return s.addEventListener("didUpdate",function(c){var u=c.delta,d=c.hasLayoutChanged;t.isDragging&&d&&(Vr(function(f){var h=t.getAxisMotionValue(f);h&&(t.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),t.visualElement.syncRender())}),function(){l(),o(),a()}},e.prototype.getProps=function(){var t=this.visualElement.getProps(),n=t.drag,r=n===void 0?!1:n,o=t.dragDirectionLock,i=o===void 0?!1:o,s=t.dragPropagation,a=s===void 0?!1:s,l=t.dragConstraints,c=l===void 0?!1:l,u=t.dragElastic,d=u===void 0?Kv:u,f=t.dragMomentum,h=f===void 0?!0:f;return q(q({},t),{drag:r,dragDirectionLock:i,dragPropagation:a,dragConstraints:c,dragElastic:d,dragMomentum:h})},e}();function gd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tue(e,t){t===void 0&&(t=10);var n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function _ue(e){var t=e.dragControls,n=e.visualElement,r=gp(function(){return new Oue(n)});x.useEffect(function(){return t&&t.subscribe(r)},[r,t]),x.useEffect(function(){return r.addListeners()},[r])}function Mue(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,o=e.onPanSessionStart,i=e.visualElement,s=t||n||r||o,a=x.useRef(null),l=x.useContext(Py).transformPagePoint,c={onSessionStart:o,onStart:n,onMove:t,onEnd:function(d,f){a.current=null,r&&r(d,f)}};x.useEffect(function(){a.current!==null&&a.current.updateHandlers(c)});function u(d){a.current=new ER(d,c,{transformPagePoint:l})}oh(i,"pointerdown",s&&u),ZD(function(){return a.current&&a.current.end()})}var Due={pan:xi(Mue),drag:xi(_ue)},md=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function Rue(){var e=md.map(function(){return new Dc}),t={},n={clearAllListeners:function(){return e.forEach(function(r){return r.clear()})},updatePropListeners:function(r){md.forEach(function(o){var i,s="on"+o,a=r[s];(i=t[o])===null||i===void 0||i.call(t),a&&(t[o]=n[s](a))})}};return e.forEach(function(r,o){n["on"+md[o]]=function(i){return r.add(i)},n["notify"+md[o]]=function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r.notify.apply(r,$n([],Ct(i),!1))}}),n}function Iue(e,t,n){var r;for(var o in t){var i=t[o],s=n[o];if(Eo(i))e.addValue(o,i);else if(Eo(s))e.addValue(o,rl(i));else if(s!==i)if(e.hasValue(o)){var a=e.getValue(o);!a.hasAnimated&&a.set(i)}else e.addValue(o,rl((r=e.getStaticValue(o))!==null&&r!==void 0?r:i))}for(var o in n)t[o]===void 0&&e.removeValue(o);return t}var DR=function(e){var t=e.treeType,n=t===void 0?"":t,r=e.build,o=e.getBaseTarget,i=e.makeTargetAnimatable,s=e.measureViewportBox,a=e.render,l=e.readValueFromInstance,c=e.removeValueFromRenderState,u=e.sortNodePosition,d=e.scrapeMotionValuesFromProps;return function(f,h){var p=f.parent,g=f.props,m=f.presenceId,b=f.blockInitialAnimation,y=f.visualState,w=f.shouldReduceMotion;h===void 0&&(h={});var S=!1,C=y.latestValues,E=y.renderState,k,_=Rue(),T=new Map,D=new Map,O={},M=q({},C),R;function I(){!k||!S||(N(),a(k,E,g.style,W.projection))}function N(){r(W,E,C,h,g)}function $(){_.notifyUpdate(C)}function A(L,P){var j=P.onChange(function(re){C[L]=re,g.onUpdate&&Xr.update($,!1,!0)}),Y=P.onRenderRequest(W.scheduleRender);D.set(L,function(){j(),Y()})}var z=d(g);for(var F in z){var V=z[F];C[F]!==void 0&&Eo(V)&&V.set(C[F],!1)}var ee=pp(g),X=xD(g),W=q(q({treeType:n,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,presenceId:m,shouldReduceMotion:w,variantChildren:X?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:!!(p!=null&&p.isMounted()),blockInitialAnimation:b,isMounted:function(){return!!k},mount:function(L){S=!0,k=W.current=L,W.projection&&W.projection.mount(L),X&&p&&!ee&&(R=p==null?void 0:p.addVariantChild(W)),T.forEach(function(P,j){return A(j,P)}),p==null||p.children.add(W),W.setProps(g)},unmount:function(){var L;(L=W.projection)===null||L===void 0||L.unmount(),nl.update($),nl.render(I),D.forEach(function(P){return P()}),R==null||R(),p==null||p.children.delete(W),_.clearAllListeners(),k=void 0,S=!1},addVariantChild:function(L){var P,j=W.getClosestVariantNode();if(j)return(P=j.variantChildren)===null||P===void 0||P.add(L),function(){return j.variantChildren.delete(L)}},sortNodePosition:function(L){return!u||n!==L.treeType?0:u(W.getInstance(),L.getInstance())},getClosestVariantNode:function(){return X?W:p==null?void 0:p.getClosestVariantNode()},getLayoutId:function(){return g.layoutId},getInstance:function(){return k},getStaticValue:function(L){return C[L]},setStaticValue:function(L,P){return C[L]=P},getLatestValues:function(){return C},setVisibility:function(L){W.isVisible!==L&&(W.isVisible=L,W.scheduleRender())},makeTargetAnimatable:function(L,P){return P===void 0&&(P=!0),i(W,L,g,P)},measureViewportBox:function(){return s(k,g)},addValue:function(L,P){W.hasValue(L)&&W.removeValue(L),T.set(L,P),C[L]=P.get(),A(L,P)},removeValue:function(L){var P;T.delete(L),(P=D.get(L))===null||P===void 0||P(),D.delete(L),delete C[L],c(L,E)},hasValue:function(L){return T.has(L)},getValue:function(L,P){var j=T.get(L);return j===void 0&&P!==void 0&&(j=rl(P),W.addValue(L,j)),j},forEachValue:function(L){return T.forEach(L)},readValue:function(L){var P;return(P=C[L])!==null&&P!==void 0?P:l(k,L,h)},setBaseTarget:function(L,P){M[L]=P},getBaseTarget:function(L){if(o){var P=o(g,L);if(P!==void 0&&!Eo(P))return P}return M[L]}},_),{build:function(){return N(),E},scheduleRender:function(){Xr.render(I,!1,!0)},syncRender:I,setProps:function(L){(L.transformTemplate||g.transformTemplate)&&W.scheduleRender(),g=L,_.updatePropListeners(L),O=Iue(W,d(g),O)},getProps:function(){return g},getVariant:function(L){var P;return(P=g.variants)===null||P===void 0?void 0:P[L]},getDefaultTransition:function(){return g.transition},getTransformPagePoint:function(){return g.transformPagePoint},getVariantContext:function(L){if(L===void 0&&(L=!1),L)return p==null?void 0:p.getVariantContext();if(!ee){var P=(p==null?void 0:p.getVariantContext())||{};return g.initial!==void 0&&(P.initial=g.initial),P}for(var j={},Y=0;Y<Nue;Y++){var re=RR[Y],se=g[re];(yr(se)||se===!1)&&(j[re]=se)}return j}});return W}},RR=$n(["initial"],Ct(tb),!1),Nue=RR.length;function Yv(e){return typeof e=="string"&&e.startsWith("var(--")}var IR=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Pue(e){var t=IR.exec(e);if(!t)return[,];var n=Ct(t,3),r=n[1],o=n[2];return[r,o]}function Xv(e,t,n){var r=Ct(Pue(e),2),o=r[0],i=r[1];if(o){var s=window.getComputedStyle(t).getPropertyValue(o);return s?s.trim():Yv(i)?Xv(i,t):i}}function Aue(e,t,n){var r,o=ir(t,[]),i=e.getInstance();if(!(i instanceof Element))return{target:o,transitionEnd:n};n&&(n=q({},n)),e.forEachValue(function(c){var u=c.get();if(Yv(u)){var d=Xv(u,i);d&&c.set(d)}});for(var s in o){var a=o[s];if(Yv(a)){var l=Xv(a,i);l&&(o[s]=l,n&&((r=n[s])!==null&&r!==void 0||(n[s]=a)))}}return{target:o,transitionEnd:n}}var Lue=new Set(["width","height","top","left","right","bottom","x","y"]),NR=function(e){return Lue.has(e)},jue=function(e){return Object.keys(e).some(NR)},PR=function(e,t){e.set(t,!1),e.set(t)},wC=function(e){return e===qs||e===pe},SC;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(SC||(SC={}));var CC=function(e,t){return parseFloat(e.split(", ")[t])},EC=function(e,t){return function(n,r){var o=r.transform;if(o==="none"||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return CC(i[1],t);var s=o.match(/^matrix\((.+)\)$/);return s?CC(s[1],e):0}},$ue=new Set(["x","y","z"]),zue=au.filter(function(e){return!$ue.has(e)});function Bue(e){var t=[];return zue.forEach(function(n){var r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.syncRender(),t}var kC={width:function(e,t){var n=e.x,r=t.paddingLeft,o=r===void 0?"0":r,i=t.paddingRight,s=i===void 0?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(s)},height:function(e,t){var n=e.y,r=t.paddingTop,o=r===void 0?"0":r,i=t.paddingBottom,s=i===void 0?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(s)},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:EC(4,13),y:EC(5,14)},Fue=function(e,t,n){var r=t.measureViewportBox(),o=t.getInstance(),i=getComputedStyle(o),s=i.display,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(function(c){a[c]=kC[c](r,i)}),t.syncRender();var l=t.measureViewportBox();return n.forEach(function(c){var u=t.getValue(c);PR(u,a[c]),e[c]=kC[c](l,i)}),e},Hue=function(e,t,n,r){n===void 0&&(n={}),r===void 0&&(r={}),t=q({},t),r=q({},r);var o=Object.keys(t).filter(NR),i=[],s=!1,a=[];if(o.forEach(function(u){var d=e.getValue(u);if(e.hasValue(u)){var f=n[u],h=Bl(f),p=t[u],g;if(cu(p)){var m=p.length,b=p[0]===null?1:0;f=p[b],h=Bl(f);for(var y=b;y<m;y++)g?th(Bl(p[y])===g):g=Bl(p[y])}else g=Bl(p);if(h!==g)if(wC(h)&&wC(g)){var w=d.get();typeof w=="string"&&d.set(parseFloat(w)),typeof p=="string"?t[u]=parseFloat(p):Array.isArray(p)&&g===pe&&(t[u]=p.map(parseFloat))}else h!=null&&h.transform&&(g!=null&&g.transform)&&(f===0||p===0)?f===0?d.set(g.transform(f)):t[u]=h.transform(p):(s||(i=Bue(e),s=!0),a.push(u),r[u]=r[u]!==void 0?r[u]:t[u],PR(d,p))}}),a.length){var l=a.indexOf("height")>=0?window.pageYOffset:null,c=Fue(t,e,a);return i.length&&i.forEach(function(u){var d=Ct(u,2),f=d[0],h=d[1];e.getValue(f).set(h)}),e.syncRender(),l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Vue(e,t,n,r){return jue(t)?Hue(e,t,n,r):{target:t,transitionEnd:r}}var Wue=function(e,t,n,r){var o=Aue(e,t,r);return t=o.target,r=o.transitionEnd,Vue(e,t,n,r)};function Uue(e){return window.getComputedStyle(e)}var AR={treeType:"dom",readValueFromInstance:function(e,t){if(Pu(t)){var n=Yy(t);return n&&n.default||0}else{var r=Uue(e);return(kD(t)?r.getPropertyValue(t):r[t])||0}},sortNodePosition:function(e,t){return e.compareDocumentPosition(t)&2?1:-1},getBaseTarget:function(e,t){var n;return(n=e.style)===null||n===void 0?void 0:n[t]},measureViewportBox:function(e,t){var n=t.transformPagePoint;return MR(e,n)},resetTransform:function(e,t,n){var r=n.transformTemplate;t.style.transform=r?r({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,r=t.style;delete n[e],delete r[e]},makeTargetAnimatable:function(e,t,n,r){var o=n.transformValues;r===void 0&&(r=!0);var i=t.transition,s=t.transitionEnd,a=ir(t,["transition","transitionEnd"]),l=Zce(a,i||{},e);if(o&&(s&&(s=o(s)),a&&(a=o(a)),l&&(l=o(l))),r){Xce(e,a,l);var c=Wue(e,a,l,s);s=c.transitionEnd,a=c.target}return q({transition:i,transitionEnd:s},a)},scrapeMotionValuesFromProps:By,build:function(e,t,n,r,o){e.isVisible!==void 0&&(t.style.visibility=e.isVisible?"visible":"hidden"),jy(t,n,r,o.transformTemplate)},render:$D},que=DR(AR),Kue=DR(q(q({},AR),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return Pu(t)?((n=Yy(t))===null||n===void 0?void 0:n.default)||0:(t=zD.has(t)?t:jD(t),e.getAttribute(t))},scrapeMotionValuesFromProps:FD,build:function(e,t,n,r,o){zy(t,n,r,o.transformTemplate)},render:BD})),Gue=function(e,t){return Ay(e)?Kue(t,{enableHardwareAcceleration:!1}):que(t,{enableHardwareAcceleration:!0})};function OC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Fl={correct:function(e,t){if(!t.target)return e;if(typeof e=="string")if(pe.test(e))e=parseFloat(e);else return e;var n=OC(e,t.target.x),r=OC(e,t.target.y);return"".concat(n,"% ").concat(r,"%")}},TC="_$css",Yue={correct:function(e,t){var n=t.treeScale,r=t.projectionDelta,o=e,i=e.includes("var("),s=[];i&&(e=e.replace(IR,function(g){return s.push(g),TC}));var a=ko.parse(e);if(a.length>5)return o;var l=ko.createTransformer(e),c=typeof a[0]!="number"?1:0,u=r.x.scale*n.x,d=r.y.scale*n.y;a[0+c]/=u,a[1+c]/=d;var f=rt(u,d,.5);typeof a[2+c]=="number"&&(a[2+c]/=f),typeof a[3+c]=="number"&&(a[3+c]/=f);var h=l(a);if(i){var p=0;h=h.replace(TC,function(){var g=s[p];return p++,g})}return h}},Xue=function(e){QE(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){var n=this,r=this.props,o=r.visualElement,i=r.layoutGroup,s=r.switchLayoutGroup,a=r.layoutId,l=o.projection;xae(Zue),l&&(i!=null&&i.group&&i.group.add(l),s!=null&&s.register&&a&&s.register(l),l.root.didUpdate(),l.addEventListener("animationComplete",function(){n.safeToRemove()}),l.setOptions(q(q({},l.options),{onExitComplete:function(){return n.safeToRemove()}}))),Tc.hasEverUpdated=!0},t.prototype.getSnapshotBeforeUpdate=function(n){var r=this,o=this.props,i=o.layoutDependency,s=o.visualElement,a=o.drag,l=o.isPresent,c=s.projection;return c&&(c.isPresent=l,a||n.layoutDependency!==i||i===void 0?c.willUpdate():this.safeToRemove(),n.isPresent!==l&&(l?c.promote():c.relegate()||Xr.postRender(function(){var u;!((u=c.getStack())===null||u===void 0)&&u.members.length||r.safeToRemove()}))),null},t.prototype.componentDidUpdate=function(){var n=this.props.visualElement.projection;n&&(n.root.didUpdate(),!n.currentAnimation&&n.isLead()&&this.safeToRemove())},t.prototype.componentWillUnmount=function(){var n=this.props,r=n.visualElement,o=n.layoutGroup,i=n.switchLayoutGroup,s=r.projection;s&&(s.scheduleCheckAfterUnmount(),o!=null&&o.group&&o.group.remove(s),i!=null&&i.deregister&&i.deregister(s))},t.prototype.safeToRemove=function(){var n=this.props.safeToRemove;n==null||n()},t.prototype.render=function(){return null},t}(U.Component);function Jue(e){var t=Ct(bR(),2),n=t[0],r=t[1],o=x.useContext(wD);return U.createElement(Xue,q({},e,{layoutGroup:o,switchLayoutGroup:x.useContext(SD),isPresent:n,safeToRemove:r}))}var Zue={borderRadius:q(q({},Fl),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Fl,borderTopRightRadius:Fl,borderBottomLeftRadius:Fl,borderBottomRightRadius:Fl,boxShadow:Yue},Que={measureLayout:Jue};function ede(e,t,n){n===void 0&&(n={});var r=Eo(e)?e:rl(e);return Zy("",r,t,n),{stop:function(){return r.stop()},isAnimating:function(){return r.isAnimating()}}}var LR=["TopLeft","TopRight","BottomLeft","BottomRight"],tde=LR.length,_C=function(e){return typeof e=="string"?parseFloat(e):e},MC=function(e){return typeof e=="number"||pe.test(e)};function nde(e,t,n,r,o,i){var s,a,l,c;o?(e.opacity=rt(0,(s=n.opacity)!==null&&s!==void 0?s:1,rde(r)),e.opacityExit=rt((a=t.opacity)!==null&&a!==void 0?a:1,0,ode(r))):i&&(e.opacity=rt((l=t.opacity)!==null&&l!==void 0?l:1,(c=n.opacity)!==null&&c!==void 0?c:1,r));for(var u=0;u<tde;u++){var d="border".concat(LR[u],"Radius"),f=DC(t,d),h=DC(n,d);if(!(f===void 0&&h===void 0)){f||(f=0),h||(h=0);var p=f===0||h===0||MC(f)===MC(h);p?(e[d]=Math.max(rt(_C(f),_C(h),r),0),(Yr.test(h)||Yr.test(f))&&(e[d]+="%")):e[d]=h}}(t.rotate||n.rotate)&&(e.rotate=rt(t.rotate||0,n.rotate||0,r))}function DC(e,t){var n;return(n=e[t])!==null&&n!==void 0?n:e.borderRadius}var rde=jR(0,.5,Ky),ode=jR(.5,.95,Uy);function jR(e,t,n){return function(r){return r<e?0:r>t?1:n(uu(e,t,r))}}function RC(e,t){e.min=t.min,e.max=t.max}function ur(e,t){RC(e.x,t.x),RC(e.y,t.y)}function IC(e,t,n,r,o){return e-=t,e=uh(e,1/n,r),o!==void 0&&(e=uh(e,1/o,r)),e}function ide(e,t,n,r,o,i,s){if(t===void 0&&(t=0),n===void 0&&(n=1),r===void 0&&(r=.5),i===void 0&&(i=e),s===void 0&&(s=e),Yr.test(t)){t=parseFloat(t);var a=rt(s.min,s.max,t/100);t=a-s.min}if(typeof t=="number"){var l=rt(i.min,i.max,r);e===i&&(l-=t),e.min=IC(e.min,t,n,l,o),e.max=IC(e.max,t,n,l,o)}}function NC(e,t,n,r,o){var i=Ct(n,3),s=i[0],a=i[1],l=i[2];ide(e,t[s],t[a],t[l],t.scale,r,o)}var sde=["x","scaleX","originX"],ade=["y","scaleY","originY"];function PC(e,t,n,r){NC(e.x,t,sde,n==null?void 0:n.x,r==null?void 0:r.x),NC(e.y,t,ade,n==null?void 0:n.y,r==null?void 0:r.y)}function AC(e){return e.translate===0&&e.scale===1}function $R(e){return AC(e.x)&&AC(e.y)}function zR(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}var lde=function(){function e(){this.members=[]}return e.prototype.add=function(t){Qy(this.members,t),t.scheduleRender()},e.prototype.remove=function(t){if(eb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){var n=this.members[this.members.length-1];n&&this.promote(n)}},e.prototype.relegate=function(t){var n=this.members.findIndex(function(s){return t===s});if(n===0)return!1;for(var r,o=n;o>=0;o--){var i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1},e.prototype.promote=function(t,n){var r,o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);var i=t.options.crossfade;i===!1&&o.hide()}},e.prototype.exitAnimationComplete=function(){this.members.forEach(function(t){var n,r,o,i,s;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(s=(o=t.resumingFrom)===null||o===void 0?void 0:(i=o.options).onExitComplete)===null||s===void 0||s.call(i)})},e.prototype.scheduleRender=function(){this.members.forEach(function(t){t.instance&&t.scheduleRender(!1)})},e.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},e}(),cde="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function LC(e,t,n){var r=e.x.translate/t.x,o=e.y.translate/t.y,i="translate3d(".concat(r,"px, ").concat(o,"px, 0) ");if(i+="scale(".concat(1/t.x,", ").concat(1/t.y,") "),n){var s=n.rotate,a=n.rotateX,l=n.rotateY;s&&(i+="rotate(".concat(s,"deg) ")),a&&(i+="rotateX(".concat(a,"deg) ")),l&&(i+="rotateY(".concat(l,"deg) "))}var c=e.x.scale*t.x,u=e.y.scale*t.y;return i+="scale(".concat(c,", ").concat(u,")"),i===cde?"none":i}var ude=function(e,t){return e.depth-t.depth},dde=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(t){Qy(this.children,t),this.isDirty=!0},e.prototype.remove=function(t){eb(this.children,t),this.isDirty=!0},e.prototype.forEach=function(t){this.isDirty&&this.children.sort(ude),this.isDirty=!1,this.children.forEach(t)},e}(),jC=1e3;function BR(e){var t=e.attachResizeListener,n=e.defaultParent,r=e.measureScroll,o=e.checkIsScrollRoot,i=e.resetTransform;return function(){function s(a,l,c){var u=this;l===void 0&&(l={}),c===void 0&&(c=n==null?void 0:n()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){u.isUpdating&&(u.isUpdating=!1,u.clearAllSnapshots())},this.updateProjection=function(){u.nodes.forEach(vde),u.nodes.forEach(yde)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=a,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?$n($n([],Ct(c.path),!1),[c],!1):[],this.parent=c,this.depth=c?c.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(var d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new dde)}return s.prototype.addEventListener=function(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Dc),this.eventHandlers.get(a).add(l)},s.prototype.notifyListeners=function(a){for(var l=[],c=1;c<arguments.length;c++)l[c-1]=arguments[c];var u=this.eventHandlers.get(a);u==null||u.notify.apply(u,$n([],Ct(l),!1))},s.prototype.hasListeners=function(a){return this.eventHandlers.has(a)},s.prototype.registerPotentialNode=function(a,l){this.potentialNodes.set(a,l)},s.prototype.mount=function(a,l){var c=this,u;if(l===void 0&&(l=!1),!this.instance){this.isSVG=a instanceof SVGElement&&a.tagName!=="svg",this.instance=a;var d=this.options,f=d.layoutId,h=d.layout,p=d.visualElement;if(p&&!p.getInstance()&&p.mount(a),this.root.nodes.add(this),(u=this.parent)===null||u===void 0||u.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),l&&(h||f)&&(this.isLayoutDirty=!0),t){var g,m=function(){return c.root.updateBlockedByResize=!1};t(a,function(){c.root.updateBlockedByResize=!0,clearTimeout(g),g=window.setTimeout(m,250),Tc.hasAnimatedSinceResize&&(Tc.hasAnimatedSinceResize=!1,c.nodes.forEach(mde))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&p&&(f||h)&&this.addEventListener("didUpdate",function(b){var y,w,S,C,E,k=b.delta,_=b.hasLayoutChanged,T=b.hasRelativeTargetChanged,D=b.layout;if(c.isTreeAnimationBlocked()){c.target=void 0,c.relativeTarget=void 0;return}var O=(w=(y=c.options.transition)!==null&&y!==void 0?y:p.getDefaultTransition())!==null&&w!==void 0?w:Cde,M=p.getProps(),R=M.onLayoutAnimationStart,I=M.onLayoutAnimationComplete,N=!c.targetLayout||!zR(c.targetLayout,D)||T,$=!_&&T;if(!((S=c.resumeFrom)===null||S===void 0)&&S.instance||$||_&&(N||!c.currentAnimation)){c.resumeFrom&&(c.resumingFrom=c.resumeFrom,c.resumingFrom.resumingFrom=void 0),c.setAnimationOrigin(k,$);var A=q(q({},Jy(O,"layout")),{onPlay:R,onComplete:I});p.shouldReduceMotion&&(A.delay=0,A.type=!1),c.startAnimation(A)}else!_&&c.animationProgress===0&&c.finishAnimation(),c.isLead()&&((E=(C=c.options).onExitComplete)===null||E===void 0||E.call(C));c.targetLayout=D})}},s.prototype.unmount=function(){var a,l;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(l=this.parent)===null||l===void 0||l.children.delete(this),this.instance=void 0,nl.preRender(this.updateProjection)},s.prototype.blockUpdate=function(){this.updateManuallyBlocked=!0},s.prototype.unblockUpdate=function(){this.updateManuallyBlocked=!1},s.prototype.isUpdateBlocked=function(){return this.updateManuallyBlocked||this.updateBlockedByResize},s.prototype.isTreeAnimationBlocked=function(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1},s.prototype.startUpdate=function(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(bde))},s.prototype.willUpdate=function(a){var l,c,u;if(a===void 0&&(a=!0),this.root.isUpdateBlocked()){(c=(l=this.options).onExitComplete)===null||c===void 0||c.call(l);return}if(!this.root.isUpdating&&this.root.startUpdate(),!this.isLayoutDirty){this.isLayoutDirty=!0;for(var d=0;d<this.path.length;d++){var f=this.path[d];f.shouldResetTransform=!0,f.updateScroll()}var h=this.options,p=h.layoutId,g=h.layout;if(!(p===void 0&&!g)){var m=(u=this.options.visualElement)===null||u===void 0?void 0:u.getProps().transformTemplate;this.prevTransformTemplateValue=m==null?void 0:m(this.latestValues,""),this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}}},s.prototype.didUpdate=function(){var a=this.isUpdateBlocked();if(a){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach($C);return}this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Ede),this.potentialNodes.clear()),this.nodes.forEach(gde),this.nodes.forEach(fde),this.nodes.forEach(hde),this.clearAllSnapshots(),Wg.update(),Wg.preRender(),Wg.render())},s.prototype.clearAllSnapshots=function(){this.nodes.forEach(pde),this.sharedNodes.forEach(xde)},s.prototype.scheduleUpdateProjection=function(){Xr.preRender(this.updateProjection,!1,!0)},s.prototype.scheduleCheckAfterUnmount=function(){var a=this;Xr.postRender(function(){a.isLayoutDirty?a.root.didUpdate():a.root.checkUpdateFailed()})},s.prototype.updateSnapshot=function(){if(!(this.snapshot||!this.instance)){var a=this.measure(),l=this.removeTransform(this.removeElementScroll(a));HC(l),this.snapshot={measured:a,layout:l,latestValues:{}}}},s.prototype.updateLayout=function(){var a;if(this.instance&&(this.updateScroll(),!(!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))){if(this.resumeFrom&&!this.resumeFrom.instance)for(var l=0;l<this.path.length;l++){var c=this.path[l];c.updateScroll()}var u=this.measure();HC(u);var d=this.layout;this.layout={measured:u,actual:this.removeElementScroll(u)},this.layoutCorrected=qt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),(a=this.options.visualElement)===null||a===void 0||a.notifyLayoutMeasure(this.layout.actual,d==null?void 0:d.actual)}},s.prototype.updateScroll=function(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=r(this.instance))},s.prototype.resetTransform=function(){var a;if(i){var l=this.isLayoutDirty||this.shouldResetTransform,c=this.projectionDelta&&!$R(this.projectionDelta),u=(a=this.options.visualElement)===null||a===void 0?void 0:a.getProps().transformTemplate,d=u==null?void 0:u(this.latestValues,""),f=d!==this.prevTransformTemplateValue;l&&(c||ri(this.latestValues)||f)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}},s.prototype.measure=function(){var a=this.options.visualElement;if(!a)return qt();var l=a.measureViewportBox(),c=this.root.scroll;return c&&(ai(l.x,c.x),ai(l.y,c.y)),l},s.prototype.removeElementScroll=function(a){var l=qt();ur(l,a);for(var c=0;c<this.path.length;c++){var u=this.path[c],d=u.scroll,f=u.options,h=u.isScrollRoot;if(u!==this.root&&d&&f.layoutScroll){if(h){ur(l,a);var p=this.root.scroll;p&&(ai(l.x,-p.x),ai(l.y,-p.y))}ai(l.x,d.x),ai(l.y,d.y)}}return l},s.prototype.applyTransform=function(a,l){l===void 0&&(l=!1);var c=qt();ur(c,a);for(var u=0;u<this.path.length;u++){var d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Sa(c,{x:-d.scroll.x,y:-d.scroll.y}),ri(d.latestValues)&&Sa(c,d.latestValues)}return ri(this.latestValues)&&Sa(c,this.latestValues),c},s.prototype.removeTransform=function(a){var l,c=qt();ur(c,a);for(var u=0;u<this.path.length;u++){var d=this.path[u];if(d.instance&&ri(d.latestValues)){TR(d.latestValues)&&d.updateSnapshot();var f=qt(),h=d.measure();ur(f,h),PC(c,d.latestValues,(l=d.snapshot)===null||l===void 0?void 0:l.layout,f)}}return ri(this.latestValues)&&PC(c,this.latestValues),c},s.prototype.setTargetDelta=function(a){this.targetDelta=a,this.root.scheduleUpdateProjection()},s.prototype.setOptions=function(a){var l;this.options=q(q(q({},this.options),a),{crossfade:(l=a.crossfade)!==null&&l!==void 0?l:!0})},s.prototype.clearMeasurements=function(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1},s.prototype.resolveTargetDelta=function(){var a,l=this.options,c=l.layout,u=l.layoutId;!this.layout||!(c||u)||(!this.targetDelta&&!this.relativeTarget&&(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),Ic(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),ur(this.relativeTarget,this.relativeTargetOrigin))),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=qt(),this.targetWithTransforms=qt()),this.relativeTarget&&this.relativeTargetOrigin&&(!((a=this.relativeParent)===null||a===void 0)&&a.target)?fue(this.target,this.relativeTarget,this.relativeParent.target):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.actual):ur(this.target,this.layout.actual),_R(this.target,this.targetDelta)):ur(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&!!this.relativeParent.resumingFrom==!!this.resumingFrom&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),Ic(this.relativeTargetOrigin,this.target,this.relativeParent.target),ur(this.relativeTarget,this.relativeTargetOrigin)))))},s.prototype.getClosestProjectingParent=function(){if(!(!this.parent||ri(this.parent.latestValues)))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()},s.prototype.calcProjection=function(){var a,l=this.options,c=l.layout,u=l.layoutId;if(this.isTreeAnimating=!!(!((a=this.parent)===null||a===void 0)&&a.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!(!this.layout||!(c||u))){var d=this.getLead();ur(this.layoutCorrected,this.layout.actual),wue(this.layoutCorrected,this.treeScale,this.path,!!this.resumingFrom||this!==d);var f=d.target;if(f){this.projectionDelta||(this.projectionDelta=Nc(),this.projectionDeltaWithTransform=Nc());var h=this.treeScale.x,p=this.treeScale.y,g=this.projectionTransform;Rc(this.projectionDelta,this.layoutCorrected,f,this.latestValues),this.projectionTransform=LC(this.projectionDelta,this.treeScale),(this.projectionTransform!==g||this.treeScale.x!==h||this.treeScale.y!==p)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}}},s.prototype.hide=function(){this.isVisible=!1},s.prototype.show=function(){this.isVisible=!0},s.prototype.scheduleRender=function(a){var l,c,u;a===void 0&&(a=!0),(c=(l=this.options).scheduleRender)===null||c===void 0||c.call(l),a&&((u=this.getStack())===null||u===void 0||u.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)},s.prototype.setAnimationOrigin=function(a,l){var c=this,u;l===void 0&&(l=!1);var d=this.snapshot,f=(d==null?void 0:d.latestValues)||{},h=q({},this.latestValues),p=Nc();this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!l;var g=qt(),m=d==null?void 0:d.isShared,b=(((u=this.getStack())===null||u===void 0?void 0:u.members.length)||0)<=1,y=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(Sde));this.animationProgress=0,this.mixTargetDelta=function(w){var S,C=w/1e3;zC(p.x,a.x,C),zC(p.y,a.y,C),c.setTargetDelta(p),c.relativeTarget&&c.relativeTargetOrigin&&c.layout&&(!((S=c.relativeParent)===null||S===void 0)&&S.layout)&&(Ic(g,c.layout.actual,c.relativeParent.layout.actual),wde(c.relativeTarget,c.relativeTargetOrigin,g,C)),m&&(c.animationValues=h,nde(h,f,c.latestValues,C,y,b)),c.root.scheduleUpdateProjection(),c.scheduleRender(),c.animationProgress=C},this.mixTargetDelta(0)},s.prototype.startAnimation=function(a){var l=this,c,u;this.notifyListeners("animationStart"),(c=this.currentAnimation)===null||c===void 0||c.stop(),this.resumingFrom&&((u=this.resumingFrom.currentAnimation)===null||u===void 0||u.stop()),this.pendingAnimation&&(nl.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xr.update(function(){Tc.hasAnimatedSinceResize=!0,l.currentAnimation=ede(0,jC,q(q({},a),{onUpdate:function(d){var f;l.mixTargetDelta(d),(f=a.onUpdate)===null||f===void 0||f.call(a,d)},onComplete:function(){var d;(d=a.onComplete)===null||d===void 0||d.call(a),l.completeAnimation()}})),l.resumingFrom&&(l.resumingFrom.currentAnimation=l.currentAnimation),l.pendingAnimation=void 0})},s.prototype.completeAnimation=function(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")},s.prototype.finishAnimation=function(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,jC),this.currentAnimation.stop()),this.completeAnimation()},s.prototype.applyTransformsToTarget=function(){var a=this.getLead(),l=a.targetWithTransforms,c=a.target,u=a.layout,d=a.latestValues;!l||!c||!u||(ur(l,c),Sa(l,d),Rc(this.projectionDeltaWithTransform,this.layoutCorrected,l,d))},s.prototype.registerSharedNode=function(a,l){var c,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new lde);var f=this.sharedNodes.get(a);f.add(l),l.promote({transition:(c=l.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(d=(u=l.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,l)})},s.prototype.isLead=function(){var a=this.getStack();return a?a.lead===this:!0},s.prototype.getLead=function(){var a,l=this.options.layoutId;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this},s.prototype.getPrevLead=function(){var a,l=this.options.layoutId;return l?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0},s.prototype.getStack=function(){var a=this.options.layoutId;if(a)return this.root.sharedNodes.get(a)},s.prototype.promote=function(a){var l=a===void 0?{}:a,c=l.needsReset,u=l.transition,d=l.preserveFollowOpacity,f=this.getStack();f&&f.promote(this,d),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})},s.prototype.relegate=function(){var a=this.getStack();return a?a.relegate(this):!1},s.prototype.resetRotation=function(){var a=this.options.visualElement;if(a){for(var l=!1,c={},u=0;u<Av.length;u++){var d=Av[u],f="rotate"+d;a.getStaticValue(f)&&(l=!0,c[f]=a.getStaticValue(f),a.setStaticValue(f,0))}if(l){a==null||a.syncRender();for(var f in c)a.setStaticValue(f,c[f]);a.scheduleRender()}}},s.prototype.getProjectionStyles=function(a){var l,c,u,d,f,h;a===void 0&&(a={});var p={};if(!this.instance||this.isSVG)return p;if(this.isVisible)p.visibility="";else return{visibility:"hidden"};var g=(l=this.options.visualElement)===null||l===void 0?void 0:l.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=rf(a.pointerEvents)||"",p.transform=g?g(this.latestValues,""):"none",p;var m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){var b={};return this.options.layoutId&&(b.opacity=(c=this.latestValues.opacity)!==null&&c!==void 0?c:1,b.pointerEvents=rf(a.pointerEvents)||""),this.hasProjected&&!ri(this.latestValues)&&(b.transform=g?g({},""):"none",this.hasProjected=!1),b}var y=m.animationValues||m.latestValues;this.applyTransformsToTarget(),p.transform=LC(this.projectionDeltaWithTransform,this.treeScale,y),g&&(p.transform=g(y,p.transform));var w=this.projectionDelta,S=w.x,C=w.y;p.transformOrigin="".concat(S.origin*100,"% ").concat(C.origin*100,"% 0"),m.animationValues?p.opacity=m===this?(d=(u=y.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:p.opacity=m===this?(f=y.opacity)!==null&&f!==void 0?f:"":(h=y.opacityExit)!==null&&h!==void 0?h:0;for(var E in nh)if(y[E]!==void 0){var k=nh[E],_=k.correct,T=k.applyTo,D=_(y[E],m);if(T)for(var O=T.length,M=0;M<O;M++)p[T[M]]=D;else p[E]=D}return this.options.layoutId&&(p.pointerEvents=m===this?rf(a.pointerEvents)||"":"none"),p},s.prototype.clearSnapshot=function(){this.resumeFrom=this.snapshot=void 0},s.prototype.resetTree=function(){this.root.nodes.forEach(function(a){var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach($C),this.root.sharedNodes.clear()},s}()}function fde(e){e.updateLayout()}function hde(e){var t,n,r,o,i=(n=(t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)!==null&&n!==void 0?n:e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){var s=e.layout,a=s.actual,l=s.measured;e.options.animationType==="size"?Vr(function(y){var w=i.isShared?i.measured[y]:i.layout[y],S=Oo(w);w.min=a[y].min,w.max=w.min+S}):e.options.animationType==="position"&&Vr(function(y){var w=i.isShared?i.measured[y]:i.layout[y],S=Oo(a[y]);w.max=w.min+S});var c=Nc();Rc(c,a,i.layout);var u=Nc();i.isShared?Rc(u,e.applyTransform(l,!0),i.measured):Rc(u,a,i.layout);var d=!$R(c),f=!1;if(!e.resumeFrom&&(e.relativeParent=e.getClosestProjectingParent(),e.relativeParent&&!e.relativeParent.resumeFrom)){var h=e.relativeParent,p=h.snapshot,g=h.layout;if(p&&g){var m=qt();Ic(m,i.layout,p.layout);var b=qt();Ic(b,a,g.actual),zR(m,b)||(f=!0)}}e.notifyListeners("didUpdate",{layout:a,snapshot:i,delta:u,layoutDelta:c,hasLayoutChanged:d,hasRelativeTargetChanged:f})}else e.isLead()&&((o=(r=e.options).onExitComplete)===null||o===void 0||o.call(r));e.options.transition=void 0}function pde(e){e.clearSnapshot()}function $C(e){e.clearMeasurements()}function gde(e){var t=e.options.visualElement;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notifyBeforeLayoutMeasure(),e.resetTransform()}function mde(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function vde(e){e.resolveTargetDelta()}function yde(e){e.calcProjection()}function bde(e){e.resetRotation()}function xde(e){e.removeLeadSnapshot()}function zC(e,t,n){e.translate=rt(t.translate,0,n),e.scale=rt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function BC(e,t,n,r){e.min=rt(t.min,n.min,r),e.max=rt(t.max,n.max,r)}function wde(e,t,n,r){BC(e.x,t.x,n.x,r),BC(e.y,t.y,n.y,r)}function Sde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Cde={duration:.45,ease:[.4,0,.1,1]};function Ede(e,t){for(var n=e.root,r=e.path.length-1;r>=0;r--)if(e.path[r].instance){n=e.path[r];break}var o=n&&n!==e.root?n.instance:document,i=o.querySelector('[data-projection-id="'.concat(t,'"]'));i&&e.mount(i,!0)}function FC(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function HC(e){FC(e.x),FC(e.y)}var kde=BR({attachResizeListener:function(e,t){return mp(e,"resize",t)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),Xg={current:void 0},Ode=BR({measureScroll:function(e){return{x:e.scrollLeft,y:e.scrollTop}},defaultParent:function(){if(!Xg.current){var e=new kde(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),Xg.current=e}return Xg.current},resetTransform:function(e,t){e.style.transform=t??"none"},checkIsScrollRoot:function(e){return window.getComputedStyle(e).position==="fixed"}}),Tde=q(q(q(q({},cue),Oce),Due),Que),_de=yae(function(e,t){return rle(e,t,Tde,Gue,Ode)});function Jv(e,t,n){var r,o,i,s,a;t==null&&(t=100);function l(){var u=Date.now()-s;u<t&&u>=0?r=setTimeout(l,t-u):(r=null,n||(a=e.apply(i,o),i=o=null))}var c=function(){i=this,o=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(l,t)),u&&(a=e.apply(i,o),i=o=null),a};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(a=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},c}Jv.debounce=Jv;var Mde=Jv;const VC=_o(Mde);function Dde(e){let{debounce:t,scroll:n,polyfill:r,offsetSize:o}=e===void 0?{debounce:0,scroll:!1,offsetSize:!1}:e;const i=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=x.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=x.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),c=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,d=x.useRef(!1);x.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,h,p]=x.useMemo(()=>{const y=()=>{if(!l.current.element)return;const{left:w,top:S,width:C,height:E,bottom:k,right:_,x:T,y:D}=l.current.element.getBoundingClientRect(),O={left:w,top:S,width:C,height:E,bottom:k,right:_,x:T,y:D};l.current.element instanceof HTMLElement&&o&&(O.height=l.current.element.offsetHeight,O.width=l.current.element.offsetWidth),Object.freeze(O),d.current&&!Pde(l.current.lastBounds,O)&&a(l.current.lastBounds=O)};return[y,u?VC(y,u):y,c?VC(y,c):y]},[a,o,c,u]);function g(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",p,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function m(){l.current.element&&(l.current.resizeObserver=new i(p),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach(y=>y.addEventListener("scroll",p,{capture:!0,passive:!0})))}const b=y=>{!y||y===l.current.element||(g(),l.current.element=y,l.current.scrollContainers=FR(y),m())};return Ide(p,!!n),Rde(h),x.useEffect(()=>{g(),m()},[n,p,h]),x.useEffect(()=>g,[]),[b,s,f]}function Rde(e){x.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function Ide(e,t){x.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function FR(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:o}=window.getComputedStyle(e);return[n,r,o].some(i=>i==="auto"||i==="scroll")&&t.push(e),[...t,...FR(e.parentElement)]}const Nde=["x","y","top","bottom","left","right","width","height"],Pde=(e,t)=>Nde.every(n=>e[n]===t[n]);function Jg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ade(e,t,n){Lde(e,t),t.set(e,n)}function Lde(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vd(e,t){var n=HR(e,t,"get");return jde(e,n)}function jde(e,t){return t.get?t.get.call(e):t.value}function $de(e,t,n){var r=HR(e,t,"set");return zde(e,r,n),n}function HR(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function zde(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}var aa=new WeakMap;class Bde{constructor(){Ade(this,aa,{writable:!0,value:void 0}),Jg(this,"register",t=>{vd(this,aa).push(t)}),Jg(this,"unregister",t=>{let n;for(;(n=vd(this,aa).indexOf(t))!==-1;)vd(this,aa).splice(n,1)}),Jg(this,"backendChanged",t=>{for(const n of vd(this,aa))n.backendChanged(t)}),$de(this,aa,[])}}function dr(e,t,n){Fde(e,t),t.set(e,n)}function Fde(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e,t){var n=VR(e,t,"get");return Hde(e,n)}function Hde(e,t){return t.get?t.get.call(e):t.value}function la(e,t,n){var r=VR(e,t,"set");return Vde(e,r,n),n}function VR(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Vde(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}var Un=new WeakMap,yd=new WeakMap,qn=new WeakMap,Xo=new WeakMap,ns=new WeakMap,WC=new WeakMap,UC=new WeakMap,qC=new WeakMap,Zg=new WeakMap,Qg=new WeakMap,bd=new WeakMap;class Pc{constructor(t,n,r){if(dr(this,Un,{writable:!0,value:void 0}),dr(this,yd,{writable:!0,value:void 0}),dr(this,qn,{writable:!0,value:void 0}),dr(this,Xo,{writable:!0,value:void 0}),dr(this,ns,{writable:!0,value:void 0}),dr(this,WC,{writable:!0,value:(o,i,s)=>{var a,l;if(!s.backend)throw new Error("You must specify a 'backend' property in your Backend entry: ".concat(JSON.stringify(s)));const c=s.backend(o,i,s.options);let u=s.id;const d=!s.id&&c&&c.constructor;if(d&&(u=c.constructor.name),u)d&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
275
+ This might be unsupported in the future, please specify 'id' explicitely for every backend.`);else throw new Error("You must specify an 'id' property in your Backend entry: ".concat(JSON.stringify(s),`
276
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`));if(me(this,qn)[u])throw new Error(`You must specify a unique 'id' property in your Backend entry:
277
+ `.concat(JSON.stringify(s)," (conflicts with: ").concat(JSON.stringify(me(this,qn)[u]),")"));return{id:u,instance:c,preview:(a=s.preview)!==null&&a!==void 0?a:!1,transition:s.transition,skipDispatchOnTransition:(l=s.skipDispatchOnTransition)!==null&&l!==void 0?l:!1}}}),Br(this,"setup",()=>{if(!(typeof window>"u")){if(Pc.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");Pc.isSetUp=!0,me(this,UC).call(this,window),me(this,qn)[me(this,Un)].instance.setup()}}),Br(this,"teardown",()=>{typeof window>"u"||(Pc.isSetUp=!1,me(this,qC).call(this,window),me(this,qn)[me(this,Un)].instance.teardown())}),Br(this,"connectDragSource",(o,i,s)=>me(this,bd).call(this,"connectDragSource",o,i,s)),Br(this,"connectDragPreview",(o,i,s)=>me(this,bd).call(this,"connectDragPreview",o,i,s)),Br(this,"connectDropTarget",(o,i,s)=>me(this,bd).call(this,"connectDropTarget",o,i,s)),Br(this,"profile",()=>me(this,qn)[me(this,Un)].instance.profile()),Br(this,"previewEnabled",()=>me(this,qn)[me(this,Un)].preview),Br(this,"previewsList",()=>me(this,yd)),Br(this,"backendsList",()=>me(this,Xo)),dr(this,UC,{writable:!0,value:o=>{me(this,Xo).forEach(i=>{i.transition&&o.addEventListener(i.transition.event,me(this,Zg))})}}),dr(this,qC,{writable:!0,value:o=>{me(this,Xo).forEach(i=>{i.transition&&o.removeEventListener(i.transition.event,me(this,Zg))})}}),dr(this,Zg,{writable:!0,value:o=>{const i=me(this,Un);if(me(this,Xo).some(a=>a.id!==me(this,Un)&&a.transition&&a.transition.check(o)?(la(this,Un,a.id),!0):!1),me(this,Un)!==i){var s;me(this,qn)[i].instance.teardown(),Object.keys(me(this,ns)).forEach(u=>{const d=me(this,ns)[u];d.unsubscribe(),d.unsubscribe=me(this,Qg).call(this,d.func,...d.args)}),me(this,yd).backendChanged(this);const a=me(this,qn)[me(this,Un)];if(a.instance.setup(),a.skipDispatchOnTransition)return;const l=o.constructor,c=new l(o.type,o);(s=o.target)===null||s===void 0||s.dispatchEvent(c)}}}),dr(this,Qg,{writable:!0,value:(o,i,s,a)=>me(this,qn)[me(this,Un)].instance[o](i,s,a)}),dr(this,bd,{writable:!0,value:(o,i,s,a)=>{const l="".concat(o,"_").concat(i),c=me(this,Qg).call(this,o,i,s,a);return me(this,ns)[l]={func:o,args:[i,s,a],unsubscribe:c},()=>{me(this,ns)[l].unsubscribe(),delete me(this,ns)[l]}}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
278
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);la(this,yd,new Bde),la(this,qn,{}),la(this,Xo,[]),r.backends.forEach(o=>{const i=me(this,WC).call(this,t,n,o);me(this,qn)[i.id]=i,me(this,Xo).push(i)}),la(this,Un,me(this,Xo)[0].id),la(this,ns,{})}}Br(Pc,"isSetUp",!1);var Ac;(function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"})(Ac||(Ac={}));Ac.mouse+"",Ac.touch+"",Ac.keyboard+"";var or=function(){return or=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},or.apply(this,arguments)};function an(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Wde(e){var t=e.isVisible,n=e.ease,r=n===void 0?"easeIn":n,o=e.duration,i=e.variants,s=i===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:i,a=e.children,l=Dde({polyfill:Jse}),c=l[0],u=l[1].height,d=x.useState(t),f=d[0],h=d[1],p=x.useState(t),g=p[0],m=p[1],b=x.useState(!1),y=b[0],w=b[1],S=function(){w(!1),t||h(!1)};return x.useEffect(function(){w(!0),t?h(!0):m(!1)},[t]),x.useEffect(function(){f&&m(!0)},[u]),U.createElement(_de.div,{style:y?{overflow:"hidden"}:void 0,onAnimationComplete:S,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:s,transition:{ease:r,duration:Ude(u,o)}},U.createElement("div",{ref:c},f&&a))}function Ude(e,t){if(t)return t;if(!e)return 0;var n=e/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var qde=function(e,t){return e.text>t.text?1:e.text<t.text?-1:0},Hl=function(e,t){return e.find(function(n){return n.id===t})},WR=function(e,t,n){if(n===0)return!1;var r=e.find(function(o){return o.id===n});return r===void 0?!1:r.parent===t?!0:WR(e,t,r.parent)},nb=function(e){return e.id!==void 0&&e.parent!==void 0&&e.text!==void 0},Hi=function(e,t,n){var r=n.tree,o=n.rootId,i=n.canDrop;if(e===null){if(t===o)return!0;var s=r.find(function(u){return u.id===t});return!!(s&&s.droppable)}else{var a=nb(e)?e.id:null;if(i){var l=i(a,t);if(l!==void 0)return l}if(a===t)return!1;var c=r.find(function(d){return d.id===a}),s=r.find(function(d){return d.id===t});return c===void 0||a===null?t===o||!!(s!=null&&s.droppable):s===void 0?c.parent!==0:c.parent===t||!s.droppable?!1:!WR(r,a,t)}},Kde=function(e,t,n){return e.map(function(r){return r.id===t?or(or({},r),{parent:n}):r})},UR=function(e,t,n){if(n===0)return 0;var r=e.filter(function(o){return o.parent===t});return r[n]?e.findIndex(function(o){return o.id===r[n].id}):e.findIndex(function(o){return o.id===r[n-1].id})+1},Gde=function(e,t){return e.findIndex(function(n){return n.id===t})},qR=function(e,t,n,r){var o=Gde(e,t),i=UR(e,n,r);return i=i>o?i-1:i,[o,i]},Yde=function(e,t,n){var r=t<0?e.length+t:t;if(r>=0&&r<e.length){var o=n<0?e.length+n:n,i=e.splice(t,1)[0];e.splice(o,0,i)}},Xde=function(e,t,n,r){var o=qR(e,t,n,r),i=o[0],s=o[1],a=an([],e,!0);return Yde(a,i,s),a.map(function(l){return l.id===t?or(or({},l),{parent:n}):l})},Jde=function(e,t){var n=e.getBoundingClientRect(),r=n.top+n.height/2;return t>r?"down":"up"},Zv=function(e,t){var n="",r=0;return e.forEach(function(o,i){var s,a=Jde(o,((s=t.getClientOffset())===null||s===void 0?void 0:s.y)||0);n===""?n=a:n!==a&&(n=a,r=i),i===e.length-1&&a==="down"&&(r=i+1)}),r},KC=function(e,t,n){var r=t.closest('[role="list"]'),o=r==null?void 0:r.querySelectorAll(':scope > [role="listitem"]');return o?Zv(o,n):null},Zde=function(e,t,n){var r=e.getBoundingClientRect(),o=n.dropTargetOffset,i=r.top+o,s=r.bottom-o;return t>s?"lower":t<i?"upper":"middle"},Qv=function(e,t,n,r){var o;if(!t)return null;if(e===null){var i=t.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Zv(i,n)}}var s=n.getItem(),a=t.querySelector('[role="list"]'),l=Zde(t,((o=n.getClientOffset())===null||o===void 0?void 0:o.y)||0,r);if(a){if(l==="upper")if(Hi(s,e.parent,r)){var c=KC(e,t,n);return c===null?null:{id:e.parent,index:c}}else return{id:e.id,index:0};var i=a.querySelectorAll(':scope > [role="listitem"]');return{id:e.id,index:Zv(i,n)}}else{if(l==="middle")return{id:e.id,index:0};if(Hi(s,e.parent,r)){var c=KC(e,t,n);return c===null?null:{id:e.parent,index:c}}return null}},af=function(e,t){return e.some(function(n){return n.parent===t})},KR=x.createContext({}),Qde=function(e){var t=lfe(e.tree,e.initialOpen),n=t[0],r=t[1],o=r.handleToggle,i=r.handleCloseAll,s=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;x.useImperativeHandle(e.treeRef,function(){return{open:function(h){return a(h,e.onChangeOpen)},close:function(h){return l(h,e.onChangeOpen)},openAll:function(){return s(e.onChangeOpen)},closeAll:function(){return i(e.onChangeOpen)}}});var c=Io().getMonitor(),u=e.canDrop,d=e.canDrag,f=or(or({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},e),{openIds:n,onDrop:function(h,p,g){if(h){var m={dragSourceId:h.id,dropTargetId:p,dragSource:h,dropTarget:Hl(e.tree,p),monitor:c},b=e.tree;if(Hl(b,h.id)||(b=an(an([],b,!0),[h],!1)),e.sort===!1){var y=qR(b,h.id,p,g),w=y[1];m.destinationIndex=w,m.relativeIndex=g,e.onDrop(Xde(b,h.id,p,g),m);return}e.onDrop(Kde(b,h.id,p),m)}else{var m={dropTargetId:p,dropTarget:Hl(e.tree,p),monitor:c};e.sort===!1&&(m.destinationIndex=UR(e.tree,p,g),m.relativeIndex=g),e.onDrop(e.tree,m)}},canDrop:u?function(h,p){return u(e.tree,{dragSourceId:h??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:Hl(e.tree,p),monitor:c})}:void 0,canDrag:d?function(h){return d(Hl(e.tree,h))}:void 0,onToggle:function(h){return o(h,e.onChangeOpen)}});return U.createElement(KR.Provider,{value:f},e.children)},GR=x.createContext({}),efe={isLock:!1},tfe=function(e){var t=x.useState(efe.isLock),n=t[0],r=t[1];return U.createElement(GR.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},e.children)},$u=x.createContext({}),xd={dropTargetId:void 0,index:void 0},nfe=function(e){var t=x.useState(xd.dropTargetId),n=t[0],r=t[1],o=x.useState(xd.index),i=o[0],s=o[1],a=function(c,u){r(c),s(u)},l=function(){r(xd.dropTargetId),s(xd.index)};return U.createElement($u.Provider,{value:{dropTargetId:n,index:i,showPlaceholder:a,hidePlaceholder:l}},e.children)},rfe=function(e){return U.createElement(Qde,or({},e),U.createElement(tfe,null,U.createElement(nfe,null,e.children)))},ofe=function(e){var t=x.useContext(GR);x.useEffect(function(){if(e.current){var n=e.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&t.lock()},o=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&t.unlock()},i=function(u){return r(u)},s=function(u){return o(u)},a=function(u){return r(u)},l=function(u){return o(u)},c=new MutationObserver(function(){document.activeElement===document.body&&t.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",i),n.addEventListener("mouseout",s),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",i),n.removeEventListener("mouseout",s),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[e,t]),x.useEffect(function(){var n;(n=e.current)===null||n===void 0||n.setAttribute("draggable",t.isLock?"false":"true")},[e,t.isLock])},xp={TREE_ITEM:Symbol()},YR=null,XR=function(e){var t=e.target;if(t instanceof HTMLElement){var n=t.closest('[role="listitem"]');e.currentTarget===n&&(YR=n)}},GC=function(e){return XR(e)},YC=function(e){return XR(e)},ife=function(e,t){var n=Ki();x.useEffect(function(){var a=t.current;return a==null||a.addEventListener("dragstart",GC),a==null||a.addEventListener("touchstart",YC,{passive:!0}),function(){a==null||a.removeEventListener("dragstart",GC),a==null||a.removeEventListener("touchstart",YC)}},[t]);var r=wse({type:xp.TREE_ITEM,item:function(a){var l=or({ref:t},e);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return YR!==t.current?!1:a?a(e.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),o=r[0].isDragging,i=r[1],s=r[2];return[o,i,s]},sfe=function(e){var t=Ki(),n=x.useContext($u),r=aD({accept:an([xp.TREE_ITEM],t.extraAcceptTypes,!0),drop:function(l,c){var u=t.rootId,d=t.onDrop,f=n.dropTargetId,h=n.index;c.isOver({shallow:!0})&&f!==void 0&&h!==void 0&&d(nb(l)?l:null,u,h),n.hidePlaceholder()},canDrop:function(l,c){var u=t.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Hi(l,u,t):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=t.rootId,d=n.dropTargetId,f=n.index,h=n.showPlaceholder,p=n.hidePlaceholder,g=Qv(null,e.current,c,t);if(g===null||!Hi(l,u,t)){p();return}(g.id!==d||g.index!==f)&&h(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),o=r[0],i=o.isOver,s=o.dragSource,a=r[1];return[i,s,a]},afe=function(e,t){var n=Ki(),r=x.useContext($u),o=aD({accept:an([xp.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,f=r.index;u.isOver({shallow:!0})&&d!==void 0&&f!==void 0&&n.onDrop(nb(c)?c:null,d,f),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=Qv(e,t.current,u,n);return d===null?!1:Hi(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,f=r.index,h=r.showPlaceholder,p=r.hidePlaceholder,g=Qv(e,t.current,u,n);if(g===null||!Hi(c,g.id,n)){p();return}(g.id!==d||g.index!==f)&&h(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),i=o[0],s=i.isOver,a=i.dragSource,l=o[1];return[s,a,l]},lfe=function(e,t){var n=x.useMemo(function(){return t===!0?e.filter(function(d){return af(e,d.id)}).map(function(d){return d.id}):Array.isArray(t)?t:[]},[t]),r=x.useState(n),o=r[0],i=r[1];x.useEffect(function(){return i(n)},[t]);var s=function(d,f){var h=o.includes(d)?o.filter(function(p){return p!==d}):an(an([],o,!0),[d],!1);i(h),f&&f(h)},a=function(d){i([]),d&&d([])},l=function(d){var f=e.filter(function(h){return af(e,h.id)}).map(function(h){return h.id});i(f),d&&d(f)},c=function(d,f){var h=[];if(Array.isArray(d)){var p=e.filter(function(g){return d.includes(g.id)&&af(e,g.id)});h=an(an([],o,!0),p.map(function(g){return g.id}),!0).filter(function(g,m,b){return b.indexOf(g)===m})}else h=o.includes(d)?o:an(an([],o,!0),[d],!1);i(h),f&&f(h)},u=function(d,f){var h=o.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});i(h),f&&f(h)};return[o,{handleToggle:s,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},cfe=function(){return Sse(function(e){var t=e.getItemType();return{item:e.getItem(),clientOffset:e.getClientOffset(),isDragging:e.isDragging()&&t===xp.TREE_ITEM}})},Ki=function(){var e=x.useContext(KR);if(!e)throw new Error("useTreeContext must be used under TreeProvider");return e},ufe=function(e,t){var n=Ki(),r=n.rootId,o=n.rootProps,i=n.classes,s=(i==null?void 0:i.container)||"";return t&&(i!=null&&i.dropTarget)&&(s="".concat(s," ").concat(i.dropTarget)),e===r&&(i!=null&&i.root)&&(s="".concat(s," ").concat(i.root)),e===r&&(o!=null&&o.className)&&(s="".concat(s," ").concat(o.className)),s=s.trim(),s},dfe=function(e,t,n){t.current?n(t):n(e),x.useEffect(function(){t.current?n(t):n(e)},[t.current])},ffe=function(e){var t=Ki(),n=x.useContext($u),r=x.useRef(null),o=x.useRef(null),i=t.tree.find(function(_){return _.id===e.id}),s=t.openIds,a=t.classes,l=t.enableAnimateExpand,c=s.includes(e.id),u=ife(i,r),d=u[0],f=u[1],h=u[2],p=afe(i,r),g=p[0],m=p[1],b=p[2];dfe(r,o,f),Hi(m,e.id,t)&&b(r),x.useEffect(function(){t.dragPreviewRender?h(Dse(),{captureDraggingState:!0}):o.current&&h(r)},[h,t.dragPreviewRender]),ofe(r);var y=function(){return t.onToggle(i.id)},w=t.listItemComponent,S=(a==null?void 0:a.listItem)||"";g&&(a!=null&&a.dropTarget)&&(S="".concat(S," ").concat(a.dropTarget)),d&&(a!=null&&a.draggingSource)&&(S="".concat(S," ").concat(a.draggingSource));var C=t.canDrag?t.canDrag(e.id):!0,E=n.dropTargetId===e.id,k={depth:e.depth,isOpen:c,isDragging:d,isDropTarget:E,draggable:C,hasChild:af(t.tree,e.id),containerRef:r,handleRef:o,onToggle:y};return U.createElement(w,{ref:r,className:S,role:"listitem"},t.render(i,k),l&&k.hasChild&&U.createElement(Wde,{isVisible:c},U.createElement(e0,{parentId:e.id,depth:e.depth+1})),!l&&k.hasChild&&c&&U.createElement(e0,{parentId:e.id,depth:e.depth+1}))},XC=function(e){var t=Ki(),n=t.placeholderRender,r=t.placeholderComponent,o=t.classes,i=x.useContext($u),s=Io(),a=s.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=e.dropTargetId===i.dropTargetId&&(e.index===i.index||e.index===void 0&&e.listCount===i.index);return c?U.createElement(r,{className:(o==null?void 0:o.placeholder)||""},n(l,{depth:e.depth})):null},e0=function(e){var t=Ki(),n=x.useRef(null),r=t.tree.filter(function(g){return g.parent===e.parentId}),o=r,i=typeof t.sort=="function"?t.sort:qde;if(t.insertDroppableFirst){var s=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});t.sort===!1?o=an(an([],s,!0),a,!0):(s=s.sort(i),a=a.sort(i),o=an(an([],s,!0),a,!0))}else t.sort!==!1&&(o=r.sort(i));var l=sfe(n),c=l[0],u=l[1],d=l[2];e.parentId===t.rootId&&Hi(u,t.rootId,t)&&d(n);var f=ufe(e.parentId,c),h=t.rootProps||{},p=t.listComponent;return U.createElement(p,or({ref:n,role:"list"},h,{className:f}),o.map(function(g,m){return U.createElement(U.Fragment,{key:g.id},U.createElement(XC,{depth:e.depth,listCount:o.length,dropTargetId:e.parentId,index:m}),U.createElement(ffe,{id:g.id,depth:e.depth}))}),U.createElement(XC,{depth:e.depth,listCount:o.length,dropTargetId:e.parentId}))},hfe={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},pfe=function(e){var t=e.clientOffset;if(!t)return{};var n=t.x,r=t.y,o="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:o}},gfe=function(){var e=Ki(),t=cfe(),n=t.isDragging,r=t.clientOffset;return!n||!r?null:U.createElement("div",{style:hfe},U.createElement("div",{style:pfe(t)},e.dragPreviewRender&&e.dragPreviewRender(t)))};function mfe(e,t){return U.createElement(rfe,or({},e,{treeRef:t}),e.dragPreviewRender&&U.createElement(gfe,null),U.createElement(e0,{parentId:e.rootId,depth:0}))}x.forwardRef(mfe);x.createContext(null);const Vhe=2,Whe=5,Uhe=1,qhe="round",Khe="transparent",Ghe="rgba(0, 0, 0, 0.1)",Yhe="dblclick",Xhe={TRANSLATIONS:"translations",LANGUAGE_KEY:"languageKey"},Jhe=1e-4,Zhe=1e7,vfe=()=>{const e=x.useContext(uI);if(e===void 0)throw new Error("useLegend must be used within a LegendProvider");return e},yfe=({chartRef:e,options:t})=>{const{state:n,dispatch:r}=vfe()??{},{annotations:o,interactions:{onLegendClick:i},legend:{customLegend:s}}=t??{},a=x.useCallback((u,d)=>{var b;const{datasetIndex:f=-1}=d??{};let h=null;const p=e==null?void 0:e.current,g=((b=p==null?void 0:p.data)==null?void 0:b.datasets)??[],m=(g==null?void 0:g[f])??{};if(o!=null&&o.controlAnnotation&&(m!=null&&m.isAnnotation)&&(h=(m==null?void 0:m.annotationIndex)??null),i){const y=(d==null?void 0:d.hidden)??!1;i(d==null?void 0:d.text,y)}r({type:dI,payload:{chartInstance:p,dsConfig:{datasetIndex:f,datasets:g,dataset:m},annotationConfig:{annotationIndex:h}}}),p==null||p.update()},[e,o,r]),l=x.useMemo(()=>fI(t,a),[t,a]),c=x.useMemo(()=>({[hI]:(s==null?void 0:s.customLegendPlugin)&&{containerID:s==null?void 0:s.customLegendContainerID}}),[s]);return{legendClick:a,annotation:n==null?void 0:n.annotation,legend:l,customLegendPlugin:c}},Qhe=(e=[])=>{let t={};return e.length&&(t=e.reduce((n,r,o)=>(n[`annotation${o+1}`]=r,n),{})),{annotations:t}};var bfe=function(){},JR=typeof window<"u",xfe=JR?x.useLayoutEffect:x.useEffect,ZR={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function wfe(){var e=x.useState(null),t=e[0],n=e[1],r=x.useState(ZR),o=r[0],i=r[1],s=x.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var l=a[0].contentRect,c=l.x,u=l.y,d=l.width,f=l.height,h=l.top,p=l.left,g=l.bottom,m=l.right;i({x:c,y:u,width:d,height:f,top:h,left:p,bottom:g,right:m})}})},[]);return xfe(function(){if(t)return s.observe(t),function(){s.disconnect()}},[t]),[n,o]}const Sfe=JR&&typeof window.ResizeObserver<"u"?wfe:function(){return[bfe,ZR]};var QR={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},JC=U.createContext&&U.createContext(QR),_i=function(){return _i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},_i.apply(this,arguments)},Cfe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function eI(e){return e&&e.map(function(t,n){return U.createElement(t.tag,_i({key:n},t.attr),eI(t.child))})}function No(e){return function(t){return U.createElement(Efe,_i({attr:_i({},e.attr)},t),eI(e.child))}}function Efe(e){var t=function(n){var r=e.attr,o=e.size,i=e.title,s=Cfe(e,["attr","size","title"]),a=o||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),U.createElement("svg",_i({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:_i(_i({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&U.createElement("title",null,i),e.children)};return JC!==void 0?U.createElement(JC.Consumer,null,function(n){return t(n)}):t(QR)}function epe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M18 9l3 3l-3 3"}},{tag:"path",attr:{d:"M15 12h6"}},{tag:"path",attr:{d:"M6 9l-3 3l3 3"}},{tag:"path",attr:{d:"M3 12h6"}},{tag:"path",attr:{d:"M9 18l3 3l3 -3"}},{tag:"path",attr:{d:"M12 15v6"}},{tag:"path",attr:{d:"M15 6l-3 -3l-3 3"}},{tag:"path",attr:{d:"M12 3v6"}}]})(e)}function tpe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}},{tag:"path",attr:{d:"M5.7 5.7l12.6 12.6"}}]})(e)}function kfe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",strokeWidth:"0",fill:"currentColor"}}]})(e)}function npe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}},{tag:"path",attr:{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}},{tag:"path",attr:{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}},{tag:"path",attr:{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"}}]})(e)}function Ofe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 6l11 0"}},{tag:"path",attr:{d:"M9 12l11 0"}},{tag:"path",attr:{d:"M9 18l11 0"}},{tag:"path",attr:{d:"M5 6l0 .01"}},{tag:"path",attr:{d:"M5 12l0 .01"}},{tag:"path",attr:{d:"M5 18l0 .01"}}]})(e)}function rpe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M5 4h14a1 1 0 0 1 1 1v5a1 1 0 0 1 -1 1h-7a1 1 0 0 0 -1 1v7a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1v-14a1 1 0 0 1 1 -1"}},{tag:"path",attr:{d:"M4 8l2 0"}},{tag:"path",attr:{d:"M4 12l3 0"}},{tag:"path",attr:{d:"M4 16l2 0"}},{tag:"path",attr:{d:"M8 4l0 2"}},{tag:"path",attr:{d:"M12 4l0 3"}},{tag:"path",attr:{d:"M16 4l0 2"}}]})(e)}function Tfe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"}}]})(e)}function _fe(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M18 6l-12 12"}},{tag:"path",attr:{d:"M6 6l12 12"}}]})(e)}function ope(e){return No({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}},{tag:"path",attr:{d:"M7 10l6 0"}},{tag:"path",attr:{d:"M10 7l0 6"}},{tag:"path",attr:{d:"M21 21l-6 -6"}}]})(e)}const Mfe="_legend_wpro0_1",Dfe="_isDragging_wpro0_8",Rfe="_legendItems_wpro0_11",Ife="_isHidden_wpro0_47",Nfe="_legendToggle_wpro0_50",Pfe="_legendItem_wpro0_11",Afe="_legendItemSymbol_wpro0_80",Lfe="_legendItemBox_wpro0_90",jfe="_legendItemLine_wpro0_95",$fe="_legendItemPoint_wpro0_103",zfe="_legendItemText_wpro0_110",Bfe="_dropzoneContainer_wpro0_140",Ffe="_dropzone_wpro0_140",Hfe="_left_wpro0_149",Vfe="_right_wpro0_153",Wfe="_top_wpro0_157",Ufe="_bottom_wpro0_161",qfe="_dropzonePlaceholder_wpro0_165",Kfe="_isActive_wpro0_173",Gfe="_resizeContainer_wpro0_176",$e={legend:Mfe,isDragging:Dfe,legendItems:Rfe,isHidden:Ife,legendToggle:Nfe,legendItem:Pfe,legendItemSymbol:Afe,legendItemBox:Lfe,legendItemLine:jfe,legendItemPoint:$fe,legendItemText:zfe,dropzoneContainer:Bfe,dropzone:Ffe,left:Hfe,right:Vfe,top:Wfe,bottom:Ufe,dropzonePlaceholder:qfe,isActive:Kfe,resizeContainer:Gfe},t0=e=>x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e},x.createElement("circle",{cx:12,cy:12,r:12,fill:"currentColor"}));var mc=(e=>(e.LINE="line",e.BAR="bar",e.PIE="pie",e.SCATTER="scatter",e))(mc||{}),Yfe=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Yfe||{});const Xfe=e=>x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e},x.createElement("rect",{x:2,y:2,width:20,height:20,fill:"currentColor"})),Jfe=e=>x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e},x.createElement("rect",{x:3,y:3,width:18,height:18,fill:"currentColor",transform:"rotate(45 12 12)"})),Zfe=e=>x.createElement("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},x.createElement("path",{d:"m22.7998 22.0623h-21.5996c-.21066.0001-.417617-.0554-.600067-.1607-.182451-.1053-.333965-.2567-.439311-.4392-.1053464-.1824-.16081228-.3893-.160822-.6s.0554372-.4176.160767-.6l10.799833-18.70518c.1139-.17137.2684-.31191.4497-.40913.1814-.09722.3839-.14809.5897-.14809s.4083.05087.5897.14809c.1813.09722.3358.23776.4497.40913l10.7998 18.70518c.1054.1824.1608.3893.1608.6s-.0555.4176-.1608.6c-.1054.1825-.2569.3339-.4393.4392-.1825.1053-.3894.1608-.6001.1607z",fill:"currentColor"})),em=16,ZC=({dataset:e})=>{var l;const{borderColor:t,borderDash:n,borderWidth:r}=e??{},[o,i]=n??[],s=o&&i?(em-o)/2%(o+i)*-1:0,a=((l=e==null?void 0:e.borderDash)==null?void 0:l.join(" "))||"";return v.jsx("span",{className:$e.legendItemLine,children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${em} ${em}`,width:"100%",height:"100%",children:v.jsx("line",{x1:"0",y1:"50%",x2:"100%",y2:"50%",stroke:t,strokeWidth:r,strokeDasharray:a,strokeDashoffset:s})})})},Qfe=({dataset:e})=>{const{pointBackgroundColor:t,pointRadius:n,pointStyle:r=""}=e??{};if(!n)return null;const o=n*2,i={circle:v.jsx(t0,{}),triangle:v.jsx(Zfe,{}),rectRot:v.jsx(Jfe,{}),rect:v.jsx(Xfe,{})};return v.jsx("span",{className:$e.legendItemPoint,children:v.jsx(Ae,{icon:(i==null?void 0:i[r])??v.jsx(t0,{}),size:o,color:t})})},ehe=({dataset:e})=>{const{backgroundColor:t}=e??{},n={backgroundColor:t};return v.jsx("span",{className:$e.legendItemBox,style:n})},n0=({dataset:e})=>{const{annotationType:t,showLine:n}=e??{};switch(t){case kp.Box:case kp.Ellipse:return v.jsx(ehe,{dataset:e});case kp.Line:return v.jsx(ZC,{dataset:e});default:return v.jsxs(v.Fragment,{children:[n&&v.jsx(ZC,{dataset:e}),v.jsx(Qfe,{dataset:e})]})}};try{n0.displayName="LegendItemLine",n0.__docgenInfo={description:"",displayName:"LegendItemLine",props:{}}}catch{}const the=16,nhe=(e,t,n)=>{switch(t){case mc.LINE:return v.jsx(n0,{dataset:e});case mc.BAR:{const{backgroundColor:r}=e??{},o=r instanceof Array?r==null?void 0:r[n]:r;return v.jsx("span",{className:$e.legendItemBox,children:v.jsx(Tfe,{color:o})})}case mc.PIE:return v.jsx("span",{className:$e.legendItemPoint,children:v.jsx(Ae,{icon:v.jsx(t0,{})})});case mc.SCATTER:{const{backgroundColor:r,borderColor:o}=e??{},i=r instanceof Array?r==null?void 0:r[n]:r;return v.jsx("span",{className:$e.legendItemPoint,children:v.jsx(kfe,{color:i??o})})}default:return null}},rhe=({hidden:e,dataset:t,handleClick:n,chartType:r,index:o})=>v.jsxs("div",{className:i0($e==null?void 0:$e.legendItem,e&&($e==null?void 0:$e.isHidden)),onClick:n,children:[v.jsx("span",{className:$e.legendItemSymbol,style:{width:the},children:nhe(t,r,o)}),v.jsx("span",{className:$e.legendItemText,children:t==null?void 0:t.label})]});try{legenditem.displayName="legenditem",legenditem.__docgenInfo={description:"",displayName:"legenditem",props:{hidden:{defaultValue:null,description:"",name:"hidden",required:!0,type:{name:"boolean"}},dataset:{defaultValue:null,description:"",name:"dataset",required:!0,type:{name:"TLegendDataset"}},handleClick:{defaultValue:null,description:"",name:"handleClick",required:!0,type:{name:"MouseEventHandler<HTMLDivElement>"}},chartType:{defaultValue:null,description:"",name:"chartType",required:!0,type:{name:"enum",value:[{value:'"line"'},{value:'"bar"'},{value:'"pie"'},{value:'"scatter"'}]}},index:{defaultValue:null,description:"",name:"index",required:!0,type:{name:"number"}}}}}catch{}const ohe=e=>{const t=We.get(e,"options.plugins.annotation.annotations",null);return!t||!Object.keys(t).length?[]:Object.values(t)},ihe=e=>{var t,n,r,o,i;return We.cloneDeep((i=(o=(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.plugins)==null?void 0:n.legend)==null?void 0:r.labels)==null?void 0:o.generateLabels)==null?void 0:i.call(o,e))??[]},she=e=>{const t=ihe(e),n=ohe(e);return We.map(t,r=>{const o=We.find(n,i=>{var s;return r.text===((s=i==null?void 0:i.label)==null?void 0:s.content)});return o?{...r,hidden:!(o!=null&&o.display)}:r})},ahe=(e,t)=>{const[n,r]=x.useState([]);return x.useEffect(()=>{const o=e==null?void 0:e.current;if(!o)return;const i=she(o);r(i)},[t,e]),n},lf=4,lhe=(e,t)=>{const{height:n=0,width:r=0,chartArea:o}=t??{},{top:i=0,left:s=0,bottom:a=0,right:l=0}=o??{};return{left:e!=null&&e.includes("left")?s:void 0,right:e!=null&&e.includes("right")?r-l:void 0,top:e!=null&&e.includes("top")?i:void 0,bottom:e!=null&&e.includes("bottom")?n-a:void 0,maxHeight:.5*(a-i-lf*2),maxWidth:.9*(l-s-lf*2),margin:lf}},che=({items:e,datasets:t,legendClick:n,chartType:r})=>v.jsx("div",{className:$e.legendItems,children:e==null?void 0:e.map((o,i)=>{var s;return(s=t==null?void 0:t[o==null?void 0:o.datasetIndex])!=null&&s.hideLegend?null:v.jsx(rhe,{index:i,hidden:o==null?void 0:o.hidden,dataset:t==null?void 0:t[o==null?void 0:o.datasetIndex],handleClick:a=>n(a,o),chartType:r},`${o==null?void 0:o.datasetIndex}-hidden-${o==null?void 0:o.hidden}`)})}),uhe=x.forwardRef(({legendPosition:e,chartRef:t,isDragging:n,legendConfig:r},o)=>{var m;const i=t==null?void 0:t.current,{options:s,generatedDatasets:a,chartType:l}=r??{},c=(m=i==null?void 0:i.data)==null?void 0:m.datasets,{legend:u,legendClick:d}=yfe({chartRef:t,options:s}),[f,h]=x.useState((u==null?void 0:u.display)??!0),p=ahe(t,a),g=lhe(e,i);return v.jsxs("div",{ref:o,className:i0($e.legend,!f&&$e.isHidden,n&&$e.isDragging),style:g,children:[v.jsx("div",{className:$e.legendToggle,children:v.jsx(ln,{onClick:()=>h(!f),small:!0,round:!0,icon:f?v.jsx(_fe,{}):v.jsx(Ofe,{})})}),v.jsx(che,{items:p,datasets:c,legendClick:d,chartType:l})]})});try{legendpanel.displayName="legendpanel",legendpanel.__docgenInfo={description:"",displayName:"legendpanel",props:{legendPosition:{defaultValue:null,description:"",name:"legendPosition",required:!0,type:{name:"enum",value:[{value:'"bottom"'},{value:'"top"'},{value:'"left"'},{value:'"right"'},{value:'"top-right"'},{value:'"top-left"'},{value:'"bottom-left"'},{value:'"bottom-right"'}]}},isDragging:{defaultValue:null,description:"",name:"isDragging",required:!0,type:{name:"boolean"}},chartRef:{defaultValue:null,description:"",name:"chartRef",required:!0,type:{name:"RefObject<Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | null)[], unknown>>"}},legendConfig:{defaultValue:null,description:"",name:"legendConfig",required:!0,type:{name:"ILegendConfig"}}}}}catch{}const dhe=e=>{const{position:t="",onDrop:n=We.noop,placeholderSize:r={}}=e??{},[{isOver:o,canDrop:i},s]=UA(()=>({accept:"legend",drop:n,collect:l=>({isOver:l==null?void 0:l.isOver(),canDrop:l==null?void 0:l.canDrop()})})),a=o&&i;return v.jsx("div",{ref:s,className:i0($e.dropzone,a&&$e.isActive,(t==null?void 0:t.includes("left"))&&$e.left,(t==null?void 0:t.includes("right"))&&$e.right,(t==null?void 0:t.includes("top"))&&$e.top,(t==null?void 0:t.includes("bottom"))&&$e.bottom),children:v.jsx("div",{className:$e.dropzonePlaceholder,style:{...r,margin:lf}})})},fhe=e=>{const{chartArea:t,setLegendPosition:n,isDragging:r,placeholderSize:o}=e??{},i=[Vl.TopLeft,Vl.TopRight,Vl.BottomLeft,Vl.BottomRight],{top:s,left:a,width:l,height:c}=t??{};return v.jsx("div",{className:$e.dropzoneContainer,style:{top:s,left:a,width:l,height:c,zIndex:r?0:-1},children:i==null?void 0:i.map(u=>v.jsx(dhe,{position:u,onDrop:()=>n(u),placeholderSize:o},u))})};try{legenddropzone.displayName="legenddropzone",legenddropzone.__docgenInfo={description:"",displayName:"legenddropzone",props:{chartArea:{defaultValue:null,description:"",name:"chartArea",required:!1,type:{name:"ChartArea"}},setLegendPosition:{defaultValue:null,description:"",name:"setLegendPosition",required:!0,type:{name:"(position: Position) => void"}},isDragging:{defaultValue:null,description:"",name:"isDragging",required:!0,type:{name:"boolean"}},placeholderSize:{defaultValue:null,description:"",name:"placeholderSize",required:!1,type:{name:"{ width?: number; height?: number; } | undefined"}}}}}catch{}const ipe=({chartRef:e,legendConfig:t})=>{const n=e==null?void 0:e.current,[r,o]=x.useState(n==null?void 0:n.chartArea),{options:{legend:i}}=t??{},[s,a]=Sfe(),l=s,c=x.useRef(null),[u,d]=x.useState((i==null?void 0:i.position)||Vl.BottomLeft),f=c!=null&&c.current?c.current.getBoundingClientRect():null,h={width:f==null?void 0:f.width,height:f==null?void 0:f.height},[{isDragging:p=!1},g=We.noop]=jA(()=>({type:"legend",collect:m=>({isDragging:m.isDragging()})}));return x.useEffect(()=>{const m=setTimeout(()=>{o(n==null?void 0:n.chartArea)},20);return()=>clearTimeout(m)},[a]),v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:l,className:$e.resizeContainer}),v.jsx(uhe,{chartRef:e,legendPosition:u,isDragging:p,ref:m=>{g(m),c.current=m},legendConfig:t}),v.jsx(fhe,{chartArea:r,setLegendPosition:m=>d(m),isDragging:p,placeholderSize:h},a.width)]})};try{legend.displayName="legend",legend.__docgenInfo={description:"",displayName:"legend",props:{chartRef:{defaultValue:null,description:"",name:"chartRef",required:!0,type:{name:"RefObject<Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | null)[], unknown>>"}},legendConfig:{defaultValue:null,description:"",name:"legendConfig",required:!0,type:{name:"ILegendConfig"}}}}}catch{}export{Nhe as A,ln as B,E$ as C,Rhe as D,QH as E,Phe as F,S3 as G,bhe as H,Xhe as I,Sfe as J,Whe as K,ipe as L,Uz as M,mie as N,Khe as O,jhe as P,qhe as Q,Yhe as R,VO as S,bs as T,Zhe as U,Ghe as Z,Fhe as a,Coe as b,Bhe as c,Lhe as d,zhe as e,Dhe as f,YH as g,Vhe as h,Ahe as i,vfe as j,Uhe as k,Yfe as l,Che as m,mc as n,yhe as o,hn as p,Jhe as q,Ae as r,ope as s,Qhe as t,yfe as u,epe as v,npe as w,tpe as x,a6 as y,rpe as z};