streamlit 1.51.0__py3-none-any.whl → 1.52.1__py3-none-any.whl

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 (314) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/commands/execution_control.py +89 -14
  3. streamlit/components/v1/component_arrow.py +7 -7
  4. streamlit/components/v2/__init__.py +59 -3
  5. streamlit/components/v2/bidi_component/main.py +161 -13
  6. streamlit/components/v2/bidi_component/serialization.py +13 -6
  7. streamlit/components/v2/component_manager.py +11 -3
  8. streamlit/components/v2/component_registry.py +18 -1
  9. streamlit/components/v2/types.py +2 -2
  10. streamlit/connections/snowflake_connection.py +1 -1
  11. streamlit/connections/snowpark_connection.py +1 -1
  12. streamlit/dataframe_util.py +18 -18
  13. streamlit/delta_generator.py +7 -0
  14. streamlit/delta_generator_singletons.py +8 -14
  15. streamlit/elements/alert.py +16 -0
  16. streamlit/elements/arrow.py +36 -6
  17. streamlit/elements/bokeh_chart.py +10 -78
  18. streamlit/elements/code.py +2 -2
  19. streamlit/elements/deck_gl_json_chart.py +1 -1
  20. streamlit/elements/exception.py +1 -1
  21. streamlit/elements/form.py +27 -0
  22. streamlit/elements/heading.py +60 -5
  23. streamlit/elements/html.py +13 -2
  24. streamlit/elements/image.py +1 -1
  25. streamlit/elements/layouts.py +28 -22
  26. streamlit/elements/lib/built_in_chart_utils.py +49 -16
  27. streamlit/elements/lib/color_util.py +1 -1
  28. streamlit/elements/lib/column_config_utils.py +6 -5
  29. streamlit/elements/lib/layout_utils.py +50 -0
  30. streamlit/elements/lib/pandas_styler_utils.py +17 -9
  31. streamlit/elements/lib/shortcut_utils.py +152 -0
  32. streamlit/elements/markdown.py +50 -3
  33. streamlit/elements/metric.py +31 -1
  34. streamlit/elements/plotly_chart.py +75 -6
  35. streamlit/elements/spinner.py +1 -1
  36. streamlit/elements/text.py +20 -3
  37. streamlit/elements/toast.py +2 -0
  38. streamlit/elements/vega_charts.py +17 -1
  39. streamlit/elements/widgets/audio_input.py +8 -7
  40. streamlit/elements/widgets/button.py +279 -40
  41. streamlit/elements/widgets/button_group.py +27 -2
  42. streamlit/elements/widgets/camera_input.py +1 -1
  43. streamlit/elements/widgets/chat.py +300 -42
  44. streamlit/elements/widgets/color_picker.py +7 -0
  45. streamlit/elements/widgets/data_editor.py +68 -28
  46. streamlit/elements/widgets/file_uploader.py +4 -1
  47. streamlit/elements/widgets/number_input.py +2 -0
  48. streamlit/elements/widgets/text_widgets.py +2 -0
  49. streamlit/elements/widgets/time_widgets.py +581 -9
  50. streamlit/errors.py +22 -0
  51. streamlit/git_util.py +1 -1
  52. streamlit/navigation/page.py +7 -0
  53. streamlit/net_util.py +2 -2
  54. streamlit/proto/Alert_pb2.pyi +3 -3
  55. streamlit/proto/AppPage_pb2.pyi +7 -1
  56. streamlit/proto/ArrowData_pb2.pyi +7 -1
  57. streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
  58. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
  59. streamlit/proto/Arrow_pb2.py +10 -10
  60. streamlit/proto/Arrow_pb2.pyi +19 -12
  61. streamlit/proto/AudioInput_pb2.pyi +7 -1
  62. streamlit/proto/Audio_pb2.pyi +7 -1
  63. streamlit/proto/AuthRedirect_pb2.pyi +7 -1
  64. streamlit/proto/AutoRerun_pb2.pyi +7 -1
  65. streamlit/proto/BackMsg_pb2.py +4 -2
  66. streamlit/proto/BackMsg_pb2.pyi +34 -4
  67. streamlit/proto/Balloons_pb2.pyi +7 -1
  68. streamlit/proto/BidiComponent_pb2.pyi +10 -4
  69. streamlit/proto/Block_pb2.pyi +35 -35
  70. streamlit/proto/BokehChart_pb2.pyi +7 -1
  71. streamlit/proto/ButtonGroup_pb2.pyi +9 -9
  72. streamlit/proto/Button_pb2.py +2 -2
  73. streamlit/proto/Button_pb2.pyi +11 -2
  74. streamlit/proto/CameraInput_pb2.pyi +7 -1
  75. streamlit/proto/ChatInput_pb2.py +6 -6
  76. streamlit/proto/ChatInput_pb2.pyi +18 -6
  77. streamlit/proto/Checkbox_pb2.pyi +3 -3
  78. streamlit/proto/ClientState_pb2.pyi +10 -4
  79. streamlit/proto/Code_pb2.pyi +7 -1
  80. streamlit/proto/ColorPicker_pb2.pyi +7 -1
  81. streamlit/proto/Common_pb2.py +3 -3
  82. streamlit/proto/Common_pb2.pyi +35 -23
  83. streamlit/proto/Components_pb2.pyi +19 -13
  84. streamlit/proto/DataFrame_pb2.pyi +55 -49
  85. streamlit/proto/DateInput_pb2.pyi +7 -1
  86. streamlit/proto/DateTimeInput_pb2.py +28 -0
  87. streamlit/proto/DateTimeInput_pb2.pyi +92 -0
  88. streamlit/proto/DeckGlJsonChart_pb2.pyi +3 -3
  89. streamlit/proto/Delta_pb2.pyi +7 -1
  90. streamlit/proto/DocString_pb2.pyi +10 -4
  91. streamlit/proto/DownloadButton_pb2.py +2 -2
  92. streamlit/proto/DownloadButton_pb2.pyi +16 -2
  93. streamlit/proto/Element_pb2.py +5 -3
  94. streamlit/proto/Element_pb2.pyi +23 -5
  95. streamlit/proto/Empty_pb2.pyi +7 -1
  96. streamlit/proto/Exception_pb2.pyi +7 -1
  97. streamlit/proto/Favicon_pb2.pyi +7 -1
  98. streamlit/proto/FileUploader_pb2.pyi +7 -1
  99. streamlit/proto/ForwardMsg_pb2.py +12 -10
  100. streamlit/proto/ForwardMsg_pb2.pyi +42 -15
  101. streamlit/proto/GapSize_pb2.pyi +4 -4
  102. streamlit/proto/GitInfo_pb2.pyi +3 -3
  103. streamlit/proto/GraphVizChart_pb2.pyi +7 -1
  104. streamlit/proto/Heading_pb2.pyi +7 -1
  105. streamlit/proto/HeightConfig_pb2.pyi +7 -1
  106. streamlit/proto/Html_pb2.py +2 -2
  107. streamlit/proto/Html_pb2.pyi +11 -2
  108. streamlit/proto/IFrame_pb2.pyi +7 -1
  109. streamlit/proto/Image_pb2.pyi +10 -4
  110. streamlit/proto/Json_pb2.pyi +7 -1
  111. streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
  112. streamlit/proto/LinkButton_pb2.py +2 -2
  113. streamlit/proto/LinkButton_pb2.pyi +15 -2
  114. streamlit/proto/Logo_pb2.pyi +7 -1
  115. streamlit/proto/Markdown_pb2.pyi +3 -3
  116. streamlit/proto/Metric_pb2.pyi +7 -7
  117. streamlit/proto/MetricsEvent_pb2.pyi +10 -4
  118. streamlit/proto/MultiSelect_pb2.pyi +7 -1
  119. streamlit/proto/NamedDataSet_pb2.pyi +7 -1
  120. streamlit/proto/Navigation_pb2.pyi +3 -3
  121. streamlit/proto/NewSession_pb2.pyi +40 -40
  122. streamlit/proto/NumberInput_pb2.pyi +3 -3
  123. streamlit/proto/PageConfig_pb2.pyi +7 -7
  124. streamlit/proto/PageInfo_pb2.pyi +7 -1
  125. streamlit/proto/PageLink_pb2.py +2 -2
  126. streamlit/proto/PageLink_pb2.pyi +11 -2
  127. streamlit/proto/PageNotFound_pb2.pyi +7 -1
  128. streamlit/proto/PageProfile_pb2.pyi +13 -7
  129. streamlit/proto/PagesChanged_pb2.pyi +7 -1
  130. streamlit/proto/ParentMessage_pb2.pyi +7 -1
  131. streamlit/proto/PlotlyChart_pb2.pyi +6 -6
  132. streamlit/proto/Progress_pb2.pyi +7 -1
  133. streamlit/proto/Radio_pb2.pyi +7 -1
  134. streamlit/proto/RootContainer_pb2.pyi +1 -1
  135. streamlit/proto/Selectbox_pb2.pyi +7 -1
  136. streamlit/proto/SessionEvent_pb2.pyi +7 -1
  137. streamlit/proto/SessionStatus_pb2.pyi +7 -1
  138. streamlit/proto/Skeleton_pb2.pyi +3 -3
  139. streamlit/proto/Slider_pb2.pyi +5 -5
  140. streamlit/proto/Snow_pb2.pyi +7 -1
  141. streamlit/proto/Space_pb2.pyi +7 -1
  142. streamlit/proto/Spinner_pb2.pyi +7 -1
  143. streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
  144. streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
  145. streamlit/proto/TextArea_pb2.pyi +7 -1
  146. streamlit/proto/TextInput_pb2.pyi +3 -3
  147. streamlit/proto/Text_pb2.pyi +7 -1
  148. streamlit/proto/TimeInput_pb2.pyi +7 -1
  149. streamlit/proto/Toast_pb2.pyi +7 -1
  150. streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
  151. streamlit/proto/Video_pb2.pyi +6 -6
  152. streamlit/proto/WidgetStates_pb2.pyi +10 -4
  153. streamlit/proto/WidthConfig_pb2.pyi +7 -1
  154. streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
  155. streamlit/runtime/app_session.py +38 -1
  156. streamlit/runtime/caching/cache_data_api.py +1 -1
  157. streamlit/runtime/caching/cache_resource_api.py +2 -2
  158. streamlit/runtime/caching/cache_utils.py +1 -1
  159. streamlit/runtime/caching/hashing.py +1 -1
  160. streamlit/runtime/download_data_util.py +53 -0
  161. streamlit/runtime/forward_msg_queue.py +1 -0
  162. streamlit/runtime/media_file_manager.py +178 -2
  163. streamlit/runtime/metrics_util.py +87 -3
  164. streamlit/runtime/scriptrunner/script_runner.py +3 -1
  165. streamlit/runtime/state/query_params.py +80 -29
  166. streamlit/runtime/state/session_state.py +2 -2
  167. streamlit/static/index.html +1 -1
  168. streamlit/static/manifest.json +530 -229
  169. streamlit/static/static/js/{ErrorOutline.esm.YoJdlW1p.js → ErrorOutline.esm.sMJdFExW.js} +1 -1
  170. streamlit/static/static/js/{FileDownload.esm.Ddx8VEYy.js → FileDownload.esm.CV-WYqBn.js} +1 -1
  171. streamlit/static/static/js/{FileHelper.90EtOmj9.js → FileHelper.5nCh9KDY.js} +3 -3
  172. streamlit/static/static/js/{FormClearHelper.BB1Km6eP.js → FormClearHelper.-9RbsnV0.js} +1 -1
  173. streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
  174. streamlit/static/static/js/InputInstructions.2R3tBtW9.js +1 -0
  175. streamlit/static/static/js/Particles.DDHoXFxh.js +1 -0
  176. streamlit/static/static/js/{ProgressBar.DLY8H6nE.js → ProgressBar.BxmfHxKu.js} +2 -2
  177. streamlit/static/static/js/StreamlitSyntaxHighlighter.BFWV0oqR.js +20 -0
  178. streamlit/static/static/js/{Toolbar.D8nHCkuz.js → Toolbar.DMgU0Vgw.js} +1 -1
  179. streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
  180. streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
  181. streamlit/static/static/js/{base-input.CJGiNqed.js → base-input.BXTqYbyG.js} +4 -4
  182. streamlit/static/static/js/{checkbox.Cpdd482O.js → checkbox.5xWaqPqm.js} +1 -1
  183. streamlit/static/static/js/{createSuper.CuQIogbW.js → createSuper.OIgV8wc-.js} +1 -1
  184. streamlit/static/static/js/data-grid-overlay-editor.B4RIu9cw.js +1 -0
  185. streamlit/static/static/js/{downloader.CN0K7xlu.js → downloader.DwCJck8O.js} +1 -1
  186. streamlit/static/static/js/embed.HKcgTiLB.js +195 -0
  187. streamlit/static/static/js/{es6.BJcsVXQ0.js → es6.4AP97RGk.js} +2 -2
  188. streamlit/static/static/js/{iframeResizer.contentWindow.XzUvQqcZ.js → iframeResizer.contentWindow.BZAsvL9q.js} +1 -1
  189. streamlit/static/static/js/index.-3selq_5.js +2 -0
  190. streamlit/static/static/js/index.1ylynMAS.js +7 -0
  191. streamlit/static/static/js/{index.CxIUUfab.js → index.6UunrySF.js} +53 -122
  192. streamlit/static/static/js/index.8HslT92O.js +14 -0
  193. streamlit/static/static/js/index.B0TPxAZ1.js +1 -0
  194. streamlit/static/static/js/index.B0yp3bM1.js +6 -0
  195. streamlit/static/static/js/index.BHWBaOWH.js +1 -0
  196. streamlit/static/static/js/index.BJas6XzW.js +1 -0
  197. streamlit/static/static/js/index.BKIlG7Ng.js +3 -0
  198. streamlit/static/static/js/index.BMU6zZRk.js +1 -0
  199. streamlit/static/static/js/index.BNMLO-0p.js +2 -0
  200. streamlit/static/static/js/index.BPmBNTel.js +1 -0
  201. streamlit/static/static/js/index.BVuohWM1.js +1 -0
  202. streamlit/static/static/js/index.B_AvdOKC.js +1 -0
  203. streamlit/static/static/js/index.BjQIH-3U.js +1 -0
  204. streamlit/static/static/js/index.BrqtKtSu.js +2 -0
  205. streamlit/static/static/js/index.Buc7XrOl.js +188 -0
  206. streamlit/static/static/js/index.CIC9pLsG.js +2 -0
  207. streamlit/static/static/js/index.CP2YZ73v.js +1 -0
  208. streamlit/static/static/js/index.CSbah0y4.js +27 -0
  209. streamlit/static/static/js/index.CbiYVMT1.js +1 -0
  210. streamlit/static/static/js/index.CbxllBj8.js +1 -0
  211. streamlit/static/static/js/index.Cd1D2eGF.js +263 -0
  212. streamlit/static/static/js/index.Ckcqwai8.js +2 -0
  213. streamlit/static/static/js/index.CqTPbV5Y.js +151 -0
  214. streamlit/static/static/js/index.CxXo5UKy.js +1 -0
  215. streamlit/static/static/js/index.CxbL5FgL.js +1 -0
  216. streamlit/static/static/js/index.D52dMvK5.js +1 -0
  217. streamlit/static/static/js/index.DBUdji-9.js +3 -0
  218. streamlit/static/static/js/index.DMU3coc2.js +1 -0
  219. streamlit/static/static/js/index.DN4sfQLP.js +1 -0
  220. streamlit/static/static/js/{index.DPUXkcQL.js → index.DRDE9rnx.js} +1 -1
  221. streamlit/static/static/js/{index.B_dWA3vd.js → index.DY9Ac89e.js} +2 -2
  222. streamlit/static/static/js/index.DYKCsDvl.js +1 -0
  223. streamlit/static/static/js/index.Da9gznCC.js +1 -0
  224. streamlit/static/static/js/index.DfIRibXG.js +1 -0
  225. streamlit/static/static/js/{index.D3GPA5k4.js → index.Dg5zbEp2.js} +9 -40
  226. streamlit/static/static/js/index.Di9I2cid.js +1 -0
  227. streamlit/static/static/js/index.DkpEv0uV.js +1 -0
  228. streamlit/static/static/js/index.DwJ9Vhsl.js +1 -0
  229. streamlit/static/static/js/index.L7erTnMm.js +1 -0
  230. streamlit/static/static/js/{index.DOFlg3dS.js → index.NaDyAN1s.js} +1 -1
  231. streamlit/static/static/js/index.RNTPpVde.js +1 -0
  232. streamlit/static/static/js/index.VFDFuf_7.js +1 -0
  233. streamlit/static/static/js/index.W-bl3NDo.js +1 -0
  234. streamlit/static/static/js/index.XYozEjwK.js +1 -0
  235. streamlit/static/static/js/index.oyLQ4pue.js +1 -0
  236. streamlit/static/static/js/index.q4fLUQtC.js +11 -0
  237. streamlit/static/static/js/index.q9puCQgK.js +2 -0
  238. streamlit/static/static/js/index.xZBTXGNC.js +1 -0
  239. streamlit/static/static/js/{input.D4MN_FzN.js → input.CcvrgErO.js} +2 -2
  240. streamlit/static/static/js/main.eVHOp4Th.js +13 -0
  241. streamlit/static/static/js/{memory.DrZjtdGT.js → memory.Ck_sLv5Y.js} +1 -1
  242. streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
  243. streamlit/static/static/js/number-overlay-editor.DgcLMWOy.js +9 -0
  244. streamlit/static/static/js/pandasStylerUtils.DqP0h70z.js +1 -0
  245. streamlit/static/static/js/{possibleConstructorReturn.exeeJQEP.js → possibleConstructorReturn.C_51n46K.js} +1 -1
  246. streamlit/static/static/js/{sandbox.ClO3IuUr.js → sandbox.Q-g3QIZJ.js} +1 -1
  247. streamlit/static/static/js/styled-components.e0V96rJw.js +1 -0
  248. streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
  249. streamlit/static/static/js/throttle.D3b5WILl.js +1 -0
  250. streamlit/static/static/js/{timepicker.DAhu-vcF.js → timepicker.Bpn70xGc.js} +1 -1
  251. streamlit/static/static/js/timer.C2hYhUse.js +1 -0
  252. streamlit/static/static/js/{toConsumableArray.DNbljYEC.js → toConsumableArray.DIN_ys1J.js} +1 -1
  253. streamlit/static/static/js/uniqueId.B27POWT6.js +1 -0
  254. streamlit/static/static/js/urls.BwSlolu9.js +1 -0
  255. streamlit/static/static/js/{useBasicWidgetState.D6sOH6oI.js → useBasicWidgetState.DA3_qaXD.js} +1 -1
  256. streamlit/static/static/js/useIntlLocale.BSq6SANa.js +12 -0
  257. streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.ytEW5QmA.js} +1 -1
  258. streamlit/static/static/js/useUpdateUiValue.DOxWBNiI.js +1 -0
  259. streamlit/static/static/js/useWaveformController.BCmk6WLk.js +1 -0
  260. streamlit/static/static/js/value.B4vHRSi7.js +1 -0
  261. streamlit/static/static/js/withCalculatedWidth.ChdrMItN.js +1 -0
  262. streamlit/static/static/js/withFullScreenWrapper.7j_lzlaF.js +1 -0
  263. streamlit/string_util.py +8 -1
  264. streamlit/testing/v1/app_test.py +15 -0
  265. streamlit/testing/v1/element_tree.py +62 -0
  266. streamlit/web/bootstrap.py +24 -0
  267. streamlit/web/server/oauth_authlib_routes.py +5 -2
  268. streamlit/web/server/upload_file_request_handler.py +16 -0
  269. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/METADATA +9 -5
  270. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/RECORD +274 -239
  271. streamlit/static/static/js/InputInstructions.jhH15PqV.js +0 -1
  272. streamlit/static/static/js/Particles.DUsputn1.js +0 -1
  273. streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +0 -1
  274. streamlit/static/static/js/index.B1ZQh4P1.js +0 -1
  275. streamlit/static/static/js/index.BKstZk0M.js +0 -27
  276. streamlit/static/static/js/index.BMcFsUee.js +0 -1
  277. streamlit/static/static/js/index.BR-IdcTb.js +0 -2
  278. streamlit/static/static/js/index.BgnZEMVh.js +0 -1
  279. streamlit/static/static/js/index.BohqXifI.js +0 -1
  280. streamlit/static/static/js/index.Br5nxKNj.js +0 -2
  281. streamlit/static/static/js/index.BrIKVbNc.js +0 -3
  282. streamlit/static/static/js/index.BtWUPzle.js +0 -1
  283. streamlit/static/static/js/index.C0RLraek.js +0 -1
  284. streamlit/static/static/js/index.CAIjskgG.js +0 -1
  285. streamlit/static/static/js/index.CAj-7vWz.js +0 -949
  286. streamlit/static/static/js/index.CMtEit2O.js +0 -1
  287. streamlit/static/static/js/index.CkRlykEE.js +0 -12
  288. streamlit/static/static/js/index.CmN3FXfI.js +0 -1617
  289. streamlit/static/static/js/index.CwbFI1_-.js +0 -1
  290. streamlit/static/static/js/index.D2KPNy7e.js +0 -1
  291. streamlit/static/static/js/index.DGAh7DMq.js +0 -1
  292. streamlit/static/static/js/index.DKb_NvmG.js +0 -197
  293. streamlit/static/static/js/index.DMqgUYKq.js +0 -1
  294. streamlit/static/static/js/index.DX1xY89g.js +0 -1
  295. streamlit/static/static/js/index.DYATBCsq.js +0 -2
  296. streamlit/static/static/js/index.DaSmGJ76.js +0 -3
  297. streamlit/static/static/js/index.Dd7bMeLP.js +0 -1
  298. streamlit/static/static/js/index.DjmmgI5U.js +0 -1
  299. streamlit/static/static/js/index.Dq56CyM2.js +0 -1
  300. streamlit/static/static/js/index.DuiXaS5_.js +0 -7
  301. streamlit/static/static/js/index.DvFidMLe.js +0 -2
  302. streamlit/static/static/js/index.DwkhC5Pc.js +0 -1
  303. streamlit/static/static/js/index.Q-3sFn1v.js +0 -1
  304. streamlit/static/static/js/index.QJ5QO9sJ.js +0 -1
  305. streamlit/static/static/js/index.VwTaeety.js +0 -1
  306. streamlit/static/static/js/index.YOqQbeX8.js +0 -1
  307. streamlit/static/static/js/number-overlay-editor.DRwAw1In.js +0 -9
  308. streamlit/static/static/js/uniqueId.oG4Gvj1v.js +0 -1
  309. streamlit/static/static/js/useUpdateUiValue.F2R3eTeR.js +0 -1
  310. streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +0 -1
  311. {streamlit-1.51.0.data → streamlit-1.52.1.data}/scripts/streamlit.cmd +0 -0
  312. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/WHEEL +0 -0
  313. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/entry_points.txt +0 -0
  314. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,188 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.B4RIu9cw.js","./index.CqTPbV5Y.js","../css/index.BpABIXK9.css","./withFullScreenWrapper.7j_lzlaF.js","./Toolbar.DMgU0Vgw.js","./FormClearHelper.-9RbsnV0.js","./moment.C3j7ZXd7.js","./pandasStylerUtils.DqP0h70z.js","./_baseIndexOf.BTknn6Gb.js","./sprintf.D7DtBTRn.js","./index.8HslT92O.js","./main.eVHOp4Th.js","./throttle.D3b5WILl.js","./checkbox.5xWaqPqm.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.DIN_ys1J.js","./possibleConstructorReturn.C_51n46K.js","./createSuper.OIgV8wc-.js","./FileDownload.esm.CV-WYqBn.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.DgcLMWOy.js","./es6.4AP97RGk.js"])))=>i.map(i=>d[i]);
2
+ import{ar as Ya,d4 as uh,d5 as ch,cK as wc,d6 as dh,d7 as fh,d8 as hh,d9 as gh,da as ph,db as mh,dc as ja,dd as yc,aN as vh,aO as bh,r as f,E as Ll,_ as $e,de as wh,al as yo,bz as yh,df as Ch,aB as $t,dg as Sh,K as Ir,dh as Ls,aL as Fl,H as xh,e as Le,bA as Cc,n as at,di as kh,j as Ne,dj as Mh,x as Jn,aI as tn,bl as Rh,ad as Ih,dk as Eh,dl as Th,k as Co,t as Xr,aM as Dh,dm as Oh,dn as Ph,dp as Sc,cc as Lh,ca as Fh,dq as xc,dr as Ah,ds as _h,c9 as kc,cd as Hh,dt as zh,c8 as Vh,du as $h,bj as Nh,bk as Bh,cf as Wh,dv as Uh,M as Gh,dw as Xh,cg as Yh,dx as jh,N as qh,g as Kr,J as nn,Q as Al,cW as Kh,cU as ro,dy as lr,dz as _e,br as Zh,aj as Mc,dA as Rc,a4 as Jh,dB as Qh,dC as eg,bn as qa,a0 as Ic,aw as Sa,dD as Ec,l as wn,Z as jn,cx as xa,V as tg,cz as Tc,dE as ng,S as rg,R as Fs,dF as ig,dG as og,f as ag,L as lg,dH as sg,dI as As}from"./index.CqTPbV5Y.js";import{w as ug,E as cg}from"./withFullScreenWrapper.7j_lzlaF.js";import{T as dg,a as yi}from"./Toolbar.DMgU0Vgw.js";import{u as fg}from"./FormClearHelper.-9RbsnV0.js";import{h as Gr}from"./moment.C3j7ZXd7.js";import{r as hg,n as io,m as _s,f as bl,c as gg,a as pg}from"./pandasStylerUtils.DqP0h70z.js";import{s as mg}from"./sprintf.D7DtBTRn.js";import{l as Ka}from"./index.8HslT92O.js";import{R as vg}from"./main.eVHOp4Th.js";import{d as Dc,t as bg}from"./throttle.D3b5WILl.js";import{L as wg,a as yg,S as Cg}from"./checkbox.5xWaqPqm.js";import{c as Sg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as fr,a as Ei,C as xg}from"./toConsumableArray.DIN_ys1J.js";import{d as kg,f as Mg,e as Rg}from"./possibleConstructorReturn.C_51n46K.js";import{_ as Ig}from"./createSuper.OIgV8wc-.js";import{D as Eg,F as Tg}from"./FileDownload.esm.CV-WYqBn.js";import{a as Dg}from"./_arrayIncludes.B19Iyn2B.js";function Og(){}function Pg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Nn(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ya(n),n=n===n?n:0),t!==void 0&&(t=Ya(t),t=t===t?t:0),Pg(Ya(e),t,n)}var Lg=Object.prototype,Fg=Lg.hasOwnProperty;function Ag(e,t){return e!=null&&Fg.call(e,t)}function _g(e,t){return e!=null&&uh(e,t,Ag)}var Hg="[object Map]",zg="[object Set]",Vg=Object.prototype,$g=Vg.hasOwnProperty;function Ng(e){if(e==null)return!0;if(ch(e)&&(wc(e)||typeof e=="string"||typeof e.splice=="function"||dh(e)||fh(e)||hh(e)))return!e.length;var t=gh(e);if(t==Hg||t==zg)return!e.size;if(ph(e))return!mh(e).length;for(var n in e)if($g.call(e,n))return!1;return!0}var Bg=1/0,Wg=ja&&1/yc(new ja([,-0]))[1]==Bg?function(e){return new ja(e)}:Og,Ug=200;function Gg(e,t,n){var r=-1,i=Dg,o=e.length,l=!0,a=[],s=a;if(o>=Ug){var u=Wg(e);if(u)return yc(u);l=!1,i=bh,s=new vh}else s=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,l&&d===d){for(var g=s.length;g--;)if(s[g]===d)continue e;a.push(c)}else i(s,d,n)||(s!==a&&s.push(d),a.push(c))}return a}function Xg(e){return e&&e.length?Gg(e):[]}var Oc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Oc.displayName="Add";var Pc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Pc.displayName="Search";var Lc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Lc.displayName="Visibility";function Fc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return Fc(t)}function fo(e,t){return Fc(t??"Hell froze over")}function Yg(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function Di(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Di(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!Di(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const aa=null,_l=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var zs;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(zs||(zs={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function Vo(e){return"width"in e&&typeof e.width=="number"}async function Vs(e){return typeof e=="object"?e:await e()}function Si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Mi(e){return e.kind===Bn.Marker||e.kind===Bn.NewRow}function xi(e){if(!Si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:fo(e,"A cell was passed with an invalid kind")}}function jg(e){return _g(e,"editor")}function Hl(e){return!(e.readonly??!1)}var Bn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Bn||(Bn={}));const sa={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Za(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let $s;class et{items;constructor(t){this.items=t}static create=t=>new et(Za(t));static empty=()=>$s??($s=new et([]));static fromSingleSelection=t=>et.empty().add(t);static fromArray=t=>{if(t.length===0)return et.empty();const n=t.map(i=>[i,i+1]),r=Za(n);return new et(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new et(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Za([...this.items,n]);return new et(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new et(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var qg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ja=wh(function(e){return qg.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Kg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Ns=Kg,Zg=e=>e.toUpperCase()===e,Jg=e=>t=>e.indexOf(t)===-1,Ac=(e,t)=>{const n={};return Object.keys(e).filter(Jg(t)).forEach(r=>{n[r]=e[r]}),n};function Qg(e,t,n){const r=Ac(t,n);if(!e){const i=typeof Ja=="function"?{default:Ja}:Ja;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var ep=(e,t)=>{};function tp(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Zg(a[0])):n.propsAsIs,c=Qg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Ns(n.class,c.className||s):Ns(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],v=y[0],b=y[1]||"",k=typeof v=="function"?v(o):v;ep(k,n.name),g[`--${m}`]=`${k}${b}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=Ac(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var sn=tp;const np=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Qa={},Gi={},$o={},No={},Bs;function rp(){return Bs||(Bs=1,function(e){(function(t,n){n(e,yo(),yh())})(No,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=l(n),o=l(r);function l(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var k=1;k<arguments.length;k++){var E=arguments[k];for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(b[M]=E[M])}return b};function s(b,k){var E={};for(var M in b)k.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(b,M)&&(E[M]=b[M]);return E}function u(b,k){if(!(b instanceof k))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(k,E){for(var M=0;M<E.length;M++){var I=E[M];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(k,I.key,I)}}return function(k,E,M){return E&&b(k.prototype,E),M&&b(k,M),k}}();function d(b,k){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:b}function g(b,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);b.prototype=Object.create(k&&k.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(b,k):b.__proto__=k)}var h=!1;function p(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function y(b){if("touches"in b){var k=b.touches[0],E=k.pageX,M=k.pageY;return{x:E,y:M}}var I=b.screenX,P=b.screenY;return{x:I,y:P}}var v=function(b){g(k,b);function k(){var E;u(this,k);for(var M=arguments.length,I=Array(M),P=0;P<M;P++)I[P]=arguments[P];var S=d(this,(E=k.__proto__||Object.getPrototypeOf(k)).call.apply(E,[this].concat(I)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return c(k,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var I=y(M),P=I.x,S=I.y;this.moveStart={x:P,y:S},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var I=y(M),P=I.x,S=I.y,C=P-this.moveStart.x,F=S-this.moveStart.y;this.moving=!0;var T=this.props.onSwipeMove({x:C,y:F},M);T&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,M):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var I=M.className,P=M.style,S=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var C=s(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:P},C),S)}}]),k}(n.Component);v.displayName="ReactSwipe",v.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},v.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=v})}(No)),No}var Ws;function _c(){return Ws||(Ws=1,function(e){(function(t,n){n(e,rp())})($o,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}($o)),$o}var Xi={},Us;function Hc(){if(Us)return Xi;Us=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(Ch());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Yi={},ji={},Gs;function ip(){if(Gs)return ji;Gs=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return ji.outerWidth=e,ji}var qi={},Xs;function zl(){if(Xs)return qi;Xs=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return qi.default=e,qi}var Ki={},Ys;function zc(){if(Ys)return Ki;Ys=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return window};return Ki.default=e,Ki}var js;function Vc(){if(js)return Yi;js=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=s(yo()),t=l(Hc()),n=ip(),r=l(zl()),i=l(_c()),o=l(zc());function l(S){return S&&S.__esModule?S:{default:S}}function a(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return a=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||u(S)!=="object"&&typeof S!="function")return{default:S};var C=a();if(C&&C.has(S))return C.get(S);var F={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in S)if(Object.prototype.hasOwnProperty.call(S,x)){var D=T?Object.getOwnPropertyDescriptor(S,x):null;D&&(D.get||D.set)?Object.defineProperty(F,x,D):F[x]=S[x]}return F.default=S,C&&C.set(S,F),F}function u(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(S)}function c(){return c=Object.assign||function(S){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(S[T]=F[T])}return S},c.apply(this,arguments)}function d(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function g(S,C){for(var F=0;F<C.length;F++){var T=C[F];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function h(S,C,F){return C&&g(S.prototype,C),S}function p(S,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(C&&C.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),C&&m(S,C)}function m(S,C){return m=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},m(S,C)}function y(S){var C=k();return function(){var T=E(S),x;if(C){var D=E(this).constructor;x=Reflect.construct(T,arguments,D)}else x=T.apply(this,arguments);return v(this,x)}}function v(S,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(S)}function b(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(S){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},E(S)}function M(S,C,F){return C in S?Object.defineProperty(S,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):S[C]=F,S}var I=function(C){return C.hasOwnProperty("key")},P=function(S){p(F,S);var C=y(F);function F(T){var x;return d(this,F),x=C.call(this,T),M(b(x),"itemsWrapperRef",void 0),M(b(x),"itemsListRef",void 0),M(b(x),"thumbsRef",void 0),M(b(x),"setItemsWrapperRef",function(D){x.itemsWrapperRef=D}),M(b(x),"setItemsListRef",function(D){x.itemsListRef=D}),M(b(x),"setThumbsRef",function(D,O){x.thumbsRef||(x.thumbsRef=[]),x.thumbsRef[O]=D}),M(b(x),"updateSizes",function(){if(!(!x.props.children||!x.itemsWrapperRef||!x.thumbsRef)){var D=e.Children.count(x.props.children),O=x.itemsWrapperRef.clientWidth,R=x.props.thumbWidth?x.props.thumbWidth:(0,n.outerWidth)(x.thumbsRef[0]),N=Math.floor(O/R),W=N<D,j=W?D-N:0;x.setState(function(oe,Q){return{itemSize:R,visibleItems:N,firstItem:W?x.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),M(b(x),"handleClickItem",function(D,O,R){if(!I(R)||R.key==="Enter"){var N=x.props.onSelectItem;typeof N=="function"&&N(D,O)}}),M(b(x),"onSwipeStart",function(){x.setState({swiping:!0})}),M(b(x),"onSwipeEnd",function(){x.setState({swiping:!1})}),M(b(x),"onSwipeMove",function(D){var O=D.x;if(!x.state.itemSize||!x.itemsWrapperRef||!x.state.visibleItems)return!1;var R=0,N=e.Children.count(x.props.children),W=-(x.state.firstItem*100)/x.state.visibleItems,j=Math.max(N-x.state.visibleItems,0),oe=-j*100/x.state.visibleItems;W===R&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=x.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return x.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ue){x.itemsListRef.style[ue]=(0,r.default)(re,"%",x.props.axis)}),!0}),M(b(x),"slideRight",function(D){x.moveTo(x.state.firstItem-(typeof D=="number"?D:1))}),M(b(x),"slideLeft",function(D){x.moveTo(x.state.firstItem+(typeof D=="number"?D:1))}),M(b(x),"moveTo",function(D){D=D<0?0:D,D=D>=x.state.lastPosition?x.state.lastPosition:D,x.setState({firstItem:D})}),x.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},x}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(x){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==x.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(x){var D=x;return x>=this.state.lastPosition&&(D=this.state.lastPosition),x<this.state.firstItem+this.state.visibleItems&&(D=this.state.firstItem),x<this.state.firstItem&&(D=x),D}},{key:"renderItems",value:function(){var x=this;return this.props.children.map(function(D,O){var R=t.default.ITEM(!1,O===x.state.selectedItem),N={key:O,ref:function(j){return x.setThumbsRef(j,O)},className:R,onClick:x.handleClickItem.bind(x,O,x.props.children[O]),onKeyDown:x.handleClickItem.bind(x,O,x.props.children[O]),"aria-label":"".concat(x.props.labels.item," ").concat(O+1),style:{width:x.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),D)})}},{key:"render",value:function(){var x=this;if(!this.props.children)return null;var D=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,R=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return x.slideRight()},"aria-label":this.props.labels.leftArrow}),D?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(re){return x.setItemsListRef(re)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!R),onClick:function(){return x.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Yi.default=P,M(P,"displayName","Thumbs"),M(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Yi}var Zi={},qs;function op(){if(qs)return Zi;qs=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0;var e=function(){return document};return Zi.default=e,Zi}var An={},Ks;function $c(){if(Ks)return An;Ks=1,Object.defineProperty(An,"__esModule",{value:!0}),An.setPosition=An.getPosition=An.isKeyboardEvent=An.defaultStatusFormatter=An.noop=void 0;var e=yo(),t=n(zl());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};An.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};An.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};An.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};An.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return An.setPosition=a,An}var Yn={},Zs;function ap(){if(Zs)return Yn;Zs=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.fadeAnimationHandler=Yn.slideStopSwipingHandler=Yn.slideSwipeAnimationHandler=Yn.slideAnimationHandler=void 0;var e=yo(),t=r(zl()),n=$c();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){l(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,v=e.Children.count(g.children)-1,b=g.infiniteLoop&&(m<0||m>v);if(b)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(v+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(v+2)*100,g.axis):y>v&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var k=(0,n.getPosition)(m,g),E=(0,t.default)(k,"%",g.axis),M=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:E,msTransform:E,OTransform:E,transform:E},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),p};Yn.slideAnimationHandler=a;var s=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),k=0,E=(0,n.getPosition)(p.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),I=v?g.x:g.y,P=I;E===k&&I>0&&(P=0),E===M&&I<0&&(P=0);var S=E+100/(p.itemSize/P),C=Math.abs(I)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&S>-100?S-=b*100:p.selectedItem===b-1&&S<-b*100&&(S+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(S,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Yn.slideSwipeAnimationHandler=s;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Yn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Yn.fadeAnimationHandler=c,Yn}var Js;function lp(){if(Js)return Gi;Js=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=c(yo()),t=s(_c()),n=s(Hc()),r=s(Vc()),i=s(op()),o=s(zc()),l=$c(),a=ap();function s(T){return T&&T.__esModule?T:{default:T}}function u(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return u=function(){return T},T}function c(T){if(T&&T.__esModule)return T;if(T===null||d(T)!=="object"&&typeof T!="function")return{default:T};var x=u();if(x&&x.has(T))return x.get(T);var D={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in T)if(Object.prototype.hasOwnProperty.call(T,R)){var N=O?Object.getOwnPropertyDescriptor(T,R):null;N&&(N.get||N.set)?Object.defineProperty(D,R,N):D[R]=T[R]}return D.default=T,x&&x.set(T,D),D}function d(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(D){return typeof D}:d=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},d(T)}function g(){return g=Object.assign||function(T){for(var x=1;x<arguments.length;x++){var D=arguments[x];for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&(T[O]=D[O])}return T},g.apply(this,arguments)}function h(T,x){var D=Object.keys(T);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);x&&(O=O.filter(function(R){return Object.getOwnPropertyDescriptor(T,R).enumerable})),D.push.apply(D,O)}return D}function p(T){for(var x=1;x<arguments.length;x++){var D=arguments[x]!=null?arguments[x]:{};x%2?h(Object(D),!0).forEach(function(O){C(T,O,D[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(D)):h(Object(D)).forEach(function(O){Object.defineProperty(T,O,Object.getOwnPropertyDescriptor(D,O))})}return T}function m(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function y(T,x){for(var D=0;D<x.length;D++){var O=x[D];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}function v(T,x,D){return x&&y(T.prototype,x),T}function b(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),x&&k(T,x)}function k(T,x){return k=Object.setPrototypeOf||function(O,R){return O.__proto__=R,O},k(T,x)}function E(T){var x=P();return function(){var O=S(T),R;if(x){var N=S(this).constructor;R=Reflect.construct(O,arguments,N)}else R=O.apply(this,arguments);return M(this,R)}}function M(T,x){return x&&(d(x)==="object"||typeof x=="function")?x:I(T)}function I(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},S(T)}function C(T,x,D){return x in T?Object.defineProperty(T,x,{value:D,enumerable:!0,configurable:!0,writable:!0}):T[x]=D,T}var F=function(T){b(D,T);var x=E(D);function D(O){var R;m(this,D),R=x.call(this,O),C(I(R),"thumbsRef",void 0),C(I(R),"carouselWrapperRef",void 0),C(I(R),"listRef",void 0),C(I(R),"itemsRef",void 0),C(I(R),"timer",void 0),C(I(R),"animationHandler",void 0),C(I(R),"setThumbsRef",function(W){R.thumbsRef=W}),C(I(R),"setCarouselWrapperRef",function(W){R.carouselWrapperRef=W}),C(I(R),"setListRef",function(W){R.listRef=W}),C(I(R),"setItemsRef",function(W,j){R.itemsRef||(R.itemsRef=[]),R.itemsRef[j]=W}),C(I(R),"autoPlay",function(){e.Children.count(R.props.children)<=1||(R.clearAutoPlay(),R.props.autoPlay&&(R.timer=setTimeout(function(){R.increment()},R.props.interval)))}),C(I(R),"clearAutoPlay",function(){R.timer&&clearTimeout(R.timer)}),C(I(R),"resetAutoPlay",function(){R.clearAutoPlay(),R.autoPlay()}),C(I(R),"stopOnHover",function(){R.setState({isMouseEntered:!0},R.clearAutoPlay)}),C(I(R),"startOnLeave",function(){R.setState({isMouseEntered:!1},R.autoPlay)}),C(I(R),"isFocusWithinTheCarousel",function(){return R.carouselWrapperRef?!!((0,i.default)().activeElement===R.carouselWrapperRef||R.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(I(R),"navigateWithKeyboard",function(W){if(R.isFocusWithinTheCarousel()){var j=R.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,ue=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?R.increment():ue===W.keyCode&&R.decrement()}}),C(I(R),"updateSizes",function(){if(!(!R.state.initialized||!R.itemsRef||R.itemsRef.length===0)){var W=R.props.axis==="horizontal",j=R.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;R.setState({itemSize:oe}),R.thumbsRef&&R.thumbsRef.updateSizes()}}}),C(I(R),"setMountState",function(){R.setState({hasMount:!0}),R.updateSizes()}),C(I(R),"handleClickItem",function(W,j){if(e.Children.count(R.props.children)!==0){if(R.state.cancelClick){R.setState({cancelClick:!1});return}R.props.onClickItem(W,j),W!==R.state.selectedItem&&R.setState({selectedItem:W})}}),C(I(R),"handleOnChange",function(W,j){e.Children.count(R.props.children)<=1||R.props.onChange(W,j)}),C(I(R),"handleClickThumb",function(W,j){R.props.onClickThumb(W,j),R.moveTo(W)}),C(I(R),"onSwipeStart",function(W){R.setState({swiping:!0}),R.props.onSwipeStart(W)}),C(I(R),"onSwipeEnd",function(W){R.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),R.props.onSwipeEnd(W),R.clearAutoPlay(),R.state.autoPlay&&R.autoPlay()}),C(I(R),"onSwipeMove",function(W,j){R.props.onSwipeMove(j);var oe=R.props.swipeAnimationHandler(W,R.props,R.state,R.setState.bind(I(R)));return R.setState(p({},oe)),!!Object.keys(oe).length}),C(I(R),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem-(typeof W=="number"?W:1))}),C(I(R),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem+(typeof W=="number"?W:1))}),C(I(R),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(R.props.children)-1;W<0&&(W=R.props.infiniteLoop?j:0),W>j&&(W=R.props.infiniteLoop?0:j),R.selectItem({selectedItem:W}),R.state.autoPlay&&R.state.isMouseEntered===!1&&R.resetAutoPlay()}}),C(I(R),"onClickNext",function(){R.increment(1)}),C(I(R),"onClickPrev",function(){R.decrement(1)}),C(I(R),"onSwipeForward",function(){R.increment(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"onSwipeBackwards",function(){R.decrement(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"changeItem",function(W){return function(j){(!(0,l.isKeyboardEvent)(j)||j.key==="Enter")&&R.moveTo(W)}}),C(I(R),"selectItem",function(W){R.setState(p({previousItem:R.state.selectedItem},W),function(){R.setState(R.animationHandler(R.props,R.state))}),R.handleOnChange(W.selectedItem,e.Children.toArray(R.props.children)[W.selectedItem])}),C(I(R),"getInitialImage",function(){var W=R.props.selectedItem,j=R.itemsRef&&R.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(I(R),"getVariableItemHeight",function(W){var j=R.itemsRef&&R.itemsRef[W];if(R.state.hasMount&&j&&j.children.length){var oe=j.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var re=function de(){R.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var ue=oe[0]||j.children[0],ae=ue.clientHeight;return ae>0?ae:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return R.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,R.state=p(p({},N),R.animationHandler(O,N)),R}return v(D,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(R,N){!R.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!R.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(R.selectedItem!==this.props.selectedItem||R.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),R.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var R=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=R.getInitialImage();N&&!N.complete?N.addEventListener("load",R.setMountState):R.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.addEventListener("mouseenter",this.stopOnHover),R.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.removeEventListener("mouseenter",this.stopOnHover),R.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var R=this.getInitialImage();R&&R.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var R;(R=this.carouselWrapperRef)===null||R===void 0||R.focus()}},{key:"renderItems",value:function(R){var N=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===N.state.selectedItem,Q=j===N.state.previousItem,re=oe&&N.state.selectedStyle||Q&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var ue={ref:function(de){return N.setItemsRef(de,j)},key:"itemKey"+j+(R?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,W),style:re};return e.default.createElement("li",ue,N.props.renderItem(W,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var R=this,N=this.props,W=N.showIndicators,j=N.labels,oe=N.renderIndicator,Q=N.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,ue){return oe&&oe(R.changeItem(ue),ue===R.state.selectedItem,ue,j.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var R=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,W=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,re=this.renderItems(!0),ue=re.shift(),ae=re.pop(),de={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},he={};if(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ce=this.getVariableItemHeight(this.state.selectedItem);he.height=ce||"auto"}}else de.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,de.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,de.style=p(p({},de.style),{},{height:this.state.itemSize}),he.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:he},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},de,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return R.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),D}(e.default.Component);return Gi.default=F,C(F,"displayName","Carousel"),C(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!D),onClick:x})},renderArrowNext:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!D),onClick:x})},renderIndicator:function(x,D,O,R){return e.default.createElement("li",{className:n.default.DOT(D),onClick:x,onKeyDown:x,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(R," ").concat(O+1)})},renderItem:function(x){return x},renderThumbs:function(x){var D=e.Children.map(x,function(O){var R=O;if(O.type!=="img"&&(R=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!R)return R});return D.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):D},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Gi}var Qs={},eu;function sp(){return eu||(eu=1),Qs}var tu;function up(){return tu||(tu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(lp()),n=sp(),r=i(Vc());function i(o){return o&&o.__esModule?o:{default:o}}}(Qa)),Qa}var cp=up();function Mn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{o.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function kr(e,t){return e===void 0?void 0:t}const dp=Math.PI;function nu(e){return e*dp/180}const Nc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Bc=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},Wc=(e,t,n)=>Math.min(e,t-n*2),Uc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vl=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},fp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function hp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Dc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const gp="֑-߿יִ-﷽ﹰ-ﻼ",pp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",mp=new RegExp("^[^"+pp+"]*["+gp+"]");function $l(e){return mp.test(e)?"rtl":"not-rtl"}let Bo;function wl(){if(typeof document>"u")return 0;if(Bo!==void 0)return Bo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Bo=n-r,Bo}const Wr=Symbol();function vp(e){const t=f.useRef([Wr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==Wr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Wr&&i({}),r(u=>typeof a=="function"?a(s===Wr?u:s):a),t.current[0]=Wr)},[]),l=f.useCallback(()=>{t.current[0]=Wr,i({})},[]);return[t.current[0]===Wr?n:t.current[0],o,l]}function Gc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function bp(e){const t=f.useRef(e);return Di(e,t.current)||(t.current=e),t.current}const wp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(np,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(cp.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Vl,null)))};function Xc(){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 Zr=Xc();function yp(e){Zr=e}const Yc=/[&<>"']/,Cp=new RegExp(Yc.source,"g"),jc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Sp=new RegExp(jc.source,"g"),xp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>xp[e];function yn(e,t){if(t){if(Yc.test(e))return e.replace(Cp,ru)}else if(jc.test(e))return e.replace(Sp,ru);return e}const kp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function qc(e){return e.replace(kp,(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 Mp=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Mp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Rp=/[^\w:]/g,Ip=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(qc(n)).replace(Rp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ip.test(n)&&(n=Op(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Wo={},Ep=/^[^:]+:\/*[^/]*$/,Tp=/^([^:]+:)[\s\S]*$/,Dp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Op(e,t){Wo[" "+e]||(Ep.test(e)?Wo[" "+e]=e+"/":Wo[" "+e]=ea(e,"/",!0)),e=Wo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Tp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Dp,"$1")+t:e+t}const ua={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=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(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function ea(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Pp(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Lp(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 au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function lu(e,t,n,r){const i=t.href,o=t.title?yn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:yn(l)}}function Fp(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
+ `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
4
+ `)}class Nl{constructor(t){this.options=t||Zr}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:ea(r,`
5
+ `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Fp(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=ea(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.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,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,l,a,s,u,c,d,g,h,p,m=n[1].trim();const y=m.length>1,v={type:"list",raw:"",ordered:y,start:y?+m.slice(0,-1):"",loose:!1,items:[]};m=y?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=y?m:"[*+-]");const b=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
6
+ `,1)[0].replace(/^\t+/,E=>" ".repeat(3*E.length)),d=t.split(`
7
+ `,1)[0],this.options.pedantic?(l=2,h=c.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=c.slice(l),l+=n[1].length),s=!1,!c&&/^ *$/.test(d)&&(r+=d+`
8
+ `,t=t.substring(d.length+1),p=!0),!p){const E=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),M=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),I=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),P=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(g=t.split(`
9
+ `,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(I.test(d)||P.test(d)||E.test(d)||M.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=`
10
+ `+d.slice(l);else{if(s||c.search(/[^ ]/)>=4||I.test(c)||P.test(c)||M.test(c))break;h+=`
11
+ `+d}!s&&!d.trim()&&(s=!0),r+=g+`
12
+ `,t=t.substring(g.length+1),c=d.slice(l)}}v.loose||(u?v.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),v.raw+=r}v.items[v.items.length-1].raw=r.trimRight(),v.items[v.items.length-1].text=h.trimRight(),v.raw=v.raw.trimRight();const k=v.items.length;for(a=0;a<k;a++)if(this.lexer.state.top=!1,v.items[a].tokens=this.lexer.blockTokens(v.items[a].text,[]),!v.loose){const E=v.items[a].tokens.filter(I=>I.type==="space"),M=E.length>0&&E.some(I=>/\n.*\n/.test(I.raw));v.loose=M}if(v.loose)for(a=0;a<k;a++)v.items[a].loose=!0;return v}}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 i=this.options.sanitizer?this.options.sanitizer(n[0]):yn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=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:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:ou(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
13
+ `):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,l,a,s;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=ou(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,l=0;l<i;l++)r.header[l].tokens=this.lexer.inline(r.header[l].text);for(i=r.rows.length,l=0;l<i;l++)for(s=r.rows[l],a=0;a<s.length;a++)s[a].tokens=this.lexer.inline(s[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)===`
14
+ `?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:yn(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]):yn(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 l=ea(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=Pp(n[2],"()");if(l>-1){const s=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,s).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),lu(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.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 i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return lu(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const l=i[0].length-1;let a,s,u=l,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+l);(i=d.exec(n))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=a.length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&l%3&&!((l+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);const g=t.slice(0,l+i.index+(i[0].length-a.length)+s);if(Math.min(l,s)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const h=g.slice(2,-2);return{type:"strong",raw:g,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 i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=yn(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 i,o;return r[2]==="@"?(i=yn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=yn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=yn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let l;do l=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(l!==r[0]);i=yn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):yn(r[0]):r[0]:i=yn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Be={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:ua,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Be._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Be.def=At(Be.def).replace("label",Be._label).replace("title",Be._title).getRegex();Be.bullet=/(?:[*+-]|\d{1,9}[.)])/;Be.listItemStart=At(/^( *)(bull) */).replace("bull",Be.bullet).getRegex();Be.list=At(Be.list).replace(/bull/g,Be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Be.def.source+")").getRegex();Be._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";Be._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Be.html=At(Be.html,"i").replace("comment",Be._comment).replace("tag",Be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Be.paragraph=At(Be._paragraph).replace("hr",Be.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",Be._tag).getRegex();Be.blockquote=At(Be.blockquote).replace("paragraph",Be.paragraph).getRegex();Be.normal={...Be};Be.gfm={...Be.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Be.gfm.table=At(Be.gfm.table).replace("hr",Be.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",Be._tag).getRegex();Be.gfm.paragraph=At(Be._paragraph).replace("hr",Be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Be.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",Be._tag).getRegex();Be.pedantic={...Be.normal,html:At(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Be._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:ua,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:At(Be.normal._paragraph).replace("hr",Be.hr).replace("heading",` *#{1,6} *[^
15
+ ]`).replace("lheading",Be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ua,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:ua,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";be.punctuation=At(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex();be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;be.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;be._comment=At(Be._comment).replace("(?:-->|$)","-->").getRegex();be.emStrong.lDelim=At(be.emStrong.lDelim).replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimAst=At(be.emStrong.rDelimAst,"g").replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimUnd=At(be.emStrong.rDelimUnd,"g").replace(/punct/g,be._punctuation).getRegex();be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;be._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])?)+(?![-_])/;be.autolink=At(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex();be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;be.tag=At(be.tag).replace("comment",be._comment).replace("attribute",be._attribute).getRegex();be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;be.link=At(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex();be.reflink=At(be.reflink).replace("label",be._label).replace("ref",Be._label).getRegex();be.nolink=At(be.nolink).replace("ref",Be._label).getRegex();be.reflinkSearch=At(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex();be.normal={...be};be.pedantic={...be.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:At(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()};be.gfm={...be.normal,escape:At(be.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.!#$%&'*+\/=?_`{\|}~-]+@)))/};be.gfm.url=At(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex();be.breaks={...be.gfm,br:At(be.br).replace("{2,}","*").getRegex(),text:At(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function Ap(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 su(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Er{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Zr,this.options.tokenizer=this.options.tokenizer||new Nl,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:Be.normal,inline:be.normal};this.options.pedantic?(n.block=Be.pedantic,n.inline=be.pedantic):this.options.gfm&&(n.block=Be.gfm,this.options.breaks?n.inline=be.breaks:n.inline=be.gfm),this.tokenizer.rules=n}static get rules(){return{block:Be,inline:be}}static lex(t,n){return new Er(n).lex(t)}static lexInline(t,n){return new Er(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
16
+ `),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,s,u)=>s+" ".repeat(u.length));let r,i,o,l;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+=`
17
+ `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
18
+ `+r.raw,i.text+=`
19
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.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),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
20
+ `+r.raw,i.text+=`
21
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.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(o=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const s=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},s),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],l&&i.type==="paragraph"?(i.raw+=`
22
+ `+r.raw,i.text+=`
23
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),l=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
24
+ `+r.raw,i.text+=`
25
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.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,i,o,l=t,a,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,a.index+a[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.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),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.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),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,l,u)){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,su)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,su))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,Ap)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),s=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Bl{constructor(t){this.options=t||Zr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+`
26
+ `,i?'<pre><code class="'+this.options.langPrefix+yn(i)+'">'+(r?t:yn(t,!0))+`</code></pre>
27
+ `:"<pre><code>"+(r?t:yn(t,!0))+`</code></pre>
28
+ `}blockquote(t){return`<blockquote>
29
+ ${t}</blockquote>
30
+ `}html(t){return t}heading(t,n,r,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${t}</h${n}>
31
+ `}return`<h${n}>${t}</h${n}>
32
+ `}hr(){return this.options.xhtml?`<hr/>
33
+ `:`<hr>
34
+ `}list(t,n,r){const i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`>
35
+ `+t+"</"+i+`>
36
+ `}listitem(t){return`<li>${t}</li>
37
+ `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
38
+ `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
39
+ <thead>
40
+ `+t+`</thead>
41
+ `+n+`</table>
42
+ `}tablerow(t){return`<tr>
43
+ ${t}</tr>
44
+ `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
45
+ `}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=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class Kc{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 Zc{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,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Tr{constructor(t){this.options=t||Zr,this.options.renderer=this.options.renderer||new Bl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Kc,this.slugger=new Zc}static parse(t,n){return new Tr(n).parse(t)}static parseInline(t,n){return new Tr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,k,E,M,I;const P=t.length;for(i=0;i<P;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(I=this.options.extensions.renderers[h.type].call({parser:this},h),I!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=I||"";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,qc(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="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",s=u.length,l=0;l<s;l++)c+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=h.ordered,m=h.start,y=h.loose,a=h.items.length,g="",o=0;o<a;o++)b=h.items[o],k=b.checked,E=b.task,v="",b.task&&(M=this.renderer.checkbox(k),y?b.tokens.length>0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=M+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=M+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:M}):v+=M),v+=this.parse(b.tokens,y),g+=this.renderer.listitem(v,E,k);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<P&&t[i+1].type==="text";)h=t[++i],g+=`
46
+ `+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const S='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(S);return}else throw new Error(S)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,l;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(l=this.options.extensions.renderers[o.type].call({parser:this},o),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=l||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(s);return}else throw new Error(s)}}}return r}}class yl{constructor(t){this.options=t||Zr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function _p(e,t,n){return r=>{if(r.message+=`
47
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+yn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function Jc(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...We.defaults,...o};const l=_p(r.silent,r.async,i);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Lp(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(d){return l(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&We.walkTokens(s,r.walkTokens),g=t(s,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?l(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!s.length))return u();let c=0;We.walkTokens(s,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();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(We.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&We.walkTokens(a,r.walkTokens);let s=t(a,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(a){return l(a)}}}function We(e,t,n){return Jc(Er.lex,Tr.parse)(e,t,n)}We.options=We.setOptions=function(e){return We.defaults={...We.defaults,...e},yp(We.defaults),We};We.getDefaults=Xc;We.defaults=Zr;We.use=function(...e){const t=We.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=We.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=We.defaults.renderer||new Bl;for(const o in n.renderer){const l=i[o];i[o]=(...a)=>{let s=n.renderer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.renderer=i}if(n.tokenizer){const i=We.defaults.tokenizer||new Nl;for(const o in n.tokenizer){const l=i[o];i[o]=(...a)=>{let s=n.tokenizer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.tokenizer=i}if(n.hooks){const i=We.defaults.hooks||new yl;for(const o in n.hooks){const l=i[o];yl.passThroughHooks.has(o)?i[o]=a=>{if(We.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>l.call(i,u));const s=n.hooks[o].call(i,a);return l.call(i,s)}:i[o]=(...a)=>{let s=n.hooks[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.hooks=i}if(n.walkTokens){const i=We.defaults.walkTokens;r.walkTokens=function(o){let l=[];return l.push(n.walkTokens.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}We.setOptions(r)})};We.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(We,r)),r.type){case"table":{for(const i of r.header)n=n.concat(We.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(We.walkTokens(o.tokens,t));break}case"list":{n=n.concat(We.walkTokens(r.items,t));break}default:We.defaults.extensions&&We.defaults.extensions.childTokens&&We.defaults.extensions.childTokens[r.type]?We.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(We.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(We.walkTokens(r.tokens,t)))}return n};We.parseInline=Jc(Er.lexInline,Tr.parseInline);We.Parser=Tr;We.parser=Tr.parse;We.Renderer=Bl;We.TextRenderer=Kc;We.Lexer=Er;We.lexer=Er.lex;We.Tokenizer=Nl;We.Slugger=Zc;We.Hooks=yl;We.parse=We;We.options;We.setOptions;We.use;We.walkTokens;We.parseInline;Tr.parse;Er.lex;const Hp=sn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class zp extends $t.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=We(r),l=document.createRange();l.selectNodeContents(t),l.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const s=t.getElementsByTagName("a");for(const u of s)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),$t.createElement(Hp,{ref:this.containerRefHook})}}const Vp=sn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),$p=sn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Np=sn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let uu=0;const Jr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:l,...a}=e,{onChange:s,className:u}=a,c=f.useRef(null),d=n??"";_n(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(uu=(uu+1)%1e7));f.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=d.toString().length;p.focus(),p.setSelectionRange(i?0:m,m)},[]),f.useLayoutEffect(()=>{if(l!==void 0){const p=typeof l=="number"?[l,null]:l;c.current?.setSelectionRange(p[0],p[1])}},[l]);const h=f.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&o===!0||r?.(p)},[o,r]);return f.createElement(Np,{className:"gdg-growing-entry"},f.createElement($p,{className:u},d+`
48
+ `),f.createElement(Vp,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},el={};let Sr=null;function Bp(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function ho(e){const t=e.toLowerCase().trim();if(el[t]!==void 0)return el[t];Sr=Sr||Bp(),Sr.style.color="#000",Sr.style.color=t;const n=getComputedStyle(Sr).color;Sr.style.color="#fff",Sr.style.color=t;const r=getComputedStyle(Sr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),el[t]=i,i}function qr(e,t){const[n,r,i]=ho(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const cu=new Map;function du(e,t){const n=`${e}-${t}`,r=cu.get(n);if(r!==void 0)return r;const i=Hn(e,t);return cu.set(n,i),i}function Hn(e,t){if(t===void 0)return e;const[n,r,i,o]=ho(e);if(o===1)return e;const[l,a,s,u]=ho(t),c=o+u*(1-o),d=(o*n+u*l*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*s*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}function Cl(e){if(e==="transparent")return 0;function t(o){const l=o/255;return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}const[n,r,i]=ho(e);return .2126*t(n)+.7152*t(r)+.0722*t(i)}var ki=new Map,Ri=new Map,Sl=new Map;function Wp(){ki.clear(),Sl.clear(),Ri.clear()}function Up(e,t,n,r,i){var o,l,a;let s=0,u={};for(let d of e)s+=(o=n.get(d))!=null?o:i,u[d]=((l=u[d])!=null?l:0)+1;let c=t-s;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,p=h*g/s,m=c*p*r/g,y=h+m;n.set(d,y)}}function Gp(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,l=3,a=(t/o+l)/(l+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function lo(e,t,n,r){var i,o;let l=Ri.get(n);if(r&&l!==void 0&&l.count>2e4){let u=Sl.get(n);if(u===void 0&&(u=Gp(e,l.size),Sl.set(n,u)),l.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:l.size;return d*1.01}let c=e.measureText(t);return Up(t,c.width,u,Math.max(.05,1-l.count/2e5),l.size),Ri.set(n,{count:l.count+t.length,size:l.size}),c.width}let a=e.measureText(t),s=a.width/t.length;if(((o=l?.count)!=null?o:0)>2e4)return a.width;if(l===void 0)Ri.set(n,{count:t.length,size:s});else{let u=s-l.size,c=t.length/(l.count+t.length),d=l.size+u*c;Ri.set(n,{count:l.count+t.length,size:d})}return a.width}function Xp(e,t,n,r,i,o,l,a){if(t.length<=1)return t.length;if(i<n)return-1;let s=Math.floor(n/i*o),u=lo(e,t.slice(0,Math.max(0,s)),r,l);if(u!==n)if(u<n){for(;u<n;)s++,u=lo(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=lo(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function Yp(e,t,n,r,i,o){let l=`${t}_${n}_${r}px`,a=ki.get(l);if(a!==void 0)return a;if(r<=0)return[];let s=[],u=t.split(`
49
+ `),c=Ri.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let p=lo(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d);if(p<=r)s.push(h);else{for(;p>r;){let y=Xp(e,h,r,n,p,m,g),v=h.slice(0,Math.max(0,y));h=h.slice(v.length),s.push(v),p=lo(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d)}p>0&&s.push(h)}}return s=s.map((h,p)=>p===0?h.trimEnd():h.trim()),ki.set(l,s),ki.size>500&&ki.delete(ki.keys().next().value),s}function jp(e,t){return $t.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function qp(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(so(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function go(e,t){return(e??"")===(t??"")}function Kp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Qc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function so(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function ed(e){return[e.x+e.width-1,e.y+e.height-1]}function fu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,l=n.y+n.height-1,[a,s]=e;if(s<o||s>l)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Zp(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&fu(e,t,o)&&i++;for(const l of n.current.rangeStack)fu(e,t,l)&&i++;return i}function td(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,l)=>({...o,sticky:e[l].sticky})),n=r}return n}function Oi(e,t){let n=0;const r=td(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function Qr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function xl(e,t,n,r,i){const o=td(e,r),l=[];for(const u of o)if(u.sticky)l.push(u);else break;if(l.length>0)for(const u of l)n-=u.width;let a=t,s=i??0;for(;s<=n&&a<o.length;)s+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||l.push(c)}return l}function Jp(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Qp(e,t,n,r,i,o,l,a,s,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let p=0;p<u;p++){const m=o-1-p,y=typeof l=="number"?l:l(m);if(d-=y,e>=d)return m}const g=o-u,h=e-(s??0);if(typeof l=="number"){const p=Math.floor((h-c)/l)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const y=l(m);if(h<=p+y)return m;p+=y}return}}let ta=0,uo={};const em=typeof window>"u";async function tm(){em||document?.fonts?.ready===void 0||(await document.fonts.ready,ta=0,uo={},Wp())}tm();function nd(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Dr(e,t,n,r="middle"){const i=nd(e,t,r,n);let o=uo[i];return o===void 0&&(o=t.measureText(e),uo[i]=o,ta++),ta>1e4&&(uo={},ta=0),o}function rd(e,t){const n=nd(e,void 0,"middle",t);return uo[n]}function Qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),nm(e,t)}function hu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const gu=[];function nm(e,t){for(const o of gu)if(o.key===t)return o.val;const n=hu(e,"alphabetic"),i=-(hu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return gu.push({key:t,val:i}),i}function rm(e,t,n,r,i,o){const{ctx:l,rect:a,theme:s}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;l.globalAlpha=d,l.fillStyle=s.bgSearchResult,l.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),l.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function So(e,t,n){const{ctx:r,theme:i}=e,o=t??{},l=n??i.textDark;return l!==o.fillStyle&&(r.fillStyle=l,o.fillStyle=l),o}function Wl(e,t,n,r,i){const{rect:o,ctx:l,theme:a}=e;l.fillStyle=a.textDark,ar({ctx:l,rect:o,theme:a},t,n,r,i)}function id(e,t,n,r,i,o,l,a,s){s==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+l):s==="center"?e.fillText(t,n+i/2,r+o/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+l)}function Ul(e,t){const n=Dr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function im(e,t){e.includes(`
50
+ `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function om(e,t,n,r,i,o,l,a,s,u){const c=a.baseFontFull,d=Yp(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Ul(e,c),h=a.lineHeight*g,p=g+h*(d.length-1),m=p+a.cellVerticalPadding>o;m&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-p/2;let v=Math.max(r+a.cellVerticalPadding,y);for(const b of d)if(id(e,b,n,v,i,g,l,a,s),v+=h,v>r+o)break;m&&e.restore()}function ar(e,t,n,r,i){const{ctx:o,rect:l,theme:a}=e,{x:s,y:u,width:c,height:d}=l;r=r??!1,r||(t=im(t,c));const g=Qn(o,a),h=$l(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let p=!1;n==="right"?(o.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,p=!0),r?om(o,t,s,u,c,d,g,a,n,i):id(o,t,s,u,c,d,g,a,n),p&&(o.textAlign="start"),h&&(o.direction="inherit")}}function Zn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function am(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function lm(e,t,n){const r=function(a,s){const u=s.x-a.x,c=s.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:s.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let l=t[o-1];for(let a=0;a<o;a++){let s=t[a%o];const u=t[(a+1)%o],c=r(s,l),d=r(s,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,y=!1;h<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,y=!0):p>0&&(m=-1,y=!0),i=s.radius!==void 0?s.radius:n;const v=p/2;let b=Math.abs(Math.cos(v)*i/Math.sin(v)),k;b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),k=Math.abs(b*Math.sin(v)/Math.cos(v))):k=i;let E=s.x+d.nx*b,M=s.y+d.ny*b;E+=-d.ny*k*m,M+=d.nx*k*m,e.arc(E,M,k,c.ang+Math.PI/2*m,d.ang-Math.PI/2*m,y),l=s,s=u}e.closePath()}function kl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return m;const y=o-i;if(e>=d){const v=l>e?-1:1,b=Oi(h);m.x+=b+s;for(let k=l;k!==e;k+=v)m.x+=h[v===1?k:k-1].width*v}else for(let v=0;v<e;v++)m.x+=h[v].width;if(m.width=h[e].width+1,t===-1)m.y=i,m.height=y;else if(t===-2){m.y=0,m.height=i;let v=e;const b=h[e].group,k=h[e].sticky;for(;v>0&&go(h[v-1].group,b)&&h[v-1].sticky===k;){const M=h[v-1];m.x-=M.width,m.width+=M.width,v--}let E=e;for(;E+1<h.length&&go(h[E+1].group,b)&&h[E+1].sticky===k;){const M=h[E+1];m.width+=M.width,E++}if(!k){const M=Oi(h),I=m.x-M;I<0&&(m.x-=I,m.width+=I),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let v=c-t;for(m.y=r;v>0;){const b=t+v-1;m.height=typeof p=="number"?p:p(b),m.y-=m.height,v--}m.height+=1}else{const v=a>t?-1:1;if(typeof p=="number"){const b=t-a;m.y+=b*p}else for(let b=a;b!==t;b+=v)m.y+=p(b)*v;m.height=(typeof p=="number"?p:p(t))+1}return m}const Gl=1<<21;function Kn(e,t){return(t+2)*Gl+e}function od(e){return e%Gl}function Xl(e){return Math.floor(e/Gl)-2}function Yl(e){const t=od(e),n=Xl(e);return[t,n]}class ad{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=od(t),r=Xl(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,l=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&l};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Di(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class sm extends ad{cache=new Map;setValue=(t,n)=>{this.cache.set(Kn(t[0],t[1]),n)};getValue=t=>this.cache.get(Kn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class co{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Kn(n[0],n[1])))}add(t){this.cells.add(Kn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Kn(t[0],t[1]))}remove(t){this.cells.delete(Kn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Xl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Kn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Yl(t)}}function um(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const ld={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function sd(){return ld}const ud=$t.createContext(ld);function cd(){return $t.useContext(ud)}function hr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Hn(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Ml=150;function cm(e,t,n,r){return r(t)?.measure?.(e,t,n)??Ml}function dd(e,t,n,r,i,o,l,a,s){let u=0;const c=i===void 0?[]:i.map(h=>{const p=cm(e,h[r],t,s);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let h=0;for(const m of c)h+=m;const p=h/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:g}}function dm(e,t,n,r,i,o,l,a,s){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(l);u.current=t,c.current=n,d.current=l;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const b=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",[b,b.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=f.useRef({}),m=f.useRef(),[y,v]=f.useState();return f.useLayoutEffect(()=>{const b=c.current;if(b===void 0||e.every(Vo))return;let k=Math.max(1,10-Math.floor(e.length/1e4)),E=0;k<u.current&&k>1&&(k--,E=1);const M={x:0,y:0,width:e.length,height:Math.min(u.current,k)},I={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const S=b(M,s.signal),C=E>0?b(I,s.signal):void 0;let F;typeof S=="object"?F=S:F=await Vs(S),C!==void 0&&(typeof C=="object"?F=[...F,...C]:F=[...F,...await Vs(C)]),m.current=e,v(F)})()},[s.signal,e]),f.useMemo(()=>{let k=e.every(Vo)?e:h===null?e.map(P=>Vo(P)?P:{...P,width:Ml}):(h.font=d.current.baseFontFull,e.map((P,S)=>{if(Vo(P))return P;if(p.current[P.id]!==void 0)return{...P,width:p.current[P.id]};if(y===void 0||m.current!==e||P.id===void 0)return{...P,width:Ml};const C=dd(h,l,P,S,y,i,o,!0,a);return p.current[P.id]=C.width,C})),E=0,M=0;const I=[];for(const[P,S]of k.entries())E+=S.width,S.grow!==void 0&&S.grow>0&&(M+=S.grow,I.push(P));if(E<r&&I.length>0){const P=[...k],S=r-E;let C=S;for(let F=0;F<I.length;F++){const T=I[F],x=(k[T].grow??0)/M,D=F===I.length-1?C:Math.min(C,Math.floor(S*x));P[T]={...k[T],growOffset:D,width:k[T].width+D},C-=D}k=P}return{sizedColumns:k,nonGrowWidth:E}},[r,e,h,y,l,i,o,a])}const Nt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',fm=e=>{const t=e.fgColor,n=e.bgColor;return`
51
+ ${Nt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},hm=e=>{const t=e.fgColor,n=e.bgColor;return`
52
+ ${Nt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},gm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
53
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
54
+ <path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
55
+ </svg>`},pm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
56
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
57
+ <path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
58
+ </svg>`},mm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
59
+ <path
60
+ d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
61
+ fill="${n}"
62
+ />
63
+ <path
64
+ fill-rule="evenodd"
65
+ clip-rule="evenodd"
66
+ d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
67
+ fill="${t}"
68
+ />
69
+ </svg>`},fd=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
70
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
71
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
72
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
73
+ </svg>
74
+ `},vm=e=>{const t=e.bgColor;return`${Nt}
75
+ <path stroke="${t}" stroke-width="2" d="M12 3v14"/>
76
+ <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
77
+ <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
78
+ </svg>
79
+ `},bm=fd,wm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
80
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
81
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
82
+ </svg>`},ym=e=>{const t=e.fgColor,n=e.bgColor;return`
83
+ ${Nt}
84
+ <path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
85
+ <path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
86
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
87
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
88
+ <path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
89
+ <path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
90
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
91
+ </svg>`},Cm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
92
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
93
+ <path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
94
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
95
+ </svg>`},Sm=e=>{const t=e.fgColor,n=e.bgColor;return`
96
+ ${Nt}
97
+ <path fill="${t}" d="M3 3h14v14H3z"/>
98
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
99
+ </svg>`},xm=e=>{const t=e.fgColor,n=e.bgColor;return`
100
+ ${Nt}
101
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
102
+ <path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
103
+ </svg>`},km=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
104
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
105
+ <path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
106
+ </svg>`},Mm=e=>{const t=e.fgColor,n=e.bgColor;return`
107
+ ${Nt}
108
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
109
+ <path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
110
+ <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
111
+ </svg>`},Rm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
112
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
113
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
114
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
115
+ </svg>`},Im=e=>{const t=e.fgColor,n=e.bgColor;return`
116
+ ${Nt}
117
+ <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
118
+ <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
119
+ <path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
120
+ </svg>`},Em=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
121
+ <path fill="${t}" d="M4 3h12v14H4z"/>
122
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
123
+ </svg>`},Tm=e=>{const t=e.fgColor,n=e.bgColor;return`
124
+ ${Nt}
125
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
126
+ <path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
127
+ </svg>`},Dm=e=>{const t=e.fgColor,n=e.bgColor;return`
128
+ ${Nt}
129
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
130
+ <path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
131
+ </svg>`},Om=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
132
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
133
+ <path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
134
+ </svg>`},Pm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
135
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
136
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
137
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
138
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
139
+ <path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
140
+ </svg>`},Lm=e=>{const t=e.fgColor,n=e.bgColor;return`
141
+ ${Nt}
142
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
143
+ <path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
144
+ </svg>`},Fm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
145
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
146
+ <path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
147
+ </svg>`},Am=e=>{const t=e.fgColor,n=e.bgColor;return`
148
+ ${Nt}
149
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
150
+ <path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
151
+ </svg>`},_m=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
152
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
153
+ <path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
154
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
155
+ </svg>`},Hm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
156
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
157
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
158
+ </svg>`},zm=e=>{const t=e.fgColor;return`
159
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
160
+ <path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
161
+ </svg>`},Vm=e=>{const t=e.fgColor;return`
162
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
163
+ <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
164
+ </svg>
165
+ `},$m={headerRowID:fm,headerNumber:gm,headerCode:hm,headerString:pm,headerBoolean:mm,headerAudioUri:bm,headerVideoUri:wm,headerEmoji:ym,headerImage:Cm,headerUri:fd,headerPhone:Sm,headerMarkdown:xm,headerDate:km,headerTime:Mm,headerEmail:Rm,headerReference:Im,headerIfThenElse:Em,headerSingleValue:Tm,headerLookup:Dm,headerTextTemplate:Om,headerMath:Pm,headerRollup:Lm,headerJoinStrings:Fm,headerSplitString:Am,headerGeoDistance:_m,headerArray:Hm,rowOwnerOverlay:zm,protectedColumnOverlay:Vm,renameIcon:vm};function Nm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Bm{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,l,a,s=1){const[u,c]=Nm(n,a),d=l*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const p=this.headerIcons[t];if(p===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const v=y.decode();if(v===void 0)return;this.inFlight++,v.then(()=>{m.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(h,0,0,d,d,i,o,l,l),s<1&&(r.globalAlpha=1)}}function hd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function ka(e,t,n,r,i,o,l,a,s){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&s(u,c,h,!1,l&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const p=i(c);u-=p,s(u,c,p,!0,l&&c===r-1)}}}function Or(e,t,n,r,i,o){let l=0,a=0;const s=i+r;for(const u of e){const c=u.sticky?a:l+n;if(o(u,c,s,u.sticky?0:a,t)===!0)break;l+=u.width,a+=u.sticky?u.width:0}}function gd(e,t,n,r,i){let o=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let u=a+1,c=s.width;for(s.sticky&&(l+=c);u<e.length&&go(e[u].group,s.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(l+=m.width)}const d=s.sticky?0:n,g=o+d,h=s.sticky?0:Math.max(0,l-g),p=Math.min(c-h,t-(g+h));i([s.sourceIndex,e[u-1].sourceIndex],s.group??"",g+h,0,p,r),o+=c}}function pd(e,t,n,r,i,o,l){const[a,s]=e;let u,c;const d=l.find(g=>!g.sticky)?.sourceIndex??0;if(s>d){const g=Math.max(a,d);let h=t,p=r;for(let m=o.sourceIndex-1;m>=g;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=s;m++)p+=l[m].width;c={x:h,y:n,width:p,height:i}}if(d>a){const g=Math.min(s,d-1);let h=t,p=r;for(let m=o.sourceIndex-1;m>=a;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=g;m++)p+=l[m].width;u={x:h,y:n,width:p,height:i}}return[u,c]}function Wm(e,t,n,r){if(r==="any")return md(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),Qc([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,l=n-e.y+1,a=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:l,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return s===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===l?{x:e.x,y:n,width:e.width,height:e.y-n}:s===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function po(e,t,n,r,i,o,l,a){return e<=i+l&&i<=e+n&&t<=o+a&&o<=t+r}function jr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function md(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Um(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Gm(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,l=t+4,a=n+4,s=i-e.x,u=e.x+e.width-l,c=o-e.y,d=e.y+e.height-a,g=s>0?e.x+Math.floor(s/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:p,width:h-g,height:m-p}}function Xm(e,t,n,r,i){const[o,l,a,s]=t,[u,c,d,g]=i,{x:h,y:p,width:m,height:y}=e,v=[];if(m<=0||y<=0)return v;const b=h+m,k=p+y,E=h<o,M=p<l,I=h+m>a,P=p+y>s,S=h>=o&&h<a||b>o&&b<=a||h<o&&b>a,C=p>=l&&p<s||k>l&&k<=s||p<l&&k>s;if(S&&C){const T=Math.max(h,o),x=Math.max(p,l),D=Math.min(b,a),O=Math.min(k,s);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(E&&M){const T=h,x=p,D=Math.min(b,o),O=Math.min(k,l);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:0,y:0,width:u+1,height:c+1}})}if(M&&S){const T=Math.max(h,o),x=p,D=Math.min(b,a),O=Math.min(k,l);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(M&&I){const T=Math.max(h,a),x=p,D=b,O=Math.min(k,l);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(E&&C){const T=h,x=Math.max(p,l),D=Math.min(b,o),O=Math.min(k,s);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(I&&C){const T=Math.max(h,a),x=Math.max(p,l),D=b,O=Math.min(k,s);v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(E&&P){const T=h,x=Math.max(p,s),D=Math.min(b,o),O=k;v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&S){const T=Math.max(h,o),x=Math.max(p,s),D=Math.min(b,a),O=k;v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(I&&P){const T=Math.max(h,a),x=Math.max(p,s),D=b,O=k;v.push({rect:{x:T,y:x,width:D-T,height:O-x},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return v}const Ym={kind:Z.Loading,allowOverlay:!1};function pu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,k,E,M,I,P,S,C,F,T,x,D,O,R,N,W,j){let oe=k?.size??Number.MAX_SAFE_INTEGER;const Q=performance.now();let re=D.baseFontFull;e.font=re;const ue={ctx:e},ae=[0,0],de=y>0?Qr(s,y,u):0;let he,ce;const H=hd(b);return Or(t,a,o,l,i,(L,Y,se,le,ve)=>{const ge=Math.max(0,le-Y),Je=Y+ge,ke=i+1,Pt=L.width-ge,xt=r-i-1;if(b.length>0){let Pe=!1;for(let Ee=0;Ee<b.length;Ee++){const st=b[Ee];if(po(Je,ke,Pt,xt,st.x,st.y,st.width,st.height)){Pe=!0;break}}if(!Pe)return}const Oe=()=>{e.save(),e.beginPath(),e.rect(Je,ke,Pt,xt),e.clip()},te=E.columns.hasIndex(L.sourceIndex),me=d(L.group??"").overrideTheme,we=L.themeOverride===void 0&&me===void 0?D:hr(D,me,L.themeOverride),ne=we.baseFontFull;ne!==re&&(re=ne,e.font=ne),Oe();let ye;return ka(ve,se,r,s,u,y,v,H,(Pe,Ee,st,Fe,Ye)=>{if(Ee<0||(ae[0]=L.sourceIndex,ae[1]=Ee,k!==void 0&&!k.has(ae)))return;if(b.length>0){let Ie=!1;for(let mt=0;mt<b.length;mt++){const Tt=b[mt];if(po(Y,Pe,L.width,st,Tt.x,Tt.y,Tt.width,Tt.height)){Ie=!0;break}}if(!Ie)return}const Te=E.rows.hasIndex(Ee),Re=h.hasIndex(Ee),He=Ee<s?c(ae):Ym;let ht=Y,tt=L.width,je=!1,gt=!1;if(He.span!==void 0){const[Ie,mt]=He.span,Tt=`${Ee},${Ie},${mt},${L.sticky}`;if(ce===void 0&&(ce=new Set),ce.has(Tt)){oe--;return}else{const dn=pd(He.span,Y,Pe,L.width,st,L,n),Bt=L.sticky?dn[0]:dn[1];if(!L.sticky&&dn[0]!==void 0&&(gt=!0),Bt!==void 0){ht=Bt.x,tt=Bt.width,ce.add(Tt),e.restore(),ye=void 0,e.save(),e.beginPath();const rn=Math.max(0,le-Bt.x);e.rect(Bt.x+rn,Pe,Bt.width-rn,st),he===void 0&&(he=[]),he.push({x:Bt.x+rn,y:Pe,width:Bt.width-rn,height:st}),e.clip(),je=!0}}}const Gt=g?.(Ee),Dt=Ye&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,ct=He.themeOverride===void 0&&Gt===void 0&&Dt===void 0?we:hr(we,Gt,Dt,He.themeOverride);e.beginPath();const qt=Kp(ae,He,E);let Kt=Zp(ae,He,E,m);const Dn=He.span!==void 0&&E.columns.some(Ie=>He.span!==void 0&&Ie>=He.span[0]&&Ie<=He.span[1]);qt&&!p&&m?Kt=0:qt&&m&&(Kt=Math.max(Kt,1)),Dn&&Kt++,qt||(Te&&Kt++,te&&!Ye&&Kt++);const It=He.kind===Z.Protected?ct.bgCellMedium:ct.bgCell;let pt;if((Fe||It!==D.bgCell)&&(pt=Hn(It,pt)),Kt>0||Re){Re&&(pt=Hn(ct.bgHeader,pt));for(let Ie=0;Ie<Kt;Ie++)pt=Hn(ct.accentLight,pt)}else if(M!==void 0){for(const Ie of M)if(Ie[0]===L.sourceIndex&&Ie[1]===Ee){pt=Hn(ct.bgSearchResult,pt);break}}if(I!==void 0)for(let Ie=0;Ie<I.length;Ie++){const mt=I[Ie],Tt=mt.range;mt.style!=="solid-outline"&&Tt.x<=L.sourceIndex&&L.sourceIndex<Tt.x+Tt.width&&Tt.y<=Ee&&Ee<Tt.y+Tt.height&&(pt=Hn(mt.color,pt))}let On=!1;if(k!==void 0){const Ie=Pe+1,Tt=(Fe?Ie+st-1:Math.min(Ie+st-1,r-de))-Ie;(Tt!==st-1||ht+1<=le)&&(On=!0,e.save(),e.beginPath(),e.rect(ht+1,Ie,tt-1,Tt),e.clip()),pt=pt===void 0?ct.bgCell:Hn(pt,ct.bgCell)}const Ct=L.sourceIndex===n.length-1,un=Ee===s-1;pt!==void 0&&(e.fillStyle=pt,ye!==void 0&&(ye.fillStyle=pt),k!==void 0?e.fillRect(ht+1,Pe+1,tt-(Ct?2:1),st-(un?2:1)):e.fillRect(ht,Pe,tt,st)),He.style==="faded"&&(e.globalAlpha=.6);let gn;for(let Ie=0;Ie<C.length;Ie++){const mt=C[Ie];if(mt.item[0]===L.sourceIndex&&mt.item[1]===Ee){gn=mt;break}}if(tt>j&&!gt){const Ie=ct.baseFontFull;Ie!==re&&(e.font=Ie,re=Ie),ye=vd(e,He,L.sourceIndex,Ee,Ct,un,ht,Pe,tt,st,Kt>0,ct,pt??ct.bgCell,P,S,gn?.hoverAmount??0,F,x,Q,T,ye,O,R,N,W)}return On&&e.restore(),He.style==="faded"&&(e.globalAlpha=1),oe--,je&&(e.restore(),ye?.deprep?.(ue),ye=void 0,Oe(),re=ne,e.font=ne),oe<=0}),e.restore(),oe<=0}),he}const Ji=[0,0],Qi={x:0,y:0,width:0,height:0},tl=[void 0,()=>{}];let Rl=!1;function jm(){Rl=!0}function vd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,k,E,M,I,P,S){let C,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(C=y[1][0],F=y[1][1]);let T;Ji[0]=n,Ji[1]=r,Qi.x=l,Qi.y=a,Qi.width=s,Qi.height=u,tl[0]=I.getValue(Ji),tl[1]=R=>I.setValue(Ji,R),Rl=!1;const x={ctx:e,theme:d,col:n,row:r,cell:t,rect:Qi,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:b,hoverX:C,drawState:tl,hoverY:F,imageLoader:h,spriteManager:p,hyperWrapping:v,overrideCursor:C!==void 0?S:void 0,requestAnimationFrame:jm},D=rm(x,t.lastUpdated,b,E,i,o),O=P(t);if(O!==void 0){E?.renderer!==O&&(E?.deprep?.(x),E=void 0);const R=O.drawPrep?.(x,E);k!==void 0&&!Mi(x.cell)?k(x,()=>O.draw(x,t)):O.draw(x,t),T=R===void 0?void 0:{deprep:R?.deprep,fillStyle:R?.fillStyle,font:R?.font,renderer:O}}return(D||Rl)&&M?.(Ji),T}function jl(e,t,n,r,i,o,l,a,s=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+l/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Wc(c??t.checkboxMaxSize,l,t.cellVerticalPadding),y=m/2;const v=Bc(d,r,o,t.cellHorizontalPadding,m),b=Nc(v,h,m),k=Uc(r+s,i+u,b);switch(n){case!0:{e.beginPath(),Zn(e,v-m/2,h-m/2,m,m,p),g==="circle"&&(y*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+m/4.23,h-y+m/1.97),e.lineTo(v-y+m/2.42,h-y+m/1.44),e.lineTo(v-y+m/1.29,h-y+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case aa:case!1:{e.beginPath(),Zn(e,v-m/2+.5,h-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=k?t.textDark:t.textMedium,e.stroke();break}case _l:{e.beginPath(),Zn(e,v-m/2,h-m/2,m,m,p),e.fillStyle=k?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,m*=.8),e.beginPath(),e.moveTo(v-m/3,h),e.lineTo(v+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:fo()}}function qm(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){const k=l+a;if(k<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,k);const E=r?.[0]?.[0],M=r?.[0]?.[1],I=r?.[1]?.[0],P=r?.[1]?.[1],S=d.headerFontFull;e.font=S,Or(t,0,o,0,k,(C,F,T,x)=>{if(y!==void 0&&!y.has([C.sourceIndex,-1]))return;const D=Math.max(0,x-F);e.save(),e.beginPath(),e.rect(F+D,a,C.width-D,l),e.clip();const O=m(C.group??"").overrideTheme,R=C.themeOverride===void 0&&O===void 0?d:hr(d,O,C.themeOverride);R.bgHeader!==d.bgHeader&&(e.fillStyle=R.bgHeader,e.fill()),R!==d&&(e.font=R.headerFontFull);const N=c.columns.hasIndex(C.sourceIndex),W=s!==void 0||u||C.headerRowMarkerDisabled===!0,j=!W&&M===-1&&E===C.sourceIndex,oe=W?0:h.find(de=>de.item[0]===C.sourceIndex&&de.item[1]===-1)?.hoverAmount??0,Q=c?.current!==void 0&&c.current.cell[0]===C.sourceIndex,re=N?R.accentColor:Q?R.bgHeaderHasFocus:R.bgHeader,ue=n?a:0,ae=C.sourceIndex===0?0:1;N?(e.fillStyle=re,e.fillRect(F+ae,ue,C.width-ae,l)):(Q||oe>0)&&(e.beginPath(),e.rect(F+ae,ue,C.width-ae,l),Q&&(e.fillStyle=R.bgHeaderHasFocus,e.fill()),oe>0&&(e.globalAlpha=oe,e.fillStyle=R.bgHeaderHovered,e.fill(),e.globalAlpha=1)),yd(e,F,ue,C.width,l,C,N,R,j,j?I:void 0,j?P:void 0,Q,oe,g,v,b),e.restore()}),n&&Km(e,t,i,o,a,r,d,g,h,p,m,y)}function Km(e,t,n,r,i,o,l,a,s,u,c,d){const[h,p]=o?.[0]??[];let m=0;gd(t,n,r,i,(y,v,b,k,E,M)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(b,k,E,M),e.clip();const I=c(v),P=I?.overrideTheme===void 0?l:hr(l,I.overrideTheme),S=p===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=S?P.bgGroupHeaderHovered??P.bgHeaderHovered:P.bgGroupHeader??P.bgHeader;if(C!==l.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,I!==void 0){let F=b;if(I.icon!==void 0&&(a.drawSprite(I.icon,"normal",e,F+8,(i-20)/2,20,P),F+=26),e.fillText(I.name,F+8,i/2+Qn(e,l.headerFontFull)),I.actions!==void 0&&S){const T=bd({x:b,y:k,width:E,height:M},I.actions);e.beginPath();const x=T[0].x-10,D=b+E-x;e.rect(x,0,D,i);const O=e.createLinearGradient(x,0,x+D,0),R=qr(C,0);O.addColorStop(0,R),O.addColorStop(10/D,C),O.addColorStop(1,C),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[N,W]=o?.[1]??[-1,-1];for(let j=0;j<I.actions.length;j++){const oe=I.actions[j],Q=T[j],re=jr(Q,N+b,W);re&&(e.globalAlpha=1),a.drawSprite(oe.icon,"normal",e,Q.x+Q.width/2-10,Q.y+Q.height/2-10,20,P),re&&(e.globalAlpha=.6)}e.globalAlpha=1}}b!==0&&u(y[0])&&(e.beginPath(),e.moveTo(b+.5,0),e.lineTo(b+.5,i),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=b+E}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()}const Uo=30;function Zm(e,t,n,r,i){return{x:e+n-Uo,y:Math.max(t,t+r/2-Uo/2),width:Uo,height:Math.min(Uo,r)}}function bd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,l=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:l,height:o}),r+=26;return n}function eo(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function wd(e,t,n,r,i,o,l,a){const s=l.cellHorizontalPadding,u=l.headerIconSize,c=Zm(n,r,i,o);let d=n+s;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const p={x:d,y:r,width:i-d,height:o};let m;if(t.indicatorIcon!==void 0){const v=e===void 0?rd(t.title,l.headerFontFull)?.width??0:Dr(t.title,e,l.headerFontFull).width;p.width=v,d+=v+s,m={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:eo(c,y,a),iconBounds:eo(g,y,a),iconOverlayBounds:eo(h,y,a),textBounds:eo(p,y,a),indicatorIconBounds:eo(m,y,a)}}function mu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const b=o.rowMarkerChecked;b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const k=o.headerRowMarkerTheme!==void 0?hr(a,o.headerRowMarkerTheme):a;jl(e,k,b,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=l?a.textHeaderSelected:a.textHeader,v=o.hasMenu===!0&&(s||h&&l)&&m.menuBounds!==void 0;if(o.icon!==void 0&&m.iconBounds!==void 0){let b=l?"selected":"normal";o.style==="highlight"&&(b=l?"selected":"special"),g.drawSprite(o.icon,b,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),o.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(v&&r>35){const k=p?35:r-35,E=p?35*.7:r-35*.7,M=k/r,I=E/r,P=e.createLinearGradient(t,0,t+r,0),S=qr(y,0);P.addColorStop(p?1:0,y),P.addColorStop(M,y),P.addColorStop(I,S),P.addColorStop(p?0:1,S),e.fillStyle=P}else e.fillStyle=y;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(o.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+i/2+Qn(e,a.headerFontFull)),p&&(e.textAlign="left"),o.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!v||!po(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let b=l?"selected":"normal";o.style==="highlight"&&(b=l?"selected":"special"),g.drawSprite(o.indicatorIcon,b,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(v&&m.menuBounds!==void 0){const b=m.menuBounds,k=u!==void 0&&c!==void 0&&jr(b,u+t,c+n);if(k||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===la.Triangle){e.beginPath();const E=b.x+b.width/2-5.5,M=b.y+b.height/2-3;lm(e,[{x:E,y:M},{x:E+11,y:M},{x:E+5.5,y:M+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===la.Dots){e.beginPath();const E=b.x+b.width/2,M=b.y+b.height/2;am(e,E,M),e.fillStyle=y,e.fill()}else{const E=b.x+(b.width-a.headerIconSize)/2,M=b.y+(b.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,E,M,a.headerIconSize,a)}k||(e.globalAlpha=1)}}function yd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const y=$l(o.title)==="rtl",v=wd(e,o,t,n,r,i,a,y);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:l,hoverAmount:g,isHovered:s,hasSelectedCell:d,spriteManager:h,menuBounds:v?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>mu(e,t,n,r,i,o,l,a,s,u,c,g,h,m,y,v)):mu(e,t,n,r,i,o,l,a,s,u,c,g,h,m,y,v)}function Jm(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const k=hd(y);Or(t,s,l,a,o,(E,M,I,P,S)=>{if(E!==t[t.length-1])return;M+=E.width;const C=Math.max(M,P);C>r||(e.save(),e.beginPath(),e.rect(C,o+1,1e4,i-o-1),e.clip(),ka(S,I,i,u,c,p,m,k,(F,T,x,D)=>{if(!D&&y.length>0&&!y.some(j=>po(M,F,1e4,x,j.x,j.y,j.width,j.height)))return;const O=g.hasIndex(T),R=h.hasIndex(T);e.beginPath();const N=d?.(T),W=N===void 0?b:hr(b,N);W.bgCell!==b.bgCell&&(e.fillStyle=W.bgCell,e.fillRect(M,F,1e4,x)),R&&(e.fillStyle=W.bgHeader,e.fillRect(M,F,1e4,x)),O&&(e.fillStyle=W.accentLight,e.fillRect(M,F,1e4,x))}),e.restore())})}function Qm(e,t,n,r,i,o,l,a,s){let u=!1;for(const p of t)if(!p.sticky){u=l(p.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,d=s.borderColor,g=u?Oi(t):0;let h;if(g!==0&&(h=du(d,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const p=d===c&&h!==void 0?h:du(c,s.bgCell),m=Qr(o,i,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const Cd=(e,t,n)=>{let r=0,i=t,o=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:l}};function e0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m=p.bgCell,{minX:y,maxX:v,minY:b,maxY:k}=Cd(a,o,l),E=[],M=l-Qr(h,g,u);let I=s,P=n,S=0;for(;I+i<M;){const x=I+i,D=u(P);if(x>=b&&x<=k-1){const R=c?.(P)?.bgCell;R!==void 0&&R!==m&&P>=h-g&&E.push({x:y,y:x,w:v-y,h:D,color:R})}I+=D,P<h-g&&(S=I),P++}let C=0;const F=Math.min(M,k)-S;if(F>0)for(let x=0;x<t.length;x++){const D=t[x];if(D.width===0)continue;const O=D.sticky?C:C+r,R=D.themeOverride?.bgCell;R!==void 0&&R!==m&&O>=y&&O<=v&&d(x+1)&&E.push({x:O,y:S,w:D.width,h:F,color:R}),C+=D.width}if(E.length===0)return;let T;e.beginPath();for(let x=E.length-1;x>=0;x--){const D=E[x];T===void 0?T=D.color:D.color!==T&&(e.fillStyle=T,e.fill(),e.beginPath(),T=D.color),e.rect(D.x,D.y,D.w,D.h)}T!==void 0&&(e.fillStyle=T,e.fill()),e.beginPath()}function vu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,l);for(const x of s)e.rect(x.x+1,x.y+1,x.width-1,x.height-1);e.clip("evenodd")}const b=y.horizontalBorderColor??y.borderColor,k=y.borderColor,{minX:E,maxX:M,minY:I,maxY:P}=Cd(a,o,l),S=[];e.beginPath();let C=.5;for(let x=0;x<t.length;x++){const D=t[x];if(D.width===0)continue;C+=D.width;const O=D.sticky?C:C+r;O>=E&&O<=M&&h(x+1)&&S.push({x1:O,y1:Math.max(u,I),x2:O,y2:Math.min(l,P),color:k})}let F=l+.5;for(let x=m-p;x<m;x++){const D=d(x);F-=D,S.push({x1:E,y1:F,x2:M,y2:F,color:b})}if(v!==!0){let x=c+.5,D=n;const O=F;for(;x+i<O;){const R=x+i;if(R>=I&&R<=P-1){const N=g?.(D);S.push({x1:E,y1:R,x2:M,y2:R,color:N?.horizontalBorderColor??N?.borderColor??b})}x+=d(D),D++}}const T=Sh(S,x=>x.color);for(const x of Object.keys(T)){e.strokeStyle=x;for(const D of T[x])e.moveTo(D.x1,D.y1),e.lineTo(D.x2,D.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function t0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){const k=[];e.imageSmoothingEnabled=!1;const E=Math.min(i.cellYOffset,l),M=Math.max(i.cellYOffset,l);let I=0;if(typeof v=="number")I+=(M-E)*v;else for(let O=E;O<M;O++)I+=v(O);l>i.cellYOffset&&(I=-I),I+=s-i.translateY;const P=Math.min(i.cellXOffset,o),S=Math.max(i.cellXOffset,o);let C=0;for(let O=P;O<S;O++)C+=m[O].width;o>i.cellXOffset&&(C=-C),C+=a-i.translateX;const F=Oi(y);if(C!==0&&I!==0)return{regions:[]};const T=u>0?Qr(g,u,v):0,x=c-F-Math.abs(C),D=d-h-T-Math.abs(I)-1;if(x>150&&D>150){const O={sx:0,sy:0,sw:c*p,sh:d*p,dx:0,dy:0,dw:c*p,dh:d*p};if(I>0?(O.sy=(h+1)*p,O.sh=D*p,O.dy=(I+h+1)*p,O.dh=D*p,k.push({x:0,y:h,width:c,height:I+1})):I<0&&(O.sy=(-I+h+1)*p,O.sh=D*p,O.dy=(h+1)*p,O.dh=D*p,k.push({x:0,y:d+I-T,width:c,height:-I+T})),C>0?(O.sx=F*p,O.sw=x*p,O.dx=(C+F)*p,O.dw=x*p,k.push({x:F-1,y:0,width:C+2,height:d})):C<0&&(O.sx=(F-C)*p,O.sw=x*p,O.dx=F*p,O.dw=x*p,k.push({x:c+C,y:0,width:-C,height:d})),e.setTransform(1,0,0,1,0,0),b){if(F>0&&C!==0&&I===0&&(r===void 0||n?.[1]!==!1)){const R=F*p,N=d*p;e.drawImage(t,0,0,R,N,0,0,R,N)}if(T>0&&C===0&&I!==0&&(r===void 0||n?.[0]!==!1)){const R=(d-T)*p,N=c*p,W=T*p;e.drawImage(t,0,R,N,W,0,R,N,W)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:k}}function n0(e,t,n,r,i,o,l,a,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Or(s,n,r,i,a,(d,g,h,p)=>{if(d.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:o-m,height:l}),!0}}),c}function r0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(Di(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:l,...a}=i,{width:s,...u}=o;if(!Di(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function bu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const y=p?.filter(P=>P.style!=="no-outline");if(y===void 0||y.length===0)return;const v=Oi(a),b=Qr(h,g,d),k=[s,0,a.length,h-g],E=[v,0,t,n-b],M=y.map(P=>{const S=P.range,C=P.style??"dashed";return Xm(S,k,t,n,E).map(F=>{const T=F.rect,x=kl(T.x,T.y,t,n,c,u+c,r,i,o,l,h,s,g,a,d),D=T.width===1&&T.height===1?x:kl(T.x+T.width-1,T.y+T.height-1,t,n,c,u+c,r,i,o,l,h,s,g,a,d);return T.x+T.width>=a.length&&(D.width-=1),T.y+T.height>=h&&(D.height-=1),{color:P.color,style:C,clip:F.clip,rect:Gm({x:x.x,y:x.y,width:D.x+D.width-x.x,height:D.y+D.height-x.y},t,n,8)}})}),I=()=>{e.lineWidth=1;let P=!1;for(const S of M)for(const C of S)if(C?.rect!==void 0&&po(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const F=P,T=!Um(C.clip,C.rect);e.beginPath(),T&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(C.style==="solid"||C.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=C.style==="solid-outline"?Hn(Hn(C.color,m.borderColor),m.bgCell):qr(C.color,1),e.closePath(),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),T&&(e.restore(),P=F)}P&&e.setLineDash([])};return I(),I}function wu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function nl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y){if(c.current===void 0)return;const v=m!==!1&&m!==void 0;if(!v)return;const b=typeof m=="object"?{...sa,...m}:sa,k=c.current.range,E=c.current.cell,M=[k.x+k.width-1,k.y+k.height-1];if(E[1]>=y&&M[1]>=y||!l.some(N=>N.sourceIndex===E[0]||N.sourceIndex===M[0]))return;const[P,S]=c.current.cell,C=g(c.current.cell),F=C.span??[P,P],T=S>=y-h,x=h>0&&!T?Qr(y,h,d)-1:0,D=M[1];let O;if(Or(l,r,i,o,u,(N,W,j,oe,Q)=>{if(N.sticky&&P>N.sourceIndex)return;const re=N.sourceIndex<F[0],ue=N.sourceIndex>F[1],ae=N.sourceIndex===M[0];if(!(!ae&&(re||ue)))return ka(Q,j,n,y,d,h,p,void 0,(de,he,ce)=>{if(he!==S&&he!==D)return;let H=W,L=N.width;if(C.span!==void 0){const se=pd(C.span,W,de,N.width,ce,N,a),le=N.sticky?se[0]:se[1];le!==void 0&&(H=le.x,L=le.width)}return he===D&&ae&&v&&(O=()=>{oe>H&&!N.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip());const se=b.size,le=se/2,ve=H+L+b.offsetX-le+.5,ge=de+ce+b.offsetY-le+.5;e.beginPath(),b.shape==="circle"?e.arc(ve+le,ge+le,le,0,Math.PI*2):e.rect(ve,ge,se,se),e.fillStyle=N.themeOverride?.accentColor??s.accentColor,e.fill(),b.outline>0&&(e.lineWidth=b.outline,e.strokeStyle=s.bgCell,b.shape==="circle"?(e.beginPath(),e.arc(ve+le,ge+le,le+b.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(ve-b.outline/2,ge-b.outline/2,se+b.outline,se+b.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const R=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-x),e.clip(),O?.(),e.restore()};return R(),R}function i0(e,t,n,r,i,o,l,a,s){s===void 0||s.size===0||(e.beginPath(),gd(t,n,o,r,(u,c,d,g,h,p)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,p)}),Or(t,a,o,l,i,(u,c,d,g)=>{const h=Math.max(0,g-c),p=c+h+1,m=u.width-h-1;s.has([u.sourceIndex,-1])&&e.rect(p,r,m,i-r)}),e.clip())}function o0(e,t,n,r,i,o,l,a,s,u){let c=0;return Or(e,o,r,i,n,(d,g,h,p,m)=>(ka(m,h,t,l,a,s,u,void 0,(y,v,b,k)=>{k||(c=Math.max(v,c))}),!0)),c}function yu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:p,drawFocus:m,headerHeight:y,groupHeaderHeight:v,disabledRows:b,rowHeight:k,verticalBorder:E,overrideCursor:M,isResizing:I,selection:P,fillHandle:S,freezeTrailingRows:C,rows:F,getCellContent:T,getGroupDetails:x,getRowThemeOverride:D,isFocused:O,drawHeaderCallback:R,prelightCells:N,drawCellCallback:W,highlightRegions:j,resizeCol:oe,imageLoader:Q,lastBlitData:re,hoverValues:ue,hyperWrapping:ae,hoverInfo:de,spriteManager:he,maxScaleFactor:ce,hasAppendRow:H,touchMode:L,enqueue:Y,renderStateProvider:se,getCellRenderer:le,renderStrategy:ve,bufferACtx:ge,bufferBCtx:Je,damage:ke,minimumCellWidth:Pt,resizeIndicator:xt}=e;if(i===0||o===0)return;const Oe=ve==="double-buffer",te=Math.min(ce,Math.ceil(window.devicePixelRatio??1)),me=ve!=="direct"&&r0(e,t),we=n.canvas;(we.width!==i*te||we.height!==o*te)&&(we.width=i*te,we.height=o*te,we.style.width=i+"px",we.style.height=o+"px");const ne=r.canvas,ye=d?v+y:y,Pe=ye+1;(ne.width!==i*te||ne.height!==Pe*te)&&(ne.width=i*te,ne.height=Pe*te,ne.style.width=i+"px",ne.style.height=Pe+"px");const Ee=ge.canvas,st=Je.canvas;Oe&&(Ee.width!==i*te||Ee.height!==o*te)&&(Ee.width=i*te,Ee.height=o*te,re.current!==void 0&&(re.current.aBufferScroll=void 0)),Oe&&(st.width!==i*te||st.height!==o*te)&&(st.width=i*te,st.height=o*te,re.current!==void 0&&(re.current.bBufferScroll=void 0));const Fe=re.current;if(me===!0&&l===Fe?.cellXOffset&&a===Fe?.cellYOffset&&s===Fe?.translateX&&u===Fe?.translateY)return;let Ye=null;Oe&&(Ye=n);const Te=r;let Re;Oe?ke!==void 0?Re=Fe?.lastBuffer==="b"?Je:ge:Re=Fe?.lastBuffer==="b"?ge:Je:Re=n;const He=Re.canvas,ht=Oe?He===Ee?st:Ee:we,tt=typeof k=="number"?()=>k:k;Te.save(),Re.save(),Te.beginPath(),Re.beginPath(),Te.textBaseline="middle",Re.textBaseline="middle",te!==1&&(Te.scale(te,te),Re.scale(te,te));const je=xl(c,l,i,h,s);let gt=[];const Gt=m&&P.current?.cell[1]===a&&u===0;let Dt=!1;if(j!==void 0){for(const Ct of j)if(Ct.style!=="no-outline"&&Ct.range.y===a&&u===0){Dt=!0;break}}const ct=()=>{qm(Te,je,d,de,i,s,y,v,h,I,P,p,he,ue,E,x,ke,R,L),vu(Te,je,a,s,u,i,o,void 0,void 0,v,ye,tt,D,E,C,F,p,!0),Te.beginPath(),Te.moveTo(0,Pe-.5),Te.lineTo(i,Pe-.5),Te.strokeStyle=Hn(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Te.stroke(),Dt&&bu(Te,i,o,l,a,s,u,c,g,y,v,k,C,F,j,p),Gt&&nl(Te,i,o,a,s,u,je,c,p,ye,P,tt,T,C,H,S,F)};if(ke!==void 0){const Ct=je[je.length-1].sourceIndex+1,un=ke.hasItemInRegion([{x:l,y:-2,width:Ct,height:2},{x:l,y:a,width:Ct,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:F-C,width:Ct,height:C,when:C>0}]),gn=Ie=>{pu(Ie,je,c,o,ye,s,u,a,F,tt,T,x,D,b,O,m,C,H,gt,ke,P,N,j,Q,he,ue,de,W,ae,p,Y,se,le,M,Pt);const mt=P.current;S!==!1&&S!==void 0&&m&&mt!==void 0&&ke.has(ed(mt.range))&&nl(Ie,i,o,a,s,u,je,c,p,ye,P,tt,T,C,H,S,F)};un&&(gn(Re),Ye!==null&&(Ye.save(),Ye.scale(te,te),Ye.textBaseline="middle",gn(Ye),Ye.restore()),ke.hasHeader()&&(i0(Te,je,i,v,ye,s,u,a,ke),ct())),Re.restore(),Te.restore();return}if((me!==!0||l!==Fe?.cellXOffset||s!==Fe?.translateX||Gt!==Fe?.mustDrawFocusOnHeader||Dt!==Fe?.mustDrawHighlightRingsOnHeader)&&ct(),me===!0){_n(ht!==void 0&&Fe!==void 0);const{regions:Ct}=t0(Re,ht,ht===Ee?Fe.aBufferScroll:Fe.bBufferScroll,ht===Ee?Fe.bBufferScroll:Fe.aBufferScroll,Fe,l,a,s,u,C,i,o,F,ye,te,c,je,k,Oe);gt=Ct}else me!==!1&&(_n(Fe!==void 0),gt=n0(Fe,l,a,s,u,i,o,ye,je,me));Qm(Re,je,i,o,C,F,E,tt,p);const qt=bu(Re,i,o,l,a,s,u,c,g,y,v,k,C,F,j,p),Kt=m?nl(Re,i,o,a,s,u,je,c,p,ye,P,tt,T,C,H,S,F):void 0;if(Re.fillStyle=p.bgCell,gt.length>0){Re.beginPath();for(const Ct of gt)Re.rect(Ct.x,Ct.y,Ct.width,Ct.height);Re.clip(),Re.fill(),Re.beginPath()}else Re.fillRect(0,0,i,o);const Dn=pu(Re,je,c,o,ye,s,u,a,F,tt,T,x,D,b,O,m,C,H,gt,ke,P,N,j,Q,he,ue,de,W,ae,p,Y,se,le,M,Pt);Jm(Re,je,c,i,o,ye,s,u,a,F,tt,D,P.rows,b,C,H,gt,ke,p),e0(Re,je,a,s,u,i,o,gt,ye,tt,D,E,C,F,p),vu(Re,je,a,s,u,i,o,gt,Dn,v,ye,tt,D,E,C,F,p),qt?.(),Kt?.(),I&&xt!=="none"&&Or(je,0,s,0,ye,(Ct,un)=>Ct.sourceIndex===oe?(wu(Te,un+Ct.width,0,ye+1,Hn(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),xt==="full"&&wu(Re,un+Ct.width,ye,o,Hn(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),Ye!==null&&(Ye.fillStyle=p.bgCell,Ye.fillRect(0,0,i,o),Ye.drawImage(Re.canvas,0,0));const It=o0(je,o,ye,s,u,a,F,tt,C,H);Q?.setWindow({x:l,y:a,width:je.length,height:It-a},g,Array.from({length:C},(Ct,un)=>F-1-un));const pt=Fe!==void 0&&(l!==Fe.cellXOffset||s!==Fe.translateX),On=Fe!==void 0&&(a!==Fe.cellYOffset||u!==Fe.translateY);re.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mustDrawFocusOnHeader:Gt,mustDrawHighlightRingsOnHeader:Dt,lastBuffer:Oe?He===Ee?"a":"b":void 0,aBufferScroll:He===Ee?[pt,On]:Fe?.aBufferScroll,bBufferScroll:He===st?[pt,On]:Fe?.bBufferScroll},Re.restore(),Te.restore()}const a0=80;function l0(e){const t=e-1;return t*t*t+1}class s0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>so(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>so(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:l0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/a0;for(const o of this.leavingItems)o.hoverAmount=Nn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Nn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!so(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class u0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ql(e){return new u0(e)}const c0=ql(()=>window.navigator.userAgent.includes("Firefox")),ca=ql(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),da=ql(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function d0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(l),l=()=>{const a=t.current.map(Yl);t.current=[],r.current(new co(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:l)},[]);return f.useCallback(o=>{t.current.length===0&&i();const l=Kn(o[0],o[1]);t.current.includes(l)||t.current.push(l)},[i])}const Mr="header",qn="group-header",fa="out-of-bounds";var Ii;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Ii||(Ii={}));function Sd(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const f0=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",h0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:y,enableGroups:v,isFilling:b,onCanvasFocused:k,onCanvasBlur:E,isFocused:M,selection:I,freezeColumns:P,onContextMenu:S,freezeTrailingRows:C,fixedShadowX:F=!0,fixedShadowY:T=!0,drawFocusRing:x,onMouseDown:D,onMouseUp:O,onMouseMoveRaw:R,onMouseMove:N,onItemHovered:W,dragAndDropState:j,firstColAccessible:oe,onKeyDown:Q,onKeyUp:re,highlightRegions:ue,canvasRef:ae,onDragStart:de,onDragEnd:he,eventTargetRef:ce,isResizing:H,resizeColumn:L,isDragging:Y,isDraggable:se=!1,allowResize:le,disabledRows:ve,hasAppendRow:ge,getGroupDetails:Je,theme:ke,prelightCells:Pt,headerIcons:xt,verticalBorder:Oe,drawCell:te,drawHeader:me,onCellFocused:we,onDragOverCell:ne,onDrop:ye,onDragLeave:Pe,imageWindowLoader:Ee,smoothScrollX:st=!1,smoothScrollY:Fe=!1,experimental:Ye,getCellRenderer:Te,resizeIndicator:Re="full"}=e,He=e.translateX??0,ht=e.translateY??0,tt=Math.max(P,Math.min(o.length-1,l)),je=f.useRef(null),gt=f.useRef(Ye?.eventTarget??window),Gt=gt.current,Dt=Ee,ct=f.useRef(),[qt,Kt]=f.useState(!1),Dn=f.useRef([]),It=f.useRef(),[pt,On]=f.useState(),[Ct,un]=f.useState(),gn=f.useRef(null),[Ie,mt]=f.useState(),[Tt,dn]=f.useState(!1),Bt=f.useRef(Tt);Bt.current=Tt;const rn=f.useMemo(()=>new Bm(xt,()=>{fn.current=void 0,En.current()}),[xt]),Pn=v?c+s:s,on=f.useRef(-1),Zt=(Ye?.enableFirefoxRescaling??!1)&&c0.value,Ue=(Ye?.enableSafariRescaling??!1)&&ca.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Zt&&!Ue||(on.current!==-1&&Kt(!0),window.clearTimeout(on.current),on.current=window.setTimeout(()=>{Kt(!1),on.current=-1},200))},[a,tt,He,ht,Zt,Ue]);const kt=jp(o,P),Rn=f.useMemo(()=>F?Oi(kt,j):0,[kt,j,F]),Lt=f.useCallback((V,ee,xe)=>{const De=V.getBoundingClientRect();if(ee>=kt.length||xe>=g)return;const fe=De.width/n,pe=kl(ee,xe,n,r,c,Pn,tt,a,He,ht,g,P,C,kt,d);return fe!==1&&(pe.x*=fe,pe.y*=fe,pe.width*=fe,pe.height*=fe),pe.x+=De.x,pe.y+=De.y,pe},[n,r,c,Pn,tt,a,He,ht,g,P,C,kt,d]),bt=f.useCallback((V,ee,xe,De)=>{const fe=V.getBoundingClientRect(),pe=fe.width/n,Xe=(ee-fe.left)/pe,Me=(xe-fe.top)/pe,Ze=5,vt=xl(kt,tt,n,void 0,He);let cn=0,Ut=0;const Mt=typeof PointerEvent<"u"&&De instanceof PointerEvent&&De.pointerType==="mouse"||typeof MouseEvent<"u"&&De instanceof MouseEvent,ut=typeof PointerEvent<"u"&&De instanceof PointerEvent&&De.pointerType==="touch"||typeof TouchEvent<"u"&&De instanceof TouchEvent;Mt&&(cn=De.button,Ut=De.buttons);const qe=Jp(Xe,vt,He),dt=Qp(Me,r,v,s,c,g,d,a,ht,C),zt=De?.shiftKey===!0,ui=De?.ctrlKey===!0,_r=De?.metaKey===!0,Qt=[Xe<0?-1:n<Xe?1:0,Me<Pn?-1:r<Me?1:0];let ln;if(qe===-1||Me<0||Xe<0||dt===void 0||Xe>n||Me>r){const Ft=Xe>n?1:Xe<0?-1:0,Vn=Me>r?1:Me<0?-1:0;let mn=Ft*2,ci=Vn*2;Ft===0&&(mn=qe===-1?Ii.EndPadding:Ii.Center),Vn===0&&(ci=dt===void 0?Ii.EndPadding:Ii.Center);let cr=!1;if(qe===-1&&dt===-1){const en=Lt(V,kt.length-1,-1);_n(en!==void 0),cr=ee<en.x+en.width+Ze}const nt=Xe>n&&Xe<n+wl()||Me>r&&Me<r+wl();ln={kind:fa,location:[qe!==-1?qe:Xe<0?0:kt.length-1,dt??g-1],region:[mn,ci],shiftKey:zt,ctrlKey:ui,metaKey:_r,isEdge:cr,isTouch:ut,button:cn,buttons:Ut,scrollEdge:Qt,isMaybeScrollbar:nt}}else if(dt<=-1){let Ft=Lt(V,qe,dt);_n(Ft!==void 0);let Vn=Ft!==void 0&&Ft.x+Ft.width-ee<=Ze;const mn=qe-1;ee-Ft.x<=Ze&&mn>=0?(Vn=!0,Ft=Lt(V,mn,dt),_n(Ft!==void 0),ln={kind:v&&dt===-2?qn:Mr,location:[mn,dt],bounds:Ft,group:kt[mn].group??"",isEdge:Vn,shiftKey:zt,ctrlKey:ui,metaKey:_r,isTouch:ut,localEventX:ee-Ft.x,localEventY:xe-Ft.y,button:cn,buttons:Ut,scrollEdge:Qt}):ln={kind:v&&dt===-2?qn:Mr,group:kt[qe].group??"",location:[qe,dt],bounds:Ft,isEdge:Vn,shiftKey:zt,ctrlKey:ui,metaKey:_r,isTouch:ut,localEventX:ee-Ft.x,localEventY:xe-Ft.y,button:cn,buttons:Ut,scrollEdge:Qt}}else{const Ft=Lt(V,qe,dt);_n(Ft!==void 0);const Vn=Ft!==void 0&&Ft.x+Ft.width-ee<Ze;let mn=!1;if(u!==!1&&u!==void 0&&I.current!==void 0){const cr=typeof u=="object"?{...sa,...u}:sa,nt=cr.size,en=nt/2,Hr=ed(I.current.range),br=Lt(V,Hr[0],Hr[1]);if(br!==void 0){const dr=br.x+br.width+cr.offsetX-en+.5,Vt=br.y+br.height+cr.offsetY-en+.5;mn=Math.abs(dr-ee)<nt&&Math.abs(Vt-xe)<nt}}ln={kind:"cell",location:[qe,dt],bounds:Ft,isEdge:Vn,shiftKey:zt,ctrlKey:ui,isFillHandle:mn,metaKey:_r,isTouch:ut,localEventX:ee-Ft.x,localEventY:xe-Ft.y,button:cn,buttons:Ut,scrollEdge:Qt}}return ln},[n,kt,tt,He,r,v,s,c,g,d,a,ht,C,Lt,u,I,Pn]),[Cn]=pt??[],er=f.useRef(()=>{}),tr=f.useRef(pt);tr.current=pt;const[B,ze]=f.useMemo(()=>{const V=document.createElement("canvas"),ee=document.createElement("canvas");return V.style.display="none",V.style.opacity="0",V.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[V.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(B===null||ze===null))return document.documentElement.append(B.canvas),document.documentElement.append(ze.canvas),()=>{B.canvas.remove(),ze.canvas.remove()}},[B,ze]);const Ge=f.useMemo(()=>new sm,[]),Ot=Zt&&qt?1:Ue&&qt?2:5,an=Ye?.disableMinimumCellWidth===!0?1:10,fn=f.useRef(),In=f.useRef(null),pn=f.useRef(null),Wt=f.useCallback(()=>{const V=je.current,ee=gn.current;if(V===null||ee===null||(In.current===null&&(In.current=V.getContext("2d",{alpha:!1}),V.width=0,V.height=0),pn.current===null&&(pn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),In.current===null||pn.current===null||B===null||ze===null))return;let xe=!1;const De=Xe=>{xe=!0,mt(Xe)},fe=fn.current,pe={headerCanvasCtx:pn.current,canvasCtx:In.current,bufferACtx:B,bufferBCtx:ze,width:n,height:r,cellXOffset:tt,cellYOffset:a,translateX:Math.round(He),translateY:Math.round(ht),mappedColumns:kt,enableGroups:v,freezeColumns:P,dragAndDropState:j,theme:ke,headerHeight:s,groupHeaderHeight:c,disabledRows:ve??et.empty(),rowHeight:d,verticalBorder:Oe,isResizing:H,resizeCol:L,isFocused:M,selection:I,fillHandle:u,drawCellCallback:te,hasAppendRow:ge,overrideCursor:De,maxScaleFactor:Ot,freezeTrailingRows:C,rows:g,drawFocus:x,getCellContent:h,getGroupDetails:Je??(Xe=>({name:Xe})),getRowThemeOverride:p,drawHeaderCallback:me,prelightCells:Pt,highlightRegions:ue,imageLoader:Dt,lastBlitData:It,damage:ct.current,hoverValues:Dn.current,hoverInfo:tr.current,spriteManager:rn,scrolling:qt,hyperWrapping:Ye?.hyperWrapping??!1,touchMode:Tt,enqueue:er.current,renderStateProvider:Ge,renderStrategy:Ye?.renderStrategy??(ca.value?"double-buffer":"single-buffer"),getCellRenderer:Te,minimumCellWidth:an,resizeIndicator:Re};pe.damage===void 0?(fn.current=pe,yu(pe,fe)):yu(pe,void 0),!xe&&(pe.damage===void 0||pe.damage.has(tr?.current?.[0]))&&mt(void 0)},[B,ze,n,r,tt,a,He,ht,kt,v,P,j,ke,s,c,ve,d,Oe,H,ge,L,M,I,u,C,g,x,Ot,h,Je,p,te,me,Pt,ue,Dt,rn,qt,Ye?.hyperWrapping,Ye?.renderStrategy,Tt,Ge,Te,an,Re]),En=f.useRef(Wt);f.useLayoutEffect(()=>{Wt(),En.current=Wt},[Wt]),f.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,fn.current=void 0,En.current())})()},[]);const Sn=f.useCallback(V=>{ct.current=V,En.current(),ct.current=void 0},[]),Li=d0(Sn);er.current=Li;const ei=f.useCallback(V=>{Sn(new co(V.map(ee=>ee.cell)))},[Sn]);Dt.setCallback(Sn);const[Pr,Ce]=f.useState(!1),[wt,_t]=Cn??[],zn=wt!==void 0&&_t===-1&&wt>=0&&wt<kt.length&&kt[wt].headerRowMarkerDisabled!==!0,Tn=wt!==void 0&&_t===-2;let Jt=!1,Xt=!1,hn=Ie;if(hn===void 0&&wt!==void 0&&_t!==void 0&&_t>-1&&_t<g){const V=h([wt,_t],!0);Jt=V.kind===Bn.NewRow||V.kind===Bn.Marker&&V.markerKind!=="number",Xt=V.kind===Z.Boolean&&Hl(V),hn=V.cursor}const xo=Y?"grabbing":(Ct??!1)||H?"col-resize":Pr||b?"crosshair":hn!==void 0?hn:zn||Jt||Xt||Tn?"pointer":"default",ti=f.useMemo(()=>({contain:"strict",display:"block",cursor:xo}),[xo]),Un=f.useRef("default"),xn=ce?.current;xn!=null&&Un.current!==ti.cursor&&(xn.style.cursor=Un.current=ti.cursor);const ni=f.useCallback((V,ee,xe,De)=>{if(Je===void 0)return;const fe=Je(V);if(fe.actions!==void 0){const pe=bd(ee,fe.actions);for(const[Xe,Me]of pe.entries())if(jr(Me,xe+ee.x,De+Me.y))return fe.actions[Xe]}},[Je]),sr=f.useCallback((V,ee,xe,De)=>{const fe=kt[ee];if(!Y&&!H&&!(Ct??!1)){const pe=Lt(V,ee,-1);_n(pe!==void 0);const Xe=wd(void 0,fe,pe.x,pe.y,pe.width,pe.height,ke,$l(fe.title)==="rtl");if(fe.hasMenu===!0&&Xe.menuBounds!==void 0&&jr(Xe.menuBounds,xe,De))return{area:"menu",bounds:Xe.menuBounds};if(fe.indicatorIcon!==void 0&&Xe.indicatorIconBounds!==void 0&&jr(Xe.indicatorIconBounds,xe,De))return{area:"indicator",bounds:Xe.indicatorIconBounds}}},[kt,Lt,Ct,Y,H,ke]),ri=f.useRef(0),pr=f.useRef(),ii=f.useRef(!1),oi=f.useCallback(V=>{const ee=je.current,xe=ce?.current;if(ee===null||V.target!==ee&&V.target!==xe)return;ii.current=!0;const De=V.clientX,fe=V.clientY;if(V.target===xe&&xe!==null){const Xe=xe.getBoundingClientRect();if(De>Xe.right||fe>Xe.bottom)return}const pe=bt(ee,De,fe,V);pr.current=pe.location,pe.isTouch&&(ri.current=Date.now()),Bt.current!==pe.isTouch&&dn(pe.isTouch),!(pe.kind===Mr&&sr(ee,pe.location[0],De,fe)!==void 0)&&(pe.kind===qn&&ni(pe.group,pe.bounds,pe.localEventX,pe.localEventY)!==void 0||(D?.(pe),!pe.isTouch&&se!==!0&&se!==pe.kind&&pe.button<3&&pe.button!==1&&V.preventDefault()))},[ce,se,bt,ni,sr,D]);Mn("pointerdown",oi,Gt,!1);const Lr=f.useRef(0),mr=f.useCallback(V=>{const ee=Lr.current;Lr.current=Date.now();const xe=je.current;if(ii.current=!1,O===void 0||xe===null)return;const De=ce?.current,fe=V.target!==xe&&V.target!==De,pe=V.clientX,Xe=V.clientY,Me=V.pointerType==="mouse"?V.button<3:!0;let Ze=bt(xe,pe,Xe,V);Ze.isTouch&&ri.current!==0&&Date.now()-ri.current>500&&(Ze={...Ze,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ze.isTouch?1e3:500)&&(Ze={...Ze,isDoubleClick:!0}),Bt.current!==Ze.isTouch&&dn(Ze.isTouch),!fe&&V.cancelable&&Me&&V.preventDefault();const[vt]=Ze.location,cn=sr(xe,vt,pe,Xe);if(Ze.kind===Mr&&cn!==void 0){(Ze.button!==0||pr.current?.[0]!==vt||pr.current?.[1]!==-1)&&O(Ze,!0);return}else if(Ze.kind===qn){const Ut=ni(Ze.group,Ze.bounds,Ze.localEventX,Ze.localEventY);if(Ut!==void 0){Ze.button===0&&Ut.onClick(Ze);return}}O(Ze,fe)},[O,ce,bt,sr,ni]);Mn("pointerup",mr,Gt,!1);const ai=f.useCallback(V=>{const ee=je.current;if(ee===null)return;const xe=ce?.current,De=V.target!==ee&&V.target!==xe;let fe,pe,Xe=!0;V instanceof MouseEvent?(fe=V.clientX,pe=V.clientY,Xe=V.button<3):(fe=V.changedTouches[0].clientX,pe=V.changedTouches[0].clientY);const Me=bt(ee,fe,pe,V);Bt.current!==Me.isTouch&&dn(Me.isTouch),!De&&V.cancelable&&Xe&&V.preventDefault();const[Ze]=Me.location;if(Me.kind===Mr){const vt=sr(ee,Ze,fe,pe);vt!==void 0&&Me.button===0&&pr.current?.[0]===Ze&&pr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ze,vt.bounds):vt.area==="indicator"&&y?.(Ze,vt.bounds))}},[ce,bt,sr,m,y]);Mn("click",ai,Gt,!1);const Ia=f.useCallback(V=>{const ee=je.current,xe=ce?.current;if(ee===null||V.target!==ee&&V.target!==xe||S===void 0)return;const De=bt(ee,V.clientX,V.clientY,V);S(De,()=>{V.cancelable&&V.preventDefault()})},[ce,bt,S]);Mn("contextmenu",Ia,ce?.current??null,!1);const Fi=f.useCallback(V=>{ct.current=new co(V.map(ee=>ee.item)),Dn.current=V,En.current(),ct.current=void 0},[]),Ve=f.useMemo(()=>new s0(Fi),[Fi]),Ai=f.useRef(Ve);Ai.current=Ve,f.useLayoutEffect(()=>{const V=Ai.current;if(Cn===void 0||Cn[1]<0){V.setHovered(Cn);return}const ee=h(Cn,!0),xe=Te(ee),De=xe===void 0&&ee.kind===Z.Custom||xe?.needsHover!==void 0&&(typeof xe.needsHover=="boolean"?xe.needsHover:xe.needsHover(ee));V.setHovered(De?Cn:void 0)},[h,Te,Cn]);const ko=f.useRef(),Fr=f.useCallback(V=>{const ee=je.current;if(ee===null)return;const xe=ce?.current,De=V.target!==ee&&V.target!==xe,fe=bt(ee,V.clientX,V.clientY,V);if(fe.kind!=="out-of-bounds"&&De&&!ii.current&&!fe.isTouch)return;const pe=(Me,Ze)=>{On(vt=>vt===Me||vt?.[0][0]===Me?.[0][0]&&vt?.[0][1]===Me?.[0][1]&&(vt?.[1][0]===Me?.[1][0]&&vt?.[1][1]===Me?.[1][1]||!Ze)?vt:Me)};if(!Sd(fe,ko.current))mt(void 0),W?.(fe),pe(fe.kind===fa?void 0:[fe.location,[fe.localEventX,fe.localEventY]],!0),ko.current=fe;else if(fe.kind==="cell"||fe.kind===Mr||fe.kind===qn){let Me=!1,Ze=!0;if(fe.kind==="cell"){const cn=h(fe.location);Ze=Te(cn)?.needsHoverPosition??cn.kind===Z.Custom,Me=Ze}else Me=!0;const vt=[fe.location,[fe.localEventX,fe.localEventY]];pe(vt,Ze),tr.current=vt,Me&&Sn(new co([fe.location]))}const Xe=fe.location[0]>=(oe?0:1);un(fe.kind===Mr&&fe.isEdge&&Xe&&le===!0),Ce(fe.kind==="cell"&&fe.isFillHandle),R?.(V),N(fe)},[ce,bt,oe,le,R,N,W,h,Te,Sn]);Mn("pointermove",Fr,Gt,!0);const Ea=f.useCallback(V=>{const ee=je.current;if(ee===null)return;let xe,De;I.current!==void 0&&(xe=Lt(ee,I.current.cell[0],I.current.cell[1]),De=I.current.cell),Q?.({bounds:xe,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:De})},[Q,I,Lt]),nr=f.useCallback(V=>{const ee=je.current;if(ee===null)return;let xe,De;I.current!==void 0&&(xe=Lt(ee,I.current.cell[0],I.current.cell[1]),De=I.current.cell),re?.({bounds:xe,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:De})},[re,I,Lt]),_i=f.useCallback(V=>{if(je.current=V,ae!==void 0&&(ae.current=V),Ye?.eventTarget)gt.current=Ye.eventTarget;else if(V===null)gt.current=window;else{const ee=V.getRootNode();ee===document&&(gt.current=window),gt.current=ee}},[ae,Ye?.eventTarget]),Mo=f.useCallback(V=>{const ee=je.current;if(ee===null||se===!1||H){V.preventDefault();return}let xe,De;const fe=bt(ee,V.clientX,V.clientY);if(se!==!0&&fe.kind!==se){V.preventDefault();return}const pe=(Ut,Mt)=>{xe=Ut,De=Mt};let Xe,Me,Ze;const vt=(Ut,Mt,ut)=>{Xe=Ut,Me=Mt,Ze=ut};let cn=!1;if(de?.({...fe,setData:pe,setDragImage:vt,preventDefault:()=>cn=!0,defaultPrevented:()=>cn}),!cn&&xe!==void 0&&De!==void 0&&V.dataTransfer!==null)if(V.dataTransfer.setData(xe,De),V.dataTransfer.effectAllowed="copyLink",Xe!==void 0&&Me!==void 0&&Ze!==void 0)V.dataTransfer.setDragImage(Xe,Me,Ze);else{const[Ut,Mt]=fe.location;if(Mt!==void 0){const ut=document.createElement("canvas"),qe=Lt(ee,Ut,Mt);_n(qe!==void 0);const dt=Math.ceil(window.devicePixelRatio??1);ut.width=qe.width*dt,ut.height=qe.height*dt;const zt=ut.getContext("2d");zt!==null&&(zt.scale(dt,dt),zt.textBaseline="middle",Mt===-1?(zt.font=ke.headerFontFull,zt.fillStyle=ke.bgHeader,zt.fillRect(0,0,ut.width,ut.height),yd(zt,0,0,qe.width,qe.height,kt[Ut],!1,ke,!1,void 0,void 0,!1,0,rn,me,!1)):(zt.font=ke.baseFontFull,zt.fillStyle=ke.bgCell,zt.fillRect(0,0,ut.width,ut.height),vd(zt,h([Ut,Mt]),0,Mt,!1,!1,0,0,qe.width,qe.height,!1,ke,ke.bgCell,Dt,rn,1,void 0,!1,0,void 0,void 0,void 0,Ge,Te,()=>{}))),ut.style.left="-100%",ut.style.position="absolute",ut.style.width=`${qe.width}px`,ut.style.height=`${qe.height}px`,document.body.append(ut),V.dataTransfer.setDragImage(ut,qe.width/2,qe.height/2),window.setTimeout(()=>{ut.remove()},0)}}else V.preventDefault()},[se,H,bt,de,Lt,ke,kt,rn,me,h,Dt,Ge,Te]);Mn("dragstart",Mo,ce?.current??null,!1,!1);const li=f.useRef(),Ta=f.useCallback(V=>{const ee=je.current;if(ye!==void 0&&V.preventDefault(),ee===null||ne===void 0)return;const xe=bt(ee,V.clientX,V.clientY),[De,fe]=xe.location,pe=De-(oe?0:1),[Xe,Me]=li.current??[];(Xe!==pe||Me!==fe)&&(li.current=[pe,fe],ne([pe,fe],V.dataTransfer))},[oe,bt,ne,ye]);Mn("dragover",Ta,ce?.current??null,!1,!1);const Da=f.useCallback(()=>{li.current=void 0,he?.()},[he]);Mn("dragend",Da,ce?.current??null,!1,!1);const rr=f.useCallback(V=>{const ee=je.current;if(ee===null||ye===void 0)return;V.preventDefault();const xe=bt(ee,V.clientX,V.clientY),[De,fe]=xe.location,pe=De-(oe?0:1);ye([pe,fe],V.dataTransfer)},[oe,bt,ye]);Mn("drop",rr,ce?.current??null,!1,!1);const vr=f.useCallback(()=>{Pe?.()},[Pe]);Mn("dragleave",vr,ce?.current??null,!1,!1);const Ln=f.useRef(I);Ln.current=I;const G=f.useRef(null),Ht=f.useCallback(V=>{je.current===null||!je.current.contains(document.activeElement)||(V===null&&Ln.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):V!==null&&V.focus({preventScroll:!0}),G.current=V)},[ae]);f.useImperativeHandle(t,()=>({focus:()=>{const V=G.current;V===null||!document.contains(V)?ae?.current?.focus({preventScroll:!0}):V.focus({preventScroll:!0})},getBounds:(V,ee)=>{if(!(ae===void 0||ae.current===null))return Lt(ae.current,V??0,ee??-1)},damage:ei,getMouseArgsForPosition:(V,ee,xe)=>{if(!(ae===void 0||ae.current===null))return bt(ae.current,V,ee,xe)}}),[ae,ei,Lt,bt]);const ur=f.useRef(),Oa=hp(()=>{if(n<50||Ye?.disableAccessibilityTree===!0)return null;let V=xl(kt,tt,n,j,He);const ee=oe?0:-1;!oe&&V[0]?.sourceIndex===0&&(V=V.slice(1));const[xe,De]=I.current?.cell??[],fe=I.current?.range,pe=V.map(Me=>Me.sourceIndex),Xe=Ir(a,Math.min(g,a+i));return xe!==void 0&&De!==void 0&&!(pe.includes(xe)&&Xe.includes(De))&&Ht(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":kt.length+ee},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},V.map(Me=>f.createElement("th",{role:"columnheader","aria-selected":I.columns.hasIndex(Me.sourceIndex),"aria-colindex":Me.sourceIndex+1+ee,tabIndex:-1,onFocus:Ze=>{if(Ze.target!==G.current)return we?.([Me.sourceIndex,-1])},key:Me.sourceIndex},Me.title)))),f.createElement("tbody",{role:"rowgroup"},Xe.map(Me=>f.createElement("tr",{role:"row","aria-selected":I.rows.hasIndex(Me),key:Me,"aria-rowindex":Me+2},V.map(Ze=>{const vt=Ze.sourceIndex,cn=Kn(vt,Me),Ut=xe===vt&&De===Me,Mt=fe!==void 0&&vt>=fe.x&&vt<fe.x+fe.width&&Me>=fe.y&&Me<fe.y+fe.height,ut=`glide-cell-${vt}-${Me}`,qe=[vt,Me],dt=h(qe,!0);return f.createElement("td",{key:cn,role:"gridcell","aria-colindex":vt+1+ee,"aria-selected":Mt,"aria-readonly":Mi(dt)||!xi(dt),id:ut,"data-testid":ut,onClick:()=>{const zt=ae?.current;if(zt!=null)return Q?.({bounds:Lt(zt,vt,Me),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:qe})},onFocusCapture:zt=>{if(!(zt.target===G.current||ur.current?.[0]===vt&&ur.current?.[1]===Me))return ur.current=qe,we?.(qe)},ref:Ut?Ht:void 0,tabIndex:-1},f0(dt,Te))})))))},[n,kt,tt,j,He,g,a,i,I,Ht,h,ae,Q,Lt,we],200),Ar=P===0||!F?0:tt>P?1:Nn(-He/100,0,1),Pa=-a*32+ht,si=T?Nn(-Pa/100,0,1):0,bs=f.useMemo(()=>{if(!Ar&&!si)return null;const V={position:"absolute",top:0,left:Rn,width:n-Rn,height:r,opacity:Ar,pointerEvents:"none",transition:st?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:Pn,left:0,width:n,height:r,opacity:si,pointerEvents:"none",transition:Fe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Ar>0&&f.createElement("div",{id:"shadow-x",style:V}),si>0&&f.createElement("div",{id:"shadow-y",style:ee}))},[Ar,si,Rn,n,st,Pn,r,Fe]),q=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ea,onKeyUp:nr,onFocus:k,onBlur:E,ref:_i,style:ti},Oa),f.createElement("canvas",{ref:gn,style:q}),bs)},g0=f.memo(f.forwardRef(h0));function to(e,t,n,r){return Nn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const p0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,l]=f.useState(),[a,s]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,p]=f.useState(),[m,y]=f.useState(),[v,b]=f.useState(!1),[k,E]=f.useState(),{onHeaderMenuClick:M,onHeaderIndicatorClick:I,getCellContent:P,onColumnMoved:S,onColumnResize:C,onColumnResizeStart:F,onColumnResizeEnd:T,gridRef:x,maxColumnWidth:D,minColumnWidth:O,onRowMoved:R,lockColumns:N,onColumnProposeMove:W,onMouseDown:j,onMouseUp:oe,onItemHovered:Q,onDragStart:re,canvasRef:ue}=e,ae=(C??T??F)!==void 0,{columns:de,selection:he}=e,ce=he.columns,H=f.useCallback(te=>{const[me,we]=te.location;o!==void 0&&a!==me&&me>=N?(c(!0),s(me)):h!==void 0&&we!==void 0?(b(!0),y(Math.max(0,we))):r===void 0&&!u&&!v&&Q?.(te)},[o,h,a,Q,N,r,u,v]),L=S!==void 0,Y=f.useCallback(te=>{if(te.button===0){const[me,we]=te.location;if(te.kind==="out-of-bounds"&&te.isEdge&&ae){const ne=x?.current?.getBounds(de.length-1,-1);ne!==void 0&&(n(ne.x),i(de.length-1))}else if(te.kind==="header"&&me>=N){const ne=ue?.current;if(te.isEdge&&ae&&ne){n(te.bounds.x),i(me);const Pe=ne.getBoundingClientRect().width/ne.offsetWidth,Ee=te.bounds.width/Pe;F?.(de[me],Ee,me,Ee+(de[me].growOffset??0))}else te.kind==="header"&&L&&(g(te.bounds.x),l(me))}else te.kind==="cell"&&N>0&&me===0&&we!==void 0&&R!==void 0&&(E(te.bounds.y),p(we))}j?.(te)},[j,ae,N,R,x,de,L,F,ue]),se=f.useCallback((te,me)=>{u||v||M?.(te,me)},[u,v,M]),le=f.useCallback((te,me)=>{u||v||I?.(te,me)},[u,v,I]),ve=f.useRef(-1),ge=f.useCallback(()=>{ve.current=-1,p(void 0),y(void 0),E(void 0),b(!1),l(void 0),s(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),Je=f.useCallback((te,me)=>{if(te.button===0){if(r!==void 0){if(ce?.hasIndex(r)===!0)for(const ne of ce){if(ne===r)continue;const ye=de[ne],Pe=to(ye,ve.current,O,D);C?.(ye,Pe,ne,Pe+(ye.growOffset??0))}const we=to(de[r],ve.current,O,D);if(T?.(de[r],we,r,we+(de[r].growOffset??0)),ce.hasIndex(r))for(const ne of ce){if(ne===r)continue;const ye=de[ne],Pe=to(ye,ve.current,O,D);T?.(ye,Pe,ne,Pe+(ye.growOffset??0))}}ge(),o!==void 0&&a!==void 0&&W?.(o,a)!==!1&&S?.(o,a),h!==void 0&&m!==void 0&&R?.(h,m)}oe?.(te,me)},[oe,r,o,a,h,m,ce,T,de,O,D,C,S,R,ge,W]),ke=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&W?.(o,a)!==!1)return{src:o,dest:a}},[o,a,W]),Pt=f.useCallback(te=>{const me=ue?.current;if(o!==void 0&&d!==void 0)Math.abs(te.clientX-d)>20&&c(!0);else if(h!==void 0&&k!==void 0)Math.abs(te.clientY-k)>20&&b(!0);else if(r!==void 0&&t!==void 0&&me){const ne=me.getBoundingClientRect().width/me.offsetWidth,ye=(te.clientX-t)/ne,Pe=de[r],Ee=to(Pe,ye,O,D);if(C?.(Pe,Ee,r,Ee+(Pe.growOffset??0)),ve.current=ye,ce?.first()===r)for(const st of ce){if(st===r)continue;const Fe=de[st],Ye=to(Fe,ve.current,O,D);C?.(Fe,Ye,st,Ye+(Fe.growOffset??0))}}},[o,d,h,k,r,t,de,O,D,C,ce,ue]),xt=f.useCallback((te,me)=>{if(h===void 0||m===void 0)return P(te,me);let[we,ne]=te;return ne===m?ne=h:(ne>m&&(ne-=1),ne>=h&&(ne+=1)),P([we,ne],me)},[h,m,P]),Oe=f.useCallback(te=>{re?.(te),te.defaultPrevented()||ge()},[ge,re]);return f.createElement(g0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:xt,isResizing:r!==void 0,onHeaderMenuClick:se,onHeaderIndicatorClick:le,isDragging:u,onItemHovered:H,onDragStart:Oe,onMouseDown:Y,allowResize:ae,onMouseUp:Je,dragAndDropState:ke,onMouseMoveRaw:Pt,ref:x})};function m0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=l=>{for(const a of l){const{width:s,height:u}=a&&a.contentRect||{};r(c=>c.width===s&&c.height===u?c:{width:s,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const v0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),l=f.useRef(0),a=f.useRef(t);a.current=t;const s=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&s!==null){const g=[s.scrollLeft,s.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(l.current>10){o.current=null,i.current=null;return}else l.current++;else l.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,l.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},b0=()=>e=>e.isSafari?"scroll":"auto",w0=sn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[b0()]}}),y0=33554400,C0=5e6;function S0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return Mn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),Mn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const x0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:p,initialSize:m}=e,y=[],v=g?.sticky??!1,b=g?.fill??!1,k=f.useRef(0),E=f.useRef(0),M=f.useRef(null),I=typeof window>"u"?1:window.devicePixelRatio,P=f.useRef(I);f.useEffect(()=>{if(P.current!==I){k.current=0,E.current=0,P.current=I;const he=M.current;he!==null&&R.current(he.scrollLeft,he.scrollTop)}},[I]);const S=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),C=f.useRef(null),F=S0(200),[T,x]=f.useState(!0),D=f.useRef(0);f.useLayoutEffect(()=>{if(!T||F||S.current.lockDirection===void 0)return;const he=M.current;if(he===null)return;const[ce,H]=S.current.lockDirection;ce!==void 0?he.scrollLeft=ce:H!==void 0&&(he.scrollTop=H),S.current.lockDirection=void 0},[F,T]);const O=f.useCallback((he,ce)=>{const H=M.current;if(H===null)return;ce=ce??H.scrollTop,he=he??H.scrollLeft;const L=S.current.scrollTop,Y=S.current.scrollLeft,se=he-Y,le=ce-L;F&&se!==0&&le!==0&&(Math.abs(se)>3||Math.abs(le)>3)&&s&&S.current.lockDirection===void 0&&(S.current.lockDirection=Math.abs(se)<Math.abs(le)?[Y,void 0]:[void 0,L]);const ve=S.current.lockDirection;he=ve?.[0]??he,ce=ve?.[1]??ce,S.current.scrollLeft=he,S.current.scrollTop=ce;const ge=H.clientWidth,Je=H.clientHeight,ke=ce,Pt=E.current-ke,xt=H.scrollHeight-Je;E.current=ke;let Oe;if(xt>0&&r>H.scrollHeight+5)if(Math.abs(Pt)>2e3||ke===0||ke===xt){const te=Math.max(0,Math.min(1,ke/xt)),me=r-Je;Oe=te*me,k.current=Oe}else k.current-=Pt,Oe=k.current;else Oe=ke,k.current=Oe;Oe=Math.max(0,Math.min(Oe,r-Je)),k.current=Oe,ve!==void 0&&(window.clearTimeout(D.current),x(!1),D.current=window.setTimeout(()=>x(!0),200)),o({x:he,y:Oe,width:ge-c,height:Je-u,paddingRight:C.current?.clientWidth??0})},[u,c,r,o,s,F]);v0(h&&ca.value,O,M);const R=f.useRef(O);R.current=O;const N=f.useRef(),W=f.useRef(!1);f.useLayoutEffect(()=>{W.current?O():W.current=!0},[O,u,c]);const j=f.useCallback(he=>{M.current=he,p!==void 0&&(p.current=he)},[p]);let oe=0,Q=0;const re=Math.min(r,y0);for(y.push(f.createElement("div",{key:oe++,style:{width:i,height:0}}));Q<re;){const he=Math.min(C0,re-Q);y.push(f.createElement("div",{key:oe++,style:{width:0,height:he}})),Q+=he}const{ref:ue,width:ae,height:de}=m0(m);return typeof window<"u"&&(N.current?.height!==de||N.current?.width!==ae)&&(window.setTimeout(()=>R.current(),0),N.current={width:ae,height:de}),(ae??0)===0||(de??0)===0?f.createElement("div",{ref:ue}):f.createElement("div",{ref:ue},f.createElement(w0,{isSafari:ca.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:j,style:N.current,draggable:l,onDragStart:he=>{l||(he.stopPropagation(),he.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>O()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!b&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:C,style:{height:de,maxHeight:n-Math.ceil(I%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:b?1:void 0,right:v?c??0:void 0,pointerEvents:"auto"}},d))))))},k0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:p,rightElement:m,rightElementProps:y,overscrollX:v,overscrollY:b,initialSize:k,smoothScrollX:E=!1,smoothScrollY:M=!1,isDraggable:I}=e,{paddingRight:P,paddingBottom:S}=s??{},[C,F]=c,T=f.useRef(),x=f.useRef(),D=f.useRef(),O=f.useRef(),R=u+Math.max(0,v??0);let N=l?i+o:i;if(typeof r=="number")N+=n*r;else for(let Q=0;Q<n;Q++)N+=r(Q);b!==void 0&&(N+=b);const W=f.useRef(),j=f.useCallback(()=>{if(W.current===void 0)return;const Q={...W.current};let re=0,ue=Q.x<0?-Q.x:0,ae=0,de=0;Q.x=Q.x<0?0:Q.x;let he=0;for(let le=0;le<a;le++)he+=t[le].width;for(const le of t){const ve=re-he;if(Q.x>=ve+le.width)re+=le.width,de++,ae++;else if(Q.x>ve)re+=le.width,E?ue+=ve-Q.x:de++,ae++;else if(Q.x+Q.width>ve)re+=le.width,ae++;else break}let ce=0,H=0,L=0;if(typeof r=="number")M?(H=Math.floor(Q.y/r),ce=H*r-Q.y):H=Math.ceil(Q.y/r),L=Math.ceil(Q.height/r)+H,ce<0&&L++;else{let le=0;for(let ve=0;ve<n;ve++){const ge=r(ve),Je=le+(M?0:ge/2);if(Q.y>=le+ge)le+=ge,H++,L++;else if(Q.y>Je)le+=ge,M?ce+=Je-Q.y:H++,L++;else if(Q.y+Q.height>ge/2+le)le+=ge,L++;else break}}H=Math.max(0,Math.min(H,n-1)),L=Math.max(H,Math.min(L,n));const Y={x:de,y:H,width:ae-de,height:L-H},se=T.current;(se===void 0||se.y!==Y.y||se.x!==Y.x||se.height!==Y.height||se.width!==Y.width||x.current!==ue||D.current!==ce||Q.width!==O.current?.[0]||Q.height!==O.current?.[1])&&(g?.({x:de,y:H,width:ae-de,height:L-H},Q.width,Q.height,Q.paddingRight??0,ue,ce),T.current=Y,x.current=ue,D.current=ce,O.current=[Q.width,Q.height])},[t,r,n,g,a,E,M]),oe=f.useCallback(Q=>{W.current=Q,j()},[j]);return f.useEffect(()=>{j()},[j]),f.createElement(x0,{scrollRef:h,className:d,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:I===!0||typeof I=="string",scrollWidth:R+(P??0),scrollHeight:N+(S??0),clientHeight:F,rightElement:m,paddingBottom:S,paddingRight:P,rightElementProps:y,update:oe,initialSize:k},f.createElement(p0,{eventTargetRef:h,width:C,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},M0=sn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),R0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),I0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),E0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),T0=10,D0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=f.useState(""),y=l??p,v=f.useCallback(re=>{m(re),s?.(re)},[s]),[b,k]=f.useState(),E=f.useRef(b);E.current=b,f.useEffect(()=>{a!==void 0&&(a.length>0?k(re=>({rowsSearched:r,results:a.length,selectedIndex:re?.selectedIndex??-1})):k(void 0))},[r,a]);const M=f.useRef();M.current===void 0&&(M.current=new AbortController);const I=f.useRef(),[P,S]=f.useState([]),C=a??P,F=f.useCallback(()=>{I.current!==void 0&&(window.cancelAnimationFrame(I.current),I.current=void 0),M.current!==void 0&&M.current.abort(),M.current=new AbortController},[]),T=f.useRef(n);T.current=n;const x=f.useCallback(re=>{const ue=new RegExp(re.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=T.current,de=Math.min(10,r),he=0;k(void 0),S([]);const ce=[],H=async()=>{if(u===void 0)return;const L=performance.now(),Y=r-he;let se=u({x:0,y:ae,width:i.length,height:Math.min(de,Y,r-ae)},M.current.signal);typeof se=="function"&&(se=await se());let le=!1;for(const[xt,Oe]of se.entries())for(const[te,me]of Oe.entries()){let we;switch(me.kind){case Z.Text:case Z.Number:we=me.displayData;break;case Z.Uri:case Z.Markdown:we=me.data;break;case Z.Boolean:we=typeof me.data=="boolean"?me.data.toString():void 0;break;case Z.Image:case Z.Bubble:we=me.data.join("🐳");break;case Z.Custom:we=me.copyData;break}we!==void 0&&ue.test(we)&&(ce.push([te,xt+ae]),le=!0)}const ve=performance.now();le&&S([...ce]),he+=se.length,_n(he<=r);const ge=E.current?.selectedIndex??-1;k({results:ce.length,rowsSearched:he,selectedIndex:ge}),c?.(ce,ge),ae+de>=r?ae=0:ae+=de;const Je=ve-L,ke=Math.max(Je,1),Pt=T0/ke;de=Math.ceil(de*Pt),he<r&&ce.length<1e3&&(I.current=window.requestAnimationFrame(H))};F(),I.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),D=f.useCallback(()=>{g?.(),k(void 0),S([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),O=f.useCallback(re=>{v(re.target.value),a===void 0&&(re.target.value===""?(k(void 0),S([]),F()):x(re.target.value))},[x,F,v,a]);f.useEffect(()=>{o.current!==null&&(v(""),k(void 0),P.length>0&&(S([]),c?.([],-1)),d?o.current.focus({preventScroll:!0}):F())},[d,o]);const R=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;const ue=(b.selectedIndex+1)%b.results;k({...b,selectedIndex:ue}),c?.(C,ue)},[b,c,C]),N=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;let ue=(b.selectedIndex-1)%b.results;ue<0&&(ue+=b.results),k({...b,selectedIndex:ue}),c?.(C,ue)},[c,C,b]),W=f.useCallback(re=>{(re.ctrlKey||re.metaKey)&&re.nativeEvent.code==="KeyF"||re.key==="Escape"?(D(),re.stopPropagation(),re.preventDefault()):re.key==="Enter"&&(re.shiftKey?N():R())},[D,R,N]);f.useEffect(()=>()=>{F()},[F]);const[j,oe]=f.useState(!1);f.useEffect(()=>{if(d)oe(!0);else{const re=setTimeout(()=>oe(!1),150);return()=>clearTimeout(re)}},[d]);const Q=f.useMemo(()=>{if(!d&&!j)return null;let re;b!==void 0&&(re=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(re=`${b.selectedIndex+1} of ${re}`));const ue=he=>{he.stopPropagation()},de={width:`${r>0?Math.floor((b?.rowsSearched??0)/r*100):0}%`};return f.createElement(M0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:ue,onMouseMove:ue,onMouseUp:ue,onClick:ue},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:W}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:N,disabled:(b?.results??0)===0},R0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:R,disabled:(b?.results??0)===0},I0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:D},E0)),b!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},re)),f.createElement("div",{className:"gdg-search-progress",style:de})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,j,b,r,h,o,O,y,W,N,R,g,D]);return f.createElement(f.Fragment,null,f.createElement(k0,{prelightCells:C,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Q)};class O0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const P0=()=>e=>Math.max(16,e.targetHeight-10),L0=sn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[P0(),"px"]}}),F0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[l,a]=$t.useState(n);return $t.createElement(O0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},$t.createElement(L0,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?o(l):s.key==="Escape"&&r()},autoFocus:!0}))};function A0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function it(e,t,n){const r=xd(e,t);return r&&(n.didMatch=!0),r}function xd(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(xd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const l=e.split("+"),a=l.pop();if(!A0(a,t))return!1;if(l[0]==="any")return!0;for(const s of l)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":da.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function _0(e,t,n,r,i,o,l){const a=$t.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!l&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const p=n==="mixed"&&(g||h==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,y=(i==="mixed"||i==="additive")&&p;let v={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:et.empty(),rows:y?e.rows:et.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v={...v,current:{...v.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(v,d)},[r,e,n,o,l,i,t]),s=$t.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:et.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";h={current:p?e.current:void 0,columns:m?e.columns:et.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=$t.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:et.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&i==="mixed"||i==="additive";h={current:p?e.current:void 0,rows:m?e.rows:et.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,s,u]}function H0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:Z.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),l=e!==void 0?o:void 0,a=f.useCallback(u=>{if(l===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=l(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:Z.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:Z.Loading,allowOverlay:!1},...g])}return l(c,r.signal)},[r.signal,l,n]);return[e!==void 0?a:void 0,l]}function z0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===_l?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:fo()}}function V0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(l=>l.span!==void 0&&l.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:z0(l))})}function Cu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function $0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>Cu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:Cu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
166
+ `)}function rl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Su(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function N0(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function B0(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${i}><a href="${r.rawValue}">${rl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${i}><ol>${r.formatted.map((o,l)=>`<li gdg-raw-value=${Su(r.rawValue[l])}>`+rl(o)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Su(r.rawValue?.toString()??"")} ${i}>${rl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function W0(e,t){const n=V0(e,t),r=$0(n),i=B0(n);return{textPlain:r,textHtml:i}}function xu(e){const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const l=r.pop();if(l===void 0)break;if(l instanceof HTMLTableElement||l.nodeName==="TBODY")r.push(...[...l.children].reverse());else if(l instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...l.children].reverse());else if(l instanceof HTMLTableCellElement){const a=l.cloneNode(!0),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,c=u?.children.length===1&&u.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const p of d)p.replaceWith(`
167
+ `);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const p=a.querySelectorAll("li");o?.push({rawValue:[...p].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...p].map(m=>m.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue:N0(g),formatted:a.textContent??"",format:h});else{let p=a.textContent??"";c&&(p=p.replace(/\n(?!\n)/g,"")),o?.push({rawValue:p??"",formatted:p??"",format:h})}}}return o!==void 0&&i.push(o),i}function U0(e,t,n,r,i){const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if(e?.current===void 0)break;const a=e.current?.range,s=[];if(a.width>2){const d=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;s.push(...g)}else{const d=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d)}let u=a.x-n,c=a.x+a.width-1-n;for(const d of s)for(const g of d)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===a.x-n&&c===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:c-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function ku(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function G0(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
168
+ `);let l=0;for(const a of e){switch(o){case t.None:a===" "||a===`
169
+ `?(r.push(e.slice(i,l)),i=l+1,a===`
170
+ `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
+ `)&&(r.push(ku(e.slice(i,l))),i=l+1,a===`
172
+ `&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(ku(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Mu(e,t,n){const r=W0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),l=(a,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",s)}catch{o(a,s)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function kd(e){return e!==!0}function Ru(e){return typeof e=="string"?e:`${e}px`}const X0=()=>e=>e.innerWidth,Y0=()=>e=>e.innerHeight,j0=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[X0()],"wmyidgi-1":[Y0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(j0,{innerHeight:Ru(n),innerWidth:Ru(t),...i},r)},K0=2,Z0=1300;function J0(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{if(!l){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Z0);const d=r.current**1.618*c*K0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function Q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=$t.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=sd();return[typeof m=="number"?m*p:v=>Math.ceil(m(v)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const xr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ot(e,t){return e===!0?t:e===!1?"":e}function Iu(e){const t=da.value;return{activateCell:ot(e.activateCell," |Enter|shift+Enter"),clear:ot(e.clear,"any+Escape"),closeOverlay:ot(e.closeOverlay,"any+Escape"),acceptOverlayDown:ot(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ot(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ot(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ot(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ot(e.delete,t?"Backspace|Delete":"Delete"),downFill:ot(e.downFill,"primary+_68"),scrollToSelectedCell:ot(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ot(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ot(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ot(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ot(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ot(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ot(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ot(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ot(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ot(e.goToFirstCell,"primary+Home"),goToFirstColumn:ot(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ot(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ot(e.goToLastCell,"primary+End"),goToLastColumn:ot(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ot(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ot(e.goToNextPage,"PageDown"),goToPreviousPage:ot(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ot(e.rightFill,"primary+_82"),search:ot(e.search,"primary+f"),selectAll:ot(e.selectAll,"primary+a"),selectColumn:ot(e.selectColumn,"ctrl+ "),selectGrowDown:ot(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ot(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ot(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ot(e.selectGrowUp,"shift+ArrowUp"),selectRow:ot(e.selectRow,"shift+ "),selectToFirstCell:ot(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ot(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ot(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ot(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ot(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ot(e.selectToLastRow,"primary+shift+ArrowDown")}}function ev(e){const t=bp(e);return $t.useMemo(()=>{if(t===void 0)return Iu(xr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??xr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??xr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??xr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??xr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??xr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??xr.selectToLastCell};return Iu({...xr,...n})},[t])}function tv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Kl(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=tv(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Il(e,t){if(t===void 0||Kl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function nv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=kr(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Il(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function rv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]);return{getRowGroupingForPath:Rd,updateRowGroupingByPath:Md,mapper:$t.useCallback(r=>{if(typeof r=="number")return Il(r,n);const i=Il(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Md(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Md(o.subGroups??[],i,n)}:o)}function Rd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Rd(e[n].subGroups??[],r)}function iv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function ov(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=vp(a),d=f.useRef(i);d.current=i;const g=iv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const av=f.lazy(async()=>await Fl(()=>import("./data-grid-overlay-editor.B4RIu9cw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url));let lv=0;function sv(e){return Xg(Ls(Ls(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Go(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Xo={kind:Z.Loading,allowOverlay:!1},Yo={columns:et.empty(),rows:et.empty(),current:void 0},uv=(e,t)=>{const[n,r]=f.useState(Yo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:v,rows:b,getCellContent:k,onCellClicked:E,onCellActivated:M,onFillPattern:I,onFinishedEditing:P,coercePasteValue:S,drawHeader:C,drawCell:F,editorBloom:T,onHeaderClicked:x,onColumnProposeMove:D,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:R="default",onGroupHeaderClicked:N,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:ue,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:he,searchResults:ce,onSearchValueChange:H,searchValue:L,onKeyDown:Y,onKeyUp:se,keybindings:le,editOnType:ve=!0,onRowAppended:ge,onColumnAppended:Je,onColumnMoved:ke,validateCell:Pt,highlightRegions:xt,rangeSelect:Oe="rect",columnSelect:te="multi",rowSelect:me="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:ye="exclusive",onDelete:Pe,onDragStart:Ee,onMouseMove:st,onPaste:Fe,copyHeaders:Ye=!1,freezeColumns:Te=0,cellActivationBehavior:Re="second-click",rowSelectionMode:He="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:je,getGroupDetails:gt,rowGrouping:Gt,onSearchClose:Dt,onItemHovered:ct,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:Dn,gridSelection:It,onGridSelectionChange:pt,minColumnWidth:On=50,maxColumnWidth:Ct=500,maxColumnAutoWidth:un,provideEditor:gn,trailingRowOptions:Ie,freezeTrailingRows:mt=0,allowedFillDirections:Tt="orthogonal",scrollOffsetX:dn,scrollOffsetY:Bt,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Ue,onColumnResizeStart:kt,customRenderers:Rn,fillHandle:Lt,experimental:bt,fixedShadowX:Cn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:ze,isDraggable:Ge,onDragLeave:Ot,onRowMoved:an,overscrollX:fn,overscrollY:In,preventDiagonalScrolling:pn,rightElement:Wt,rightElementProps:En,trapFocus:Sn=!1,smoothScrollX:Li,smoothScrollY:ei,scaleToRem:Pr=!1,rowHeight:Ce=34,headerHeight:wt=36,groupHeaderHeight:_t=wt,theme:zn,isOutsideClick:Tn,renderers:Jt,resizeIndicator:Xt,scrollToActiveCell:hn=!0,drawFocusRing:Wn=!0,portalElementRef:xo}=e,ti=Wn==="no-editor"?i===void 0:Wn,Un=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Un?.kind??e.rowMarkers??"none",ni=Un?.width??e.rowMarkerWidth,sr=Un?.startIndex??e.rowMarkerStartIndex??1,ri=Un?.theme??e.rowMarkerTheme,pr=Un?.headerTheme,ii=Un?.headerAlwaysVisible,oi=me!=="multi"||Un?.headerDisabled===!0,Lr=Un?.checkboxStyle??"square",mr=Math.max(On,20),ai=Math.max(Ct,mr),Ia=Math.max(un??ai,mr),Fi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ve,rowNumberMapper:Ai,rowHeight:ko,getRowThemeOverride:Fr}=nv(Gt,b,Ce,h),Ea=f.useMemo(()=>Number.parseFloat(Fi.fontSize),[Fi]),{rowHeight:nr,headerHeight:_i,groupHeaderHeight:Mo,theme:li,overscrollX:Ta,overscrollY:Da}=Q0({groupHeaderHeight:_t,headerHeight:wt,overscrollX:fn,overscrollY:In,remSize:Ea,rowHeight:ko,scaleToRem:Pr,theme:zn}),rr=ev(le),vr=ni??(b>1e4?48:b>1e3?44:b>100?36:32),Ln=xn!=="none",G=Ln?1:0,Ht=Ie!==void 0,ur=Ie?.sticky===!0,[Oa,Ar]=f.useState(!1),Pa=Kt??Oa,si=f.useCallback(()=>{Dt!==void 0?Dt():Ar(!1)},[Dt]),q=f.useMemo(()=>It===void 0?void 0:Go(It,G),[It,G])??n,V=f.useRef();V.current===void 0&&(V.current=new AbortController),f.useEffect(()=>()=>V?.current.abort(),[]);const[ee,xe]=H0(Q,k,G,V.current,Ve),De=f.useCallback((w,_,A)=>{if(Pt===void 0)return!0;const $=[w[0]-G,w[1]];return Pt?.($,_,A)},[G,Pt]),fe=f.useRef(It),pe=f.useCallback((w,_)=>{_&&(w=U0(w,ee,G,R,V.current)),pt!==void 0?(fe.current=Go(w,-G),pt(fe.current)):r(w)},[pt,ee,G,R]),Xe=kr(Zt,f.useCallback((w,_,A,$)=>{Zt?.(v[A-G],_,A-G,$)},[Zt,G,v])),Me=kr(Ue,f.useCallback((w,_,A,$)=>{Ue?.(v[A-G],_,A-G,$)},[Ue,G,v])),Ze=kr(kt,f.useCallback((w,_,A,$)=>{kt?.(v[A-G],_,A-G,$)},[kt,G,v])),vt=kr(C,f.useCallback((w,_)=>C?.({...w,columnIndex:w.columnIndex-G},_)??!1,[C,G])),cn=kr(F,f.useCallback((w,_)=>F?.({...w,col:w.col-G},_)??!1,[F,G])),Ut=f.useCallback(w=>{if(Pe!==void 0){const _=Pe(Go(w,-G));return typeof _=="boolean"?_:Go(_,G)}return!0},[Pe,G]),[Mt,ut,qe]=_0(q,pe,we,ne,ye,Oe,O),dt=f.useMemo(()=>hr(sd(),li),[li]),[zt,ui]=f.useState([0,0,0]),_r=f.useMemo(()=>{if(Jt===void 0)return{};const w={};for(const _ of Jt)w[_.kind]=_;return w},[Jt]),Qt=f.useCallback(w=>w.kind!==Z.Custom?_r[w.kind]:Rn?.find(_=>_.isMatch(w)),[Rn,_r]);let{sizedColumns:ln,nonGrowWidth:Ft}=dm(v,Ve,xe,zt[0]-(G===0?0:vr)-zt[2],mr,Ia,dt,Qt,V.current);xn!=="none"&&(Ft+=vr);const Vn=f.useMemo(()=>ln.some(w=>w.group!==void 0),[ln]),mn=Vn?_i+Mo:_i,ci=q.rows.length,cr=xn==="none"?void 0:ci===0?!1:ci===Ve?!0:void 0,nt=f.useMemo(()=>xn==="none"?ln:[{title:"",width:vr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ri,rowMarker:Lr,rowMarkerChecked:cr,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:ii,headerRowMarkerDisabled:oi},...ln],[xn,ln,vr,ri,Lr,cr,pr,ii,oi]),en=f.useRef({height:1,width:1,x:0,y:0}),Hr=f.useRef(!1),{setVisibleRegion:br,visibleRegion:dr,scrollRef:Vt}=ov(dn,Bt,nr,en,()=>Hr.current=!0);en.current=dr;const Pf=dr.x+G,Ro=dr.y,vn=f.useRef(null),kn=f.useCallback(w=>{w===!0?vn.current?.focus():window.requestAnimationFrame(()=>{vn.current?.focus()})},[]),bn=Ht?Ve+1:Ve,$n=f.useCallback(w=>{const _=G===0?w:w.map($=>({...$,location:[$.location[0]-G,$.location[1]]})),A=de?.(_);if(A!==!0)for(const $ of _)ae?.($.location,$.value);return A},[ae,de,G]),[zr,La]=f.useState(),Io=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,ws=ti?q.current?.cell:void 0,Eo=ws?.[0],To=ws?.[1],Lf=f.useMemo(()=>{if((xt===void 0||xt.length===0)&&(Io??Eo??To??zr)===void 0)return;const w=[];if(xt!==void 0)for(const _ of xt){const A=nt.length-_.range.x-G;A>0&&w.push({color:_.color,range:{..._.range,x:_.range.x+G,width:Math.min(A,_.range.width)},style:_.style})}return zr!==void 0&&w.push({color:qr(dt.accentColor,0),range:zr,style:"dashed"}),Io!==void 0&&w.push({color:qr(dt.accentColor,.5),range:Io,style:"solid-outline"}),Eo!==void 0&&To!==void 0&&w.push({color:dt.accentColor,range:{x:Eo,y:To,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[zr,Io,Eo,To,xt,nt.length,dt.accentColor,G]),ys=f.useRef(nt);ys.current=nt;const Fn=f.useCallback(([w,_],A=!1)=>{const $=Ht&&_===bn-1;if(w===0&&Ln){if($)return Xo;const K=Ai(_);return K===void 0?Xo:{kind:Bn.Marker,allowOverlay:!1,checkboxStyle:Lr,checked:q?.rows.hasIndex(_)===!0,markerKind:xn==="clickable-number"?"number":xn,row:sr+K,drawHandle:an!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if($){const z=w===G?Ie?.hint??"":"",U=ys.current[w];if(U?.trailingRowOptions?.disabled===!0)return Xo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??Ie?.addIcon;return{kind:Bn.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(A||bt?.strict===!0){const U=en.current,J=U.x>K||K>U.x+U.width||U.y>_||_>U.y+U.height||_>=Ha.current,ie=K===U.extras?.selected?.[0]&&_===U.extras?.selected[1];let Se=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(jr(Rt,K,_)){Se=!0;break}}if(J&&!ie&&!Se)return Xo}let z=k([K,_]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[Ht,bn,Ln,Ai,Lr,q?.rows,xn,sr,an,G,Ie?.hint,Ie?.addIcon,bt?.strict,k]),Fa=f.useCallback(w=>{let _=gt?.(w)??{name:w};return ue!==void 0&&w!==""&&(_={icon:_.icon,name:_.name,overrideTheme:_.overrideTheme,actions:[..._.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Va({group:_.name,bounds:A.bounds})}]}),_},[gt,ue]),Do=f.useCallback(w=>{const[_,A]=w.cell,$=nt[_],X=$?.group!==void 0?Fa($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=Fr?.(A);o({...w,theme:hr(dt,X,K,z,w.content.themeOverride)})},[Fr,nt,Fa,dt]),di=f.useCallback((w,_,A)=>{if(q.current===void 0)return;const[$,X]=q.current.cell,K=Fn([$,X]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(A!==void 0)switch(z.kind){case Z.Number:{const U=Yg(()=>A==="-"?-0:Number.parseFloat(A),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:A};break}Do({target:w,content:z,initialValue:A,cell:[$,X],highlight:A===void 0,forceEditMode:A!==void 0,activation:_})}else K.kind===Z.Boolean&&_.inputType==="keyboard"&&K.readonly!==!0&&($n([{location:q.current.cell,value:{...K,data:kd(K.data)}}]),vn.current?.damage([{cell:q.current.cell}]))},[Fn,q,$n,Do]),Cs=f.useCallback((w,_)=>{const A=vn.current?.getBounds(w,_);if(A===void 0||Vt.current===null)return;const $=Fn([w,_]);$.allowOverlay&&Do({target:A,content:$,initialValue:void 0,highlight:!0,cell:[w,_],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Fn,Vt,Do]),Yt=f.useCallback((w,_,A="both",$=0,X=0,K=void 0)=>{if(Vt.current!==null){const z=vn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof _!="number"?_.unit==="cell"?_.amount:void 0:_,Se=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof _!="number"&&_.unit==="px"?_.amount:void 0;if(z!==null&&U!==null){let Qe={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ie!==void 0)&&(Qe=z.getBounds((J??0)+G,ie??0)??Qe,Qe.width===0||Qe.height===0))return;const rt=U.getBoundingClientRect(),yt=rt.width/U.offsetWidth;if(Se!==void 0&&(Qe={...Qe,x:Se-rt.left-Vt.current.scrollLeft,width:1}),Rt!==void 0&&(Qe={...Qe,y:Rt+rt.top-Vt.current.scrollTop,height:1}),Qe!==void 0){const St={x:Qe.x-$,y:Qe.y-X,width:Qe.width+2*$,height:Qe.height+2*X};let vi=0;for(let Xa=0;Xa<Te;Xa++)vi+=ln[Xa].width;let Wi=0;const Ui=mt+(ur?1:0);Ui>0&&(Wi=Qr(bn,Ui,nr));let or=vi*yt+rt.left+G*vr*yt,bi=rt.right,Br=rt.top+mn*yt,wi=rt.bottom-Wi*yt;const Ho=Qe.width+$*2;switch(K?.hAlign){case"start":bi=or+Ho;break;case"end":or=bi-Ho;break;case"center":or=Math.floor((or+bi)/2)-Ho/2,bi=or+Ho;break}const zo=Qe.height+X*2;switch(K?.vAlign){case"start":wi=Br+zo;break;case"end":Br=wi-zo;break;case"center":Br=Math.floor((Br+wi)/2)-zo/2,wi=Br+zo;break}or>St.x?Ke=St.x-or:bi<St.x+St.width&&(Ke=St.x+St.width-bi),Br>St.y?ft=St.y-Br:wi<St.y+St.height&&(ft=St.y+St.height-wi),A==="vertical"||typeof w=="number"&&w<Te?Ke=0:(A==="horizontal"||typeof _=="number"&&_>=bn-Ui)&&(ft=0),(Ke!==0||ft!==0)&&(yt!==1&&(Ke/=yt,ft/=yt),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:ft+Vt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,vr,Vt,mn,Te,ln,bn,ur,nr]),Aa=f.useRef(Cs),_a=f.useRef(k);Aa.current=Cs,_a.current=k;const Ha=f.useRef(Ve);Ha.current=Ve;const Ss=f.useRef(nt.length);Ss.current=nt.length;const wr=f.useCallback(async(w,_=!0,A)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const X=ge?.();let K,z=!0;X!==void 0&&(K=await X,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let U=0;const J=()=>{if(Ha.current<=Ve){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?Ve:0;_o.current(w-G,ie,"both",0,0,A?{behavior:A}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const Se=_a.current([w-G,ie]);Se.allowOverlay&&xi(Se)&&Se.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(w,ie)},0)};J()},[nt,ge,G,Ve,Mt]),Oo=f.useCallback(async(w,_=!0)=>{const A=Je?.();let $,X=!0;A!==void 0&&($=await A,$==="left"&&(X=!1),typeof $=="number"&&(X=!1));let K=0;const z=()=>{if(Ss.current<=nt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof $=="number"?$:X?nt.length:0;Yt(U-G,w),Mt({cell:[U,w],range:{x:U,y:w,width:1,height:1}},!1,!1,"edit");const J=_a.current([U-G,w]);J.allowOverlay&&xi(J)&&J.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(U,w)},0)};z()},[nt,Je,G,Yt,Mt]),fi=f.useCallback(w=>{const _=ln[w]?.trailingRowOptions?.targetColumn??Ie?.targetColumn;if(typeof _=="number")return _+(Ln?1:0);if(typeof _=="object"){const A=v.indexOf(_);if(A>=0)return A+(Ln?1:0)}},[ln,v,Ln,Ie?.targetColumn]),yr=f.useRef(),hi=f.useRef(),Hi=f.useCallback((w,_)=>{const[A,$]=_;return hr(dt,nt[A]?.themeOverride,Fr?.($),w.themeOverride)},[Fr,nt,dt]),{mapper:Vr}=rv(Gt,b),Gn=Gt?.navigationBehavior,zi=f.useCallback(w=>{const _=da.value?w.metaKey:w.ctrlKey,A=_&&me==="multi",[$,X]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(hi.current=void 0,$r.current=[$,X],$===0&&Ln){if(Ht===!0&&X===Ve||xn==="number"||me==="none")return;const ie=Fn(w.location);if(ie.kind!==Bn.Marker)return;if(an!==void 0){const Qe=Qt(ie);_n(Qe?.kind===Bn.Marker);const Ke=Qe?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Hi(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),kn();const Se=z.hasIndex(X),Rt=yr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Qe=[Math.min(Rt,X),Math.max(Rt,X)+1];A||He==="multi"?ut(void 0,Qe,!0):ut(et.fromSingleSelection(Qe),void 0,A)}else me==="multi"&&(A||w.isTouch||He==="multi")?Se?ut(z.remove(X),void 0,!0):(ut(void 0,X,!0),yr.current=X):Se&&z.length===1?ut(et.empty(),void 0,_):(ut(et.fromSingleSelection(X),void 0,_),yr.current=X)}else if($>=G&&Ht&&X===Ve){const ie=fi($);wr(ie??$)}else if(U!==$||J!==X){const ie=Fn(w.location),Se=Qt(ie);if(Se?.onSelect!==void 0){let Ke=!1;if(Se.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Hi(ie,w.location)}),Ke)return}if(Gn==="block"&&Vr(X).isGroupHeader)return;const Rt=ur&&X===Ve,Qe=ur&&q!==void 0&&q.current?.cell[1]===Ve;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Qe){if(Rt)return;const Ke=Math.min($,U),ft=Math.max($,U),rt=Math.min(X,J),yt=Math.max(X,J);Mt({...q.current,range:{x:Ke,y:rt,width:ft-Ke+1,height:yt-rt+1}},!0,_,"click"),yr.current=void 0,kn()}else Mt({cell:[$,X],range:{x:$,y:X,width:1,height:1}},!0,_,"click"),yr.current=void 0,o(void 0),kn()}}else if(w.kind==="header")if($r.current=[$,X],o(void 0),Ln&&$===0)yr.current=void 0,hi.current=void 0,!oi&&me==="multi"&&(z.length!==Ve?ut(et.fromSingleSelection([0,Ve]),void 0,_):ut(et.empty(),void 0,_),kn());else{const ie=hi.current;if(te==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const Se=[Math.min(ie,$),Math.max(ie,$)+1];_||w.isTouch||ht==="multi"?qe(void 0,Se,_):qe(et.fromSingleSelection(Se),void 0,_)}else te==="multi"&&(_||w.isTouch||ht==="multi")?(K.hasIndex($)?qe(K.remove($),void 0,_):qe(void 0,$,_),hi.current=$):te!=="none"&&(K.hasIndex($)?qe(K.remove($),void 0,_):qe(et.fromSingleSelection($),void 0,_),hi.current=$);yr.current=void 0,kn()}else w.kind===qn?$r.current=[$,X]:w.kind===fa&&!w.isMaybeScrollbar&&(pe(Yo,!1),o(void 0),kn(),qt?.(),yr.current=void 0,hi.current=void 0)},[me,te,q,Ln,G,Ht,Ve,xn,Fn,an,kn,He,ht,Qt,Hi,ut,fi,wr,Gn,Vr,ur,Mt,oi,qe,pe,qt]),Vi=f.useRef(!1),$r=f.useRef(),xs=f.useRef(dr),ir=f.useRef(),Ff=f.useCallback(w=>{if(gi.current=!1,xs.current=en.current,w.button!==0&&w.button!==1){ir.current=void 0;return}const _=performance.now();ir.current={button:w.button,time:_,location:w.location},w?.kind==="header"&&(Vi.current=!0);const A=w.kind==="cell"&&w.isFillHandle;!A&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:A}),$r.current=void 0,!w.isTouch&&w.button===0&&!A?zi(w):!w.isTouch&&w.button===1&&($r.current=w.location))},[q,zi]),[za,Va]=f.useState(),ks=f.useCallback(w=>{if(w.kind!==qn||te!=="multi")return;const _=da.value?w.metaKey:w.ctrlKey,[A]=w.location,$=q.columns;if(A<G)return;const X=nt[A];let K=A,z=A;for(let U=A-1;U>=G&&go(X.group,nt[U].group);U--)K--;for(let U=A+1;U<nt.length&&go(X.group,nt[U].group);U++)z++;if(kn(),_||w.isTouch||ht==="multi")if($.hasAll([K,z+1])){let U=$;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,_)}else qe(void 0,[K,z+1],_);else qe(et.fromSingleSelection([K,z+1]),void 0,_)},[te,kn,q.columns,nt,G,qe,ht]),gi=f.useRef(!1),Po=f.useCallback(async w=>{if(ee!==void 0&&Xe!==void 0){const _=en.current.y,A=en.current.height;let $=ee({x:w,y:_,width:1,height:Math.min(A,Ve-_)},V.current.signal);typeof $!="object"&&($=await $());const X=ln[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const U=dd(z,dt,X,0,$,mr,ai,!1,Qt);Xe?.(X,U.width,w,U.width)}}},[ln,ee,ai,dt,mr,Xe,G,Ve,Qt]),[Af,$a]=f.useState(),pi=f.useCallback(async(w,_)=>{const A=w.current?.range;if(A===void 0||ee===void 0||_.current===void 0)return;const $=_.current.range;if(I!==void 0){let U=!1;if(I({fillDestination:{...$,x:$.x-G},patternSource:{...A,x:A.x-G},preventDefault:()=>U=!0}),U)return}let X=ee(A,V.current.signal);typeof X!="object"&&(X=await X());const K=X,z=[];for(let U=0;U<$.width;U++)for(let J=0;J<$.height;J++){const ie=[$.x+U,$.y+J];if(Qc(ie,A))continue;const Se=K[J%A.height][U%A.width];Mi(Se)||!xi(Se)||z.push({location:ie,value:{...Se}})}$n(z),vn.current?.damage(z.map(U=>({cell:U.location})))},[ee,$n,I,G]),Ms=f.useCallback(()=>{if(q.current===void 0||q.current.range.width<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,width:1}}};pi(w,q)},[pi,q]),Rs=f.useCallback(()=>{if(q.current===void 0||q.current.range.height<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,height:1}}};pi(w,q)},[pi,q]),_f=f.useCallback((w,_)=>{const A=s;if(u(void 0),La(void 0),$a(void 0),Vi.current=!1,_)return;if(A?.fillHandle===!0&&q.current!==void 0&&A.previousSelection?.current!==void 0){if(zr===void 0)return;const Se={...q,current:{...q.current,range:md(A.previousSelection.current.range,zr)}};pi(A.previousSelection,Se),pe(Se,!0);return}const[$,X]=w.location,[K,z]=$r.current??[],U=()=>{gi.current=!0},J=Se=>{const Rt=Se.isTouch||K===$&&z===X;if(Rt&&E?.([$-G,X],{...Se,preventDefault:U}),Se.button===1)return!gi.current;if(!gi.current){const Qe=Fn(w.location),Ke=Qt(Qe);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const rt=Ke.onClick({...Se,cell:Qe,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:Hi(Qe,w.location),preventDefault:U});rt!==void 0&&!Mi(rt)&&Si(rt)&&($n([{location:Se.location,value:rt}]),vn.current?.damage([{cell:Se.location}]))}if(gi.current||q.current===void 0)return!1;let ft=!1;switch(Qe.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[rt,yt]=q.current.cell,[St,vi]=A.previousSelection.current.cell;ft=$===rt&&$===St&&X===yt&&X===vi&&(Se.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const yt={inputType:"pointer",pointerActivation:Se.isDoubleClick===!0?"double-click":Qe.activationBehaviorOverride??Re,pointerType:Se.isTouch?"touch":"mouse"};return M?.([$-G,X],yt),di(Se.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const Se=en.current,Rt=xs.current;if(Se.x!==Rt.x||Se.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&so(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex($)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===qn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||zi(w):w.kind===qn?N?.(ie,{...w,preventDefault:U}):(w.kind===Mr&&x?.(ie,{...w,preventDefault:U}),zi(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Po($):w.button===0&&$===K&&X===z&&x?.(ie,{...w,preventDefault:U})}if(w.kind===qn){if(ie<0)return;w.button===0&&$===K&&X===z&&(N?.(ie,{...w,preventDefault:U}),gi.current||ks(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),$r.current=void 0},[s,q,G,zr,pi,pe,E,Fn,Qt,Re,Hi,$n,M,di,W,oe,re,zi,N,x,Po,ks]),Hf=f.useCallback(w=>{const _={...w,location:[w.location[0]-G,w.location[1]]};st?.(_),s!==void 0&&w.buttons===0&&(u(void 0),La(void 0),$a(void 0),Vi.current=!1),$a(A=>Vi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===A?.[0]&&w.scrollEdge[1]===A[1]?A:s===void 0||(ir.current?.location[0]??0)<G?void 0:w.scrollEdge)},[s,st,G]),zf=f.useCallback((w,_)=>{tt?.(w-G,_)},[tt,G]),Vf=f.useCallback((w,_)=>{je?.(w-G,_)},[je,G]),mi=q?.current?.cell,$f=f.useCallback((w,_,A,$,X,K)=>{Hr.current=!1;let z=mi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=Te===0?void 0:{x:0,y:w.y,width:Te,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:Ve-mt,width:w.width,height:mt}),Te>0&&J.push({x:0,y:Ve-mt,width:Te,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:Ht&&w.y+w.height>=Ve?w.height-1:w.height,tx:X,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};en.current=ie,br(ie),ui([_,A,$]),Dn?.(ie,ie.tx,ie.ty,ie.extras)},[mi,G,Ht,Ve,Te,mt,br,Dn]),Nf=kr(D,f.useCallback((w,_)=>D?.(w-G,_-G)!==!1,[D,G])),Bf=kr(ke,f.useCallback((w,_)=>{ke?.(w-G,_-G),te!=="none"&&qe(et.fromSingleSelection(_),void 0,!0)},[te,ke,G,qe])),Na=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Ee?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||(Na.current=!0),u(void 0)},[Ee,G]),Uf=f.useCallback(()=>{Na.current=!1},[]),Is=Gt?.selectionBehavior,Lo=f.useCallback(w=>{if(Is!=="block-spanning")return;const{isGroupHeader:_,path:A,groupRows:$}=Vr(w);if(_)return[w,w];const X=A[A.length-1],K=w-X,z=w+$-X-1;return[K,z]},[Vr,Is]),Ba=f.useRef(),Wa=f.useCallback(w=>{if(!Sd(w,Ba.current)&&(Ba.current=w,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(w.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&G===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&q.rows.hasIndex(ir.current.location[1])){const _=Math.min(ir.current.location[1],w.location[1]),A=Math.max(ir.current.location[1],w.location[1])+1;ut(et.fromSingleSelection([_,A]),void 0,!1)}else if(w.buttons!==0&&s!==void 0&&q.current!==void 0&&!Na.current&&!Vi.current&&(Oe==="rect"||Oe==="multi-rect")){const[_,A]=q.current.cell;let[$,X]=w.location;if(X<0&&(X=en.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const K=s.previousSelection.current.range;X=Math.min(X,Ht?Ve-1:Ve);const z=Wm(K,$,X,Tt);La(z)}else{if(Ht&&A===Ve)return;if(Ht&&X===Ve)if(w.kind===fa)X--;else return;$=Math.max($,G);const U=Lo(A);X=U===void 0?X:Nn(X,U[0],U[1]);const J=$-_,ie=X-A,Se={x:J>=0?_:$,y:ie>=0?A:X,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:Se},!0,!1,"drag")}}ct?.({...w,location:[w.location[0]-G,w.location[1]]})}},[s,G,me,q,Oe,ct,ut,Ht,Ve,Tt,Lo,Mt]),Gf=f.useCallback(()=>{const w=Ba.current;if(w===void 0)return;const[_,A]=w.scrollEdge;let[$,X]=w.location;const K=en.current;_===-1?$=K.extras?.freezeRegion?.x??K.x:_===1&&($=K.x+K.width),A===-1?X=Math.max(0,K.y):A===1&&(X=Math.min(Ve-1,K.y+K.height)),$=Nn($,0,nt.length-1),X=Nn(X,0,Ve-1),Wa({...w,location:[$,X]})},[nt.length,Wa,Ve]);J0(Af,Vt,Gf);const Xn=f.useCallback(w=>{if(q.current===void 0)return;const[_,A]=w,[$,X]=q.current.cell,K=q.current.range;let z=K.x,U=K.x+K.width,J=K.y,ie=K.y+K.height;const[Se,Rt]=Lo(X)??[0,Ve-1],Qe=Rt+1;if(A!==0)switch(A){case 2:{ie=Qe,J=X,Yt(0,ie,"vertical");break}case-2:{J=Se,ie=X+1,Yt(0,J,"vertical");break}case 1:{J<X?(J++,Yt(0,J,"vertical")):(ie=Math.min(Qe,ie+1),Yt(0,ie,"vertical"));break}case-1:{ie>X+1?(ie--,Yt(0,ie,"vertical")):(J=Math.max(Se,J-1),Yt(0,J,"vertical"));break}default:fo()}if(_!==0)if(_===2)U=nt.length,z=$,Yt(U-1-G,0,"horizontal");else if(_===-2)z=G,U=$+1,Yt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ft=ee({x:z,y:J,width:U-z-G,height:ie-J},V.current.signal);typeof ft=="object"&&(Ke=sv(ft))}if(_===1){let ft=!1;if(z<$){if(Ke.length>0){const rt=Ir(z+1,$+1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(z=rt,ft=!0)}else z++,ft=!0;ft&&Yt(z,0,"horizontal")}ft||(U=Math.min(nt.length,U+1),Yt(U-1-G,0,"horizontal"))}else if(_===-1){let ft=!1;if(U>$+1){if(Ke.length>0){const rt=Ir(U-1,$,-1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(U=rt,ft=!0)}else U--,ft=!0;ft&&Yt(U-G,0,"horizontal")}ft||(z=Math.max(G,z-1),Yt(z-G,0,"horizontal"))}else fo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,Lo,q,nt.length,G,Ve,Yt,Mt]),Ua=f.useRef(hn);Ua.current=hn;const Cr=f.useCallback((w,_,A,$)=>{const X=bn-(A?0:1);w=Nn(w,G,ln.length-1+G),_=Nn(_,0,X);const K=mi?.[0],z=mi?.[1];if(w===K&&_===z)return!1;if($&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),pe({...q,current:{cell:[w,_],range:{x:w,y:_,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,_],range:{x:w,y:_,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===_&&(c.current=void 0),Ua.current&&Yt(w-G,_),!0},[bn,G,ln.length,mi,q,Yt,pe,Mt]),Xf=f.useCallback((w,_)=>{i?.cell!==void 0&&w!==void 0&&Si(w)&&($n([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{vn.current?.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[A,$]=_;if(q.current!==void 0&&(A!==0||$!==0)){const X=q.current.cell[1]===bn-1&&w!==void 0,K=q.current.cell[0]===nt.length-1&&w!==void 0;let z=!0;if(X&&$===1&&ge!==void 0){z=!1;const U=q.current.cell[0]+A,J=fi(U);wr(J??U,!1)}if(K&&A===1&&Je!==void 0){z=!1;const U=q.current.cell[1]+$;Oo(U,!1)}z&&Cr(Nn(q.current.cell[0]+A,0,nt.length-1),Nn(q.current.cell[1]+$,0,bn-1),X,!1)}P?.(w,_)},[i?.cell,kn,q,P,$n,bn,Cr,nt.length,wr,Oo,ge,Je,fi]),Yf=f.useMemo(()=>`gdg-overlay-${lv++}`,[]),Nr=f.useCallback(w=>{kn();const _=[];for(let A=w.x;A<w.x+w.width;A++)for(let $=w.y;$<w.y+w.height;$++){const X=k([A-G,$]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let K;if(X.kind===Z.Custom){const z=Qt(X),U=z?.provideEditor?.({...X,location:[A-G,$]});z?.onDelete!==void 0?K=z.onDelete(X):jg(U)&&(K=U?.deletedValue?.(X))}else(Si(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(K=Qt(X)?.onDelete?.(X));K!==void 0&&!Mi(K)&&Si(K)&&_.push({location:[A,$],value:K})}$n(_),vn.current?.damage(_.map(A=>({cell:A.location})))},[kn,k,Qt,$n,G]),$i=i!==void 0,Es=f.useCallback(w=>{const _=()=>{w.stopPropagation(),w.preventDefault()},A={didMatch:!1},{bounds:$}=w,X=q.columns,K=q.rows,z=rr;if(!$i&&it(z.clear,w,A))pe(Yo,!1),qt?.();else if(!$i&&it(z.selectAll,w,A))pe({columns:et.empty(),rows:et.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:Ve},rangeStack:[]}},!1);else if(it(z.search,w,A))l?.current?.focus({preventScroll:!0}),Ar(!0);else if(it(z.delete,w,A)){const rt=Ut?.(q)??!0;if(rt!==!1){const yt=rt===!0?q:rt;if(yt.current!==void 0){Nr(yt.current.range);for(const St of yt.current.rangeStack)Nr(St)}for(const St of yt.rows)Nr({x:G,y:St,width:v.length,height:1});for(const St of yt.columns)Nr({x:St,y:0,width:1,height:Ve})}}if(A.didMatch)return _(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let Se=!1,Rt=!1;if(it(z.scrollToSelectedCell,w,A))_o.current(U-G,J);else if(te!=="none"&&it(z.selectColumn,w,A))X.hasIndex(U)?qe(X.remove(U),void 0,!0):te==="single"?qe(et.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(me!=="none"&&it(z.selectRow,w,A))K.hasIndex(J)?ut(K.remove(J),void 0,!0):me==="single"?ut(et.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!$i&&$!==void 0&&it(z.activateCell,w,A))if(J===Ve&&Ht)window.setTimeout(()=>{const rt=fi(U);wr(rt??U)},0);else{const rt={inputType:"keyboard",key:w.key};M?.([U-G,J],rt),di($,rt)}else q.current.range.height>1&&it(z.downFill,w,A)?Rs():q.current.range.width>1&&it(z.rightFill,w,A)?Ms():it(z.goToNextPage,w,A)?J+=Math.max(1,en.current.height-4):it(z.goToPreviousPage,w,A)?J-=Math.max(1,en.current.height-4):it(z.goToFirstCell,w,A)?(o(void 0),J=0,U=0):it(z.goToLastCell,w,A)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):it(z.selectToFirstCell,w,A)?(o(void 0),Xn([-2,-2])):it(z.selectToLastCell,w,A)?(o(void 0),Xn([2,2])):$i?(it(z.closeOverlay,w,A)&&o(void 0),it(z.acceptOverlayDown,w,A)&&(o(void 0),J++),it(z.acceptOverlayUp,w,A)&&(o(void 0),J--),it(z.acceptOverlayLeft,w,A)&&(o(void 0),U--),it(z.acceptOverlayRight,w,A)&&(o(void 0),U++)):(it(z.goDownCell,w,A)?J+=1:it(z.goUpCell,w,A)?J-=1:it(z.goRightCell,w,A)?U+=1:it(z.goLeftCell,w,A)?U-=1:it(z.goDownCellRetainSelection,w,A)?(J+=1,Se=!0):it(z.goUpCellRetainSelection,w,A)?(J-=1,Se=!0):it(z.goRightCellRetainSelection,w,A)?(U+=1,Se=!0):it(z.goLeftCellRetainSelection,w,A)?(U-=1,Se=!0):it(z.goToLastRow,w,A)?J=Ve-1:it(z.goToFirstRow,w,A)?J=Number.MIN_SAFE_INTEGER:it(z.goToLastColumn,w,A)?U=Number.MAX_SAFE_INTEGER:it(z.goToFirstColumn,w,A)?U=Number.MIN_SAFE_INTEGER:(Oe==="rect"||Oe==="multi-rect")&&(it(z.selectGrowDown,w,A)?Xn([0,1]):it(z.selectGrowUp,w,A)?Xn([0,-1]):it(z.selectGrowRight,w,A)?Xn([1,0]):it(z.selectGrowLeft,w,A)?Xn([-1,0]):it(z.selectToLastRow,w,A)?Xn([0,2]):it(z.selectToFirstRow,w,A)?Xn([0,-2]):it(z.selectToLastColumn,w,A)?Xn([2,0]):it(z.selectToFirstColumn,w,A)&&Xn([-2,0])),Rt=A.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const rt=Gn==="skip-up"||Gn==="skip"||Gn==="block",yt=Gn==="skip-down"||Gn==="skip"||Gn==="block",St=J<ie;if(St&&rt){for(;J>=0&&Vr(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!St&&yt){for(;J<Ve&&Vr(J).isGroupHeader;)J++;J>=Ve&&(J=ie)}}const Ke=Cr(U,J,!1,Se),ft=A.didMatch;return ft&&(Ke||!Rt||Sn)&&_(),ft},[Gn,$i,q,rr,te,me,Oe,G,Vr,Ve,Cr,pe,qt,v.length,Ut,Sn,Nr,qe,ut,Ht,fi,wr,M,di,Rs,Ms,Xn]),Ni=f.useCallback(w=>{let _=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{_=!0}}),_||Es(w)||q.current===void 0)return;const[A,$]=q.current.cell,X=en.current;if(ve&&!w.metaKey&&!w.ctrlKey&&q.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&xi(k([A-G,Math.max(0,Math.min($,Ve-1))]))){if((!Ht||$!==Ve)&&(X.y>$||$>X.y+X.height||X.x>A||A>X.x+X.width))return;const K={inputType:"keyboard",key:w.key};M?.([A-G,$],K),di(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[ve,Y,Es,q,k,G,Ve,Ht,M,di]),jf=f.useCallback((w,_)=>{const A=w.location[0]-G;if(w.kind==="header"&&oe?.(A,{...w,preventDefault:_}),w.kind===qn){if(A<0)return;re?.(A,{...w,preventDefault:_})}if(w.kind==="cell"){const[$,X]=w.location;W?.([A,X],{...w,preventDefault:_}),qp(q,w.location)||Cr($,X,!1,!1)}},[q,W,re,oe,G,Cr]),Ga=f.useCallback(async w=>{if(!rr.paste)return;function _(z,U,J,ie){const Se=typeof J=="object"?J?.join(`
173
+ `)??"":J?.toString()??"";if(!Mi(z)&&xi(z)&&z.readonly!==!0){const Rt=S?.(Se,z);if(Rt!==void 0&&Si(Rt))return{location:U,value:Rt};const Qe=Qt(z);if(Qe===void 0)return;if(Qe.kind===Z.Custom){_n(z.kind===Z.Custom);const Ke=Qe.onPaste?.(Se,z.data);return Ke===void 0?void 0:{location:U,value:{...z,data:Ke}}}else{const Ke=Qe.onPaste?.(Se,z,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(`
174
+ `),rawValue:J});return Ke===void 0?void 0:(_n(Ke.kind===z.kind),{location:U,value:Ke})}}}const A=q.columns,$=q.rows,X=Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let K;if(q.current!==void 0?K=[q.current.range.x,q.current.range.y]:A.length===1?K=[A.first()??0,0]:$.length===1&&(K=[G,$.first()??0]),X&&K!==void 0){let z,U;const J="text/plain",ie="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const ft of Ke){if(ft.types.includes(ie)){const yt=await(await ft.getType(ie)).text(),St=xu(yt);if(St!==void 0){z=St;break}}ft.types.includes(J)&&(U=await(await ft.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(ie)){const Ke=w.clipboardData.getData(ie);z=xu(Ke)}z===void 0&&w.clipboardData.types.includes(J)&&(U=w.clipboardData.getData(J))}else return;const[Se,Rt]=K,Qe=[];do{if(Fe===void 0){const Ke=Fn(K),ft=U??z?.map(yt=>yt.map(St=>St.rawValue).join(" ")).join(" ")??"",rt=_(Ke,K,ft,void 0);rt!==void 0&&Qe.push(rt);break}if(z===void 0){if(U===void 0)return;z=G0(U)}if(Fe===!1||typeof Fe=="function"&&Fe?.([K[0]-G,K[1]],z.map(Ke=>Ke.map(ft=>ft.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ft]of z.entries()){if(Ke+Rt>=Ve)break;for(const[rt,yt]of ft.entries()){const St=[rt+Se,Ke+Rt],[vi,Wi]=St;if(vi>=nt.length||Wi>=bn)continue;const Ui=Fn(St),or=_(Ui,St,yt.rawValue,yt.formatted);or!==void 0&&Qe.push(or)}}}while(!1);$n(Qe),vn.current?.damage(Qe.map(Ke=>({cell:Ke.location})))}},[S,Qt,Fn,q,rr.paste,Vt,nt.length,$n,bn,Fe,G,Ve]);Mn("paste",Ga,d,!1,!0);const Bi=f.useCallback(async(w,_)=>{if(!rr.copy)return;const A=_===!0||Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,$=q.columns,X=q.rows,K=(z,U)=>{if(!Ye)Mu(z,U,w);else{const J=U.map(ie=>({kind:Z.Text,data:v[ie].title,displayData:v[ie].title,allowOverlay:!1}));Mu([J,...z],U,w)}};if(A&&ee!==void 0){if(q.current!==void 0){let z=ee(q.current.range,V.current.signal);typeof z!="object"&&(z=await z()),K(z,Ir(q.current.range.x-G,q.current.range.x+q.current.range.width-G))}else if(X!==void 0&&X.length>0){const U=[...X].map(J=>{const ie=ee({x:G,y:J,width:v.length,height:1},V.current.signal);return typeof ie=="object"?ie[0]:ie().then(Se=>Se[0])});if(U.some(J=>J instanceof Promise)){const J=await Promise.all(U);K(J,Ir(v.length))}else K(U,Ir(v.length))}else if($.length>0){const z=[],U=[];for(const J of $){let ie=ee({x:J,y:0,width:1,height:Ve},V.current.signal);typeof ie!="object"&&(ie=await ie()),z.push(ie),U.push(J-G)}if(z.length===1)K(z[0],U);else{const J=z.reduce((ie,Se)=>ie.map((Rt,Qe)=>[...Rt,...Se[Qe]]));K(J,U)}}}},[v,ee,q,rr.copy,G,Vt,Ve,Ye]);Mn("copy",Bi,d,!1,!1);const qf=f.useCallback(async w=>{if(!(!rr.cut||!(Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Bi(w),q.current!==void 0)){let A={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:et.empty(),columns:et.empty()};const $=Ut?.(A);if($===!1||(A=$===!0?A:$,A.current===void 0))return;Nr(A.current.range)}},[Nr,q,rr.cut,Bi,Vt,Ut]);Mn("cut",qf,d,!1,!1);const Kf=f.useCallback((w,_)=>{if(he!==void 0){G!==0&&(w=w.map(X=>[X[0]-G,X[1]])),he(w,_);return}if(w.length===0||_===-1)return;const[A,$]=w[_];c.current!==void 0&&c.current[0]===A&&c.current[1]===$||(c.current=[A,$],Cr(A,$,!1,!1))},[he,G,Cr]),[Fo,Ao]=It?.current?.cell??[],_o=f.useRef(Yt);_o.current=Yt,f.useLayoutEffect(()=>{Ua.current&&!Hr.current&&Fo!==void 0&&Ao!==void 0&&(Fo!==fe.current?.current?.cell[0]||Ao!==fe.current?.current?.cell[1])&&_o.current(Fo,Ao),Hr.current=!1},[Fo,Ao]);const Ts=q.current!==void 0&&(q.current.cell[0]>=nt.length||q.current.cell[1]>=bn);f.useLayoutEffect(()=>{Ts&&pe(Yo,!1)},[Ts,pe]);const Zf=f.useMemo(()=>Ht===!0&&Ie?.tint===!0?et.fromSingleSelection(bn-1):et.empty(),[bn,Ht,Ie?.tint]),Jf=f.useCallback(w=>typeof rn=="boolean"?rn:rn?.(w-G)??!0,[G,rn]),Qf=f.useMemo(()=>{if(za===void 0||a.current===null)return null;const{bounds:w,group:_}=za,A=a.current.getBoundingClientRect();return f.createElement(F0,{bounds:w,group:_,canvasBounds:A,onClose:()=>Va(void 0),onFinish:$=>{Va(void 0),ue?.(_,$)}})},[ue,za]),eh=Math.min(nt.length,Te+(Ln?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,_)=>wr(w+G,_),appendColumn:(w,_)=>Oo(w,_),updateCells:w=>(G!==0&&(w=w.map(_=>({cell:[_.cell[0]+G,_.cell[1]]}))),vn.current?.damage(w)),getBounds:(w,_)=>{if(!(a?.current===null||Vt?.current===null)){if(w===void 0&&_===void 0){const A=a.current.getBoundingClientRect(),$=A.width/Vt.current.clientWidth;return{x:A.x-Vt.current.scrollLeft*$,y:A.y-Vt.current.scrollTop*$,width:Vt.current.scrollWidth*$,height:Vt.current.scrollHeight*$}}return vn.current?.getBounds((w??0)+G,_)}},focus:()=>vn.current?.focus(),emit:async w=>{switch(w){case"delete":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Bi(void 0,!0);break;case"paste":await Ga();break}},scrollTo:Yt,remeasureColumns:w=>{for(const _ of w)Po(_+G)},getMouseArgsForPosition:(w,_,A)=>{if(vn?.current===null)return;const $=vn.current.getMouseArgsForPosition(w,_,A);if($!==void 0)return{...$,location:[$.location[0]-G,$.location[1]]}}}),[wr,Oo,Po,Vt,Bi,Ni,Ga,G,Yt]);const[Ds,Os]=mi??[],th=f.useCallback(w=>{const[_,A]=w;if(A===-1){te!=="none"&&(qe(et.fromSingleSelection(_),void 0,!1),kn());return}Ds===_&&Os===A||(Mt({cell:w,range:{x:_,y:A,width:1,height:1}},!0,!1,"keyboard-nav"),Yt(_,A))},[te,kn,Yt,Ds,Os,Mt,qe]),[nh,rh]=f.useState(!1),Ps=f.useRef(Dc(w=>{rh(w)},5)),ih=f.useCallback(()=>{Ps.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&s===void 0&&Mt({cell:[G,Ro],range:{x:G,y:Ro,width:1,height:1}},!0,!1,"keyboard-select")},[Ro,q,s,G,Mt]),oh=f.useCallback(()=>{Ps.current(!1)},[]),[ah,lh]=f.useMemo(()=>{let w;const _=bt?.scrollbarWidthOverride??wl(),A=Ve+(Ht?1:0);if(typeof nr=="number")w=mn+A*nr;else{let X=0;const K=Math.min(A,10);for(let z=0;z<K;z++)X+=nr(z);X=Math.floor(X/K),w=mn+A*X}w+=_;const $=nt.reduce((X,K)=>K.width+X,0)+_;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,w)}px`]},[nt,bt?.scrollbarWidthOverride,nr,Ve,Ht,mn]),sh=f.useMemo(()=>um(dt),[dt]);return f.createElement(ud.Provider,{value:dt},f.createElement(q0,{style:sh,className:j,inWidth:m??ah,inHeight:y??lh},f.createElement(D0,{fillHandle:Lt,drawFocusRing:ti,experimental:bt,fixedShadowX:Cn,fixedShadowY:er,getRowThemeOverride:Fr,headerIcons:tr,imageWindowLoader:B,initialSize:ze,isDraggable:Ge,onDragLeave:Ot,onRowMoved:an,overscrollX:Ta,overscrollY:Da,preventDiagonalScrolling:pn,rightElement:Wt,rightElementProps:En,smoothScrollX:Li,smoothScrollY:ei,className:j,enableGroups:Vn,onCanvasFocused:ih,onCanvasBlur:oh,canvasRef:a,onContextMenu:jf,theme:dt,cellXOffset:Pf,cellYOffset:Ro,accessibilityHeight:dr.height,onDragEnd:Uf,columns:nt,nonGrowWidth:Ft,drawHeader:vt,onColumnProposeMove:Nf,drawCell:cn,disabledRows:Zf,freezeColumns:eh,lockColumns:G,firstColAccessible:G===0,getCellContent:Fn,minColumnWidth:mr,maxColumnWidth:ai,searchInputRef:l,showSearch:Pa,onSearchClose:si,highlightRegions:Lf,getCellsForSelection:ee,getGroupDetails:Fa,headerHeight:_i,isFocused:nh,groupHeaderHeight:Vn?Mo:0,freezeTrailingRows:mt+(Ht&&Ie?.sticky===!0?1:0),hasAppendRow:Ht,onColumnResize:Xe,onColumnResizeEnd:Me,onColumnResizeStart:Ze,onCellFocused:th,onColumnMoved:Bf,onDragStart:Wf,onHeaderMenuClick:zf,onHeaderIndicatorClick:Vf,onItemHovered:Wa,isFilling:s?.fillHandle===!0,onMouseMove:Hf,onKeyDown:Ni,onKeyUp:se,onMouseDown:Ff,onMouseUp:_f,onDragOverCell:Pn,onDrop:on,onSearchResultsChanged:Kf,onVisibleRegionChanged:$f,clientSize:zt,rowHeight:nr,searchResults:ce,searchValue:L,onSearchValueChange:H,rows:bn,scrollRef:Vt,selection:q,translateX:dr.tx,translateY:dr.ty,verticalBorder:Jf,gridRef:vn,getCellRenderer:Qt,resizeIndicator:Xt}),Qf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(av,{...i,validateCell:De,bloom:T,id:Yf,getCellRenderer:Qt,className:bt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:gn,imageEditorOverride:g,portalElementRef:xo,onFinishEditing:Xf,markdownDivCreateNode:p,isOutsideClick:Tn,customEventTarget:bt?.eventTarget}))))},cv=f.forwardRef(uv);function Eu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:a,x:s,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=Wc(c,a,o.cellVerticalPadding),h=Bc(t.contentAlign??"center",s,l,o.cellHorizontalPadding,g),p=Nc(h,d,g),m=Uc(s+n,u+r,p);return Hl(t)&&m}const dv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>fv(e,e.cell.data,Hl(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Eu(e)&&e.preventDefault()},onClick:e=>{if(Eu(e))return{...e.cell,data:kd(e.cell.data)}},onPaste:(e,t)=>{let n=aa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=_l),n===t.data?void 0:{...t,data:n}}};function fv(e,t,n,r,i){if(!n&&t===aa)return;const{ctx:o,hoverAmount:l,theme:a,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=s;let v=!1;if(i>0){let b=n?1-i+i*l:.4;if(t===aa&&(b*=l),b===0)return;b<1&&(v=!0,o.globalAlpha=b)}jl(o,a,t,h,p,m,y,u,c,d,r,g),v&&(o.globalAlpha=1)}const hv=sn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),gv=e=>{const{bubbles:t}=e;return f.createElement(hv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},pv={getAccessibilityString:e=>Gc(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(gv,{bubbles:t.data})},onPaste:()=>{}};function mv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:a,width:s,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+s)break;const h=Dr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Zn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Qn(i,r))}const vv=sn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),bv=e=>{const{drilldowns:t}=e;return f.createElement(vv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},wv={getAccessibilityString:e=>Gc(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Cv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(bv,{drilldowns:t.data})},onPaste:()=>{}},il={};function yv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,a=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(il[g]!==void 0)return{el:il[g],height:s,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=d,h.height=s,p.scale(i,i),il[g]=h,p.beginPath(),Zn(p,o,o,c,l,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Zn(p,o+.5,o+.5,c,l,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Cv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:a}=e,{x:s,width:u}=n,c=r.baseFontFull,d=Ul(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,y=r.bubbleMargin;let v=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,k=yv(r.bgCell,r.drilldownBorder,g,b),E=[];for(const M of t){if(v>s+u)break;const P=Dr(M.text,i,c).width;let S=0;M.img!==void 0&&o.loadOrGetImage(M.img,l,a)!==void 0&&(S=p-8+4);const C=P+S+m*2;E.push({x:v,width:C}),v+=C+y}if(k!==null){const{el:M,height:I,middleWidth:P,sideWidth:S,width:C,dpr:F,padding:T}=k,x=S/F,D=T/F;for(const O of E){const R=Math.floor(O.x),N=Math.floor(O.width),W=N-(x-D)*2;i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,S,I,R-D,h,x,g),W>0&&i.drawImage(M,S,0,P,I,R+(x-D),h,W,g),i.drawImage(M,C-S,0,S,I,R+N-(x-D),h,x,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,I]of E.entries()){const P=t[M];let S=I.x+m;if(P.img!==void 0){const C=o.loadOrGetImage(P.img,l,a);if(C!==void 0){const F=p-8;let T=0,x=0,D=C.width,O=C.height;D>O?(T+=(D-O)/2,D=O):O>D&&(x+=(O-D)/2,O=D),i.beginPath(),Zn(i,S,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,T,x,D,O,S,h+g/2-F/2,F,F),i.restore(),S+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,S,h+g/2+Qn(i,r))}}const Sv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>xv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??wp;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},ol=4;function xv(e,t,n,r){const{rect:i,col:o,row:l,theme:a,ctx:s,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let y=0;for(let b=0;b<t.length;b++){const k=t[b];if(k.length===0)continue;const E=u.loadOrGetImage(k,o,l);if(E!==void 0){m[b]=E;const M=E.width*(p/E.height);y+=M+ol}}if(y===0)return;y-=ol;let v=c+a.cellHorizontalPadding;r==="right"?v=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(v=Math.floor(c+h/2-y/2));for(const b of m){if(b===void 0)continue;const k=b.width*(p/b.height);n>0&&(s.beginPath(),Zn(s,v,d+a.cellVerticalPadding,k,p,n),s.save(),s.clip()),s.drawImage(b,v,d+a.cellVerticalPadding,k,p),n>0&&s.restore(),v+=k+ol}}function kv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Mv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(kv(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=o.width&&(a=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);Zn(i,o.x+s,o.y+(o.height-u)/2,a,u,l.roundingRadius??3),i.fillStyle=qr(l.textDark,.1),i.fill()},onPaste:()=>{}},Rv=()=>e=>e.targetWidth,Tu=sn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Rv(),"px"]}}),Iv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:a}=e,s=t.data,u=t.readonly===!0,[c,d]=f.useState(s===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=s?"gdg-ml-6":"";return c?f.createElement(Tu,{targetWidth:o.width-20},f.createElement(Jr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(fp,null))):f.createElement(Tu,{targetWidth:o.width},f.createElement(zp,{contents:s,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Vl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:So,measure:(e,t,n)=>{const r=t.data.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:a}=e;return f.createElement(Iv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Tv={getAccessibilityString:e=>e.row.toString(),kind:Bn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Dv,measure:()=>44,draw:e=>Pv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Dv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Ov,n.textAlign="center",o}function Ov(e){const{ctx:t}=e;t.textAlign="start"}function Pv(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){l.globalAlpha=p;const m=7*(n?s:1);if(jl(l,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(c+y,d+h/2+v,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=y,l.fillText(m,v,d+h/2+Qn(l,y)),s!==0&&(l.globalAlpha=1)}}const Lv={getAccessibilityString:()=>"",kind:Bn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Fv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Fv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=s+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,l,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+v+y,u+d/2),r.lineTo(s+v+y+m,u+d/2),r.moveTo(s+v+y+m*.5,u+d/2-m*.5),r.lineTo(s+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+Qn(r,l)),r.beginPath()}function Id(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=Av(e,i,r,t,n?.fullSize??!1);e.beginPath(),Zn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??qr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function Av(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const _v=f.lazy(async()=>await Fl(()=>import("./number-overlay-editor.DgcLMWOy.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:So,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Id(r,i,u,s,o,t,l),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(_v,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},zv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Vv,onPaste:()=>{}};function Vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const $v={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>So(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:So,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Id(i,l,g,s,o,n,a),ar(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
+ `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Jr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Bv=sn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Wv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[a,s]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{s(!0)},[]);return a?f.createElement(Jr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Bv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Vl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ed(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:a}}function Du(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=rd(l,o.baseFontFull);if(a===void 0)return!1;const s=Ed(a,n,o,t.contentAlign);return jr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Uv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:So,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:a}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Dr(s,a,n.baseFontFull),d=Ed(c,l,n,t.contentAlign),{x:g,y:h,width:p,height:m}=d;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const y=Qn(a,n.baseFontFull);r("pointer");const v=5,b=h-y;a.beginPath(),a.moveTo(l.x+g,Math.floor(l.y+b+m+v)+.5),a.lineTo(l.x+g+p,Math.floor(l.y+b+m+v)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,ar({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{Du(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Du(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Wv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Gv=[Tv,Lv,dv,pv,wv,Sv,Mv,Ev,Hv,zv,$v,Nv,Uv],al=[];class Xv extends ad{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=bg(()=>{this.imageLoaded(new co(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const l=r.cells[o];if(this.isInWindow(l)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const l=al.pop()??new Image;let a=!1;const s={img:void 0,cells:[Kn(n,r)],url:t,cancel:()=>{a||(a=!0,al.length<12?al.unshift(l):o||(l.src=""))}},u=new Promise(c=>l.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{l.src=t,await u,await l.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=l;for(const d of c.cells)this.loadedLocations.push(Yl(d));o=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[i]=s}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const l=Kn(n,r);return o.cells.includes(l)||o.cells.push(l),o.img}else this.loadImage(t,n,r,i)}}const Yv=(e,t)=>{const n=f.useMemo(()=>({...$m,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Gv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Xv,[e.imageWindowLoader]);return f.createElement(cv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},jv=f.forwardRef(Yv);function Ou(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...l)=>{r.current=l,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var na={exports:{}};var qv=na.exports,Pu;function Kv(){return Pu||(Pu=1,function(e,t){(function(n,r){try{e.exports=r(hg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(qv,function(n){var r=!1,i=!1,o=!1,l=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,L){return L.length>H.length?!1:H.indexOf(L)!==-1}function c(H){for(var L="";H;)L+="0",H-=1;return L}function d(H){for(var L=H.split("").reverse(),Y=0,se=!0;se&&Y<L.length;)Y?L[Y]==="9"?L[Y]="0":(L[Y]=(parseInt(L[Y],10)+1).toString(),se=!1):(parseInt(L[Y],10)<5&&(se=!1),L[Y]="0"),Y+=1;return se&&L.push("1"),L.reverse().join("")}function g(H,L){var Y=P(R(L).sort(),function(le){return le+":"+L[le]}).join(","),se=H+"+"+Y;return g.cache[se]||(g.cache[se]=Intl.NumberFormat(H,L)),g.cache[se]}g.cache={};function h(H,L,Y){var se=L.useToLocaleString,le=L.useGrouping,ve=le&&L.grouping.slice(),ge=L.maximumSignificantDigits,Je=L.minimumIntegerDigits||1,ke=L.fractionDigits||0,Pt=L.groupingSeparator,xt=L.decimalSeparator;if(se&&Y){var Oe={minimumIntegerDigits:Je,useGrouping:le};if(ke&&(Oe.maximumFractionDigits=ke,Oe.minimumFractionDigits=ke),ge&&H>0&&(Oe.maximumSignificantDigits=ge),o){if(!l){var te=O({},L);te.useGrouping=!1,te.decimalSeparator=".",H=parseFloat(h(H,te),10)}return g(Y,Oe).format(H)}else{if(!i){var te=O({},L);te.useGrouping=!1,te.decimalSeparator=".",H=parseFloat(h(H,te),10)}return H.toLocaleString(Y,Oe)}}var me;ge?me=H.toPrecision(ge+1):me=H.toFixed(ke+1);var we,ne,ye,Pe=me.split("e");ye=Pe[1]||"",Pe=Pe[0].split("."),ne=Pe[1]||"",we=Pe[0]||"";var Ee=we.length,st=ne.length,Fe=Ee+st,Ye=we+ne;(ge&&Fe===ge+1||!ge&&st===ke+1)&&(Ye=d(Ye),Ye.length===Fe+1&&(Ee=Ee+1),st&&(Ye=Ye.slice(0,-1)),we=Ye.slice(0,Ee),ne=Ye.slice(Ee)),ge&&(ne=ne.replace(/0*$/,""));var Te=parseInt(ye,10);Te>0?ne.length<=Te?(ne=ne+c(Te-ne.length),we=we+ne,ne=""):(we=we+ne.slice(0,Te),ne=ne.slice(Te)):Te<0&&(ne=c(Math.abs(Te)-we.length)+we+ne,we="0"),ge||(ne=ne.slice(0,ke),ne.length<ke&&(ne=ne+c(ke-ne.length)),we.length<Je&&(we=c(Je-we.length)+we));var Re="";if(le){Pe=we;for(var He;Pe.length;)ve.length&&(He=ve.shift()),Re&&(Re=Pt+Re),Re=Pe.slice(-He)+Re,Pe=Pe.slice(0,-He)}else Re=we;return ne&&(Re=Re+xt+ne),Re}function p(H,L){return H.label.length>L.label.length?-1:H.label.length<L.label.length?1:0}function m(H,L){var Y=[];return I(R(L),function(se){if(se.slice(0,15)==="_durationLabels"){var le=se.slice(15).toLowerCase();I(R(L[se]),function(ve){ve.slice(0,1)===H&&Y.push({type:le,key:ve,label:L[se][ve]})})}}),Y}function y(H,L,Y){return L===1&&Y===null?H:H+H}var v={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function b(H){return Object.prototype.toString.call(H)==="[object Array]"}function k(H){return Object.prototype.toString.call(H)==="[object Object]"}function E(H,L){for(var Y=H.length;Y-=1;)if(L(H[Y]))return H[Y]}function M(H,L){var Y=0,se=H&&H.length||0,le;for(typeof L!="function"&&(le=L,L=function(ve){return ve===le});Y<se;){if(L(H[Y]))return H[Y];Y+=1}}function I(H,L){var Y=0,se=H.length;if(!(!H||!se))for(;Y<se;){if(L(H[Y],Y)===!1)return;Y+=1}}function P(H,L){var Y=0,se=H.length,le=[];if(!H||!se)return le;for(;Y<se;)le[Y]=L(H[Y],Y),Y+=1;return le}function S(H,L){return P(H,function(Y){return Y[L]})}function C(H){var L=[];return I(H,function(Y){Y&&L.push(Y)}),L}function F(H){var L=[];return I(H,function(Y){M(L,Y)||L.push(Y)}),L}function T(H,L){var Y=[];return I(H,function(se){I(L,function(le){se===le&&Y.push(se)})}),F(Y)}function x(H,L){var Y=[];return I(H,function(se,le){if(!L(se))return Y=H.slice(le),!1}),Y}function D(H,L){var Y=H.slice().reverse();return x(Y,L).reverse()}function O(H,L){for(var Y in L)L.hasOwnProperty(Y)&&(H[Y]=L[Y]);return H}function R(H){var L=[];for(var Y in H)H.hasOwnProperty(Y)&&L.push(Y);return L}function N(H,L){var Y=0,se=H.length;if(!H||!se)return!1;for(;Y<se;){if(L(H[Y],Y)===!0)return!0;Y+=1}return!1}function W(H){var L=[];return I(H,function(Y){L=L.concat(Y)}),L}function j(){var H=0;try{H.toLocaleString("i")}catch(L){return L.name==="RangeError"}return!1}function oe(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function Q(H){var L=!0;return L=L&&H(1,"en",{minimumIntegerDigits:1})==="1",L=L&&H(1,"en",{minimumIntegerDigits:2})==="01",L=L&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!L||(L=L&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",L=L&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",L=L&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",L=L&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!L)||(L=L&&H(99.99,"en",{maximumSignificantDigits:1})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:2})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:3})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",L=L&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!L)||(L=L&&H(1e3,"en",{useGrouping:!0})==="1,000",L=L&&H(1e3,"en",{useGrouping:!1})==="1000",!L))}function re(){var H=[].slice.call(arguments),L={},Y;if(I(H,function(ge,Je){if(!Je){if(!b(ge))throw"Expected array as the first argument to durationsFormat.";Y=ge}if(typeof ge=="string"||typeof ge=="function"){L.template=ge;return}if(typeof ge=="number"){L.precision=ge;return}k(ge)&&O(L,ge)}),!Y||!Y.length)return[];L.returnMomentTypes=!0;var se=P(Y,function(ge){return ge.format(L)}),le=T(a,F(S(W(se),"type"))),ve=L.largest;return ve&&(le=le.slice(0,ve)),L.returnMomentTypes=!1,L.outputTypes=le,P(Y,function(ge){return ge.format(L)})}function ue(){var H=[].slice.call(arguments),L=O({},this.format.defaults),Y=this.asMilliseconds(),se=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(Y=0,se=0);var le=Y<0,ve=n.duration(Math.abs(Y),"milliseconds"),ge=n.duration(Math.abs(se),"months");I(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}k(B)&&O(L,B)});var Je={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var Pt=function(B){return M(a,function(ze){return ke[ze].test(B)})},xt=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");L.duration=this;var Oe=typeof L.template=="function"?L.template.apply(L):L.template,te=L.outputTypes,me=L.returnMomentTypes,we=L.largest,ne=[];te||(b(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&I(L.stopTrim.match(xt),function(B){var ze=Pt(B);ze==="escape"||ze==="general"||ne.push(ze)}));var ye=n.localeData();ye||(ye={}),I(R(v),function(B){if(typeof v[B]=="function"){ye[B]||(ye[B]=v[B]);return}ye["_"+B]||(ye["_"+B]=v[B])}),I(R(ye._durationTimeTemplates),function(B){Oe=Oe.replace("_"+B+"_",ye._durationTimeTemplates[B])});var Pe=L.userLocale||n.locale(),Ee=L.useLeftUnits,st=L.usePlural,Fe=L.precision,Ye=L.forceLength,Te=L.useGrouping,Re=L.trunc,He=L.useSignificantDigits&&Fe>0,ht=He?L.precision:0,tt=ht,je=L.minValue,gt=!1,Gt=L.maxValue,Dt=!1,ct=L.useToLocaleString,qt=L.groupingSeparator,Kt=L.decimalSeparator,Dn=L.grouping;ct=ct&&(r||o);var It=L.trim;b(It)&&(It=It.join(" ")),It===null&&(we||Gt||He)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var pt=function(B){return B.test(It)},On=/large/,Ct=/small/,un=/both/,gn=/mid/,Ie=/^all|[^sm]all/,mt=/final/,Tt=we>0||N([On,un,Ie],pt),dn=N([Ct,un,Ie],pt),Bt=N([gn,Ie],pt),rn=N([mt,Ie],pt),Pn=P(Oe.match(xt),function(B,ze){var Ge=Pt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ge!=="escape"&&Ge!=="general"&&ne.push(Ge)),{index:ze,length:B.length,text:"",token:Ge==="escape"?B.replace(ke.escape,"$1"):B,type:Ge==="escape"||Ge==="general"?null:Ge}}),on={index:0,length:0,token:"",text:"",type:null},Zt=[];Ee&&Pn.reverse(),I(Pn,function(B){if(B.type){(on.type||on.text)&&Zt.push(on),on=B;return}Ee?on.text=B.token+on.text:on.text+=B.token}),(on.type||on.text)&&Zt.push(on),Ee&&Zt.reverse();var Ue=T(a,F(C(S(Zt,"type"))));if(!Ue.length)return S(Zt,"text").join("");Ue=P(Ue,function(B,ze){var Ge=ze+1===Ue.length,Ot=!ze,an;B==="years"||B==="months"?an=ge.as(B):an=ve.as(B);var fn=Math.floor(an),In=an-fn,pn=M(Zt,function(Wt){return B===Wt.type});return Ot&&Gt&&an>Gt&&(Dt=!0),Ge&&je&&Math.abs(L.duration.as(B))<je&&(gt=!0),Ot&&Ye===null&&pn.length>1&&(Ye=!0),ve.subtract(fn,B),ge.subtract(fn,B),{rawValue:an,wholeValue:fn,decimalValue:Ge?In:0,isSmallest:Ge,isLargest:Ot,type:B,tokenLength:pn.length}});var kt=Re?Math.floor:Math.round,Rn=function(B,ze){var Ge=Math.pow(10,ze);return kt(B*Ge)/Ge},Lt=!1,bt=!1,Cn=function(B,ze){var Ge={useGrouping:Te,groupingSeparator:qt,decimalSeparator:Kt,grouping:Dn,useToLocaleString:ct};return He&&(ht<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ge.maximumSignificantDigits=ht,B.significantDigits=ht)),Dt&&!bt&&(B.isLargest?(B.wholeValue=Gt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),gt&&!bt&&(B.isSmallest?(B.wholeValue=je,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Fe<0?B.value=Rn(B.wholeValue,Fe):Fe===0?B.value=kt(B.wholeValue+B.decimalValue):He?(Re?B.value=Rn(B.rawValue,ht-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ht-=B.wholeValue.toString().length)):(Ge.fractionDigits=Fe,Re?B.value=B.wholeValue+Rn(B.decimalValue,Fe):B.value=B.wholeValue+B.decimalValue):He&&B.wholeValue?(B.value=Math.round(Rn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ht-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ye||Lt)&&(Ge.minimumIntegerDigits=B.tokenLength,bt&&Ge.maximumSignificantDigits<B.tokenLength&&delete Ge.maximumSignificantDigits),!Lt&&(B.value>0||It===""||M(ne,B.type)||M(te,B.type))&&(Lt=!0),B.formattedValue=h(B.value,Ge,Pe),Ge.useGrouping=!1,Ge.decimalSeparator=".",B.formattedValueEn=h(B.value,Ge,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Ue=P(Ue,Cn),Ue=C(Ue),Ue.length>1){var er=function(B){return M(Ue,function(ze){return ze.type===B})},tr=function(B){var ze=er(B.type);ze&&I(B.targets,function(Ge){var Ot=er(Ge.type);Ot&&parseInt(ze.formattedValueEn,10)===Ge.value&&(ze.rawValue=0,ze.wholeValue=0,ze.decimalValue=0,Ot.rawValue+=1,Ot.wholeValue+=1,Ot.decimalValue=0,Ot.formattedValueEn=Ot.wholeValue.toString(),bt=!0)})};I(s,tr)}return bt&&(Lt=!1,ht=tt,Ue=P(Ue,Cn),Ue=C(Ue)),te&&!(Dt&&!L.trim)?(Ue=P(Ue,function(B){return M(te,function(ze){return B.type===ze})?B:null}),Ue=C(Ue)):(Tt&&(Ue=x(Ue,function(B){return!B.isSmallest&&!B.wholeValue&&!M(ne,B.type)})),we&&Ue.length&&(Ue=Ue.slice(0,we)),dn&&Ue.length>1&&(Ue=D(Ue,function(B){return!B.wholeValue&&!M(ne,B.type)&&!B.isLargest})),Bt&&(Ue=P(Ue,function(B,ze){return ze>0&&ze<Ue.length-1&&!B.wholeValue?null:B}),Ue=C(Ue)),rn&&Ue.length===1&&!Ue[0].wholeValue&&!(!Re&&Ue[0].isSmallest&&Ue[0].rawValue<je)&&(Ue=[])),me?Ue:(I(Zt,function(B){var ze=Je[B.type],Ge=M(Ue,function(Wt){return Wt.type===B.type});if(!(!ze||!Ge)){var Ot=Ge.formattedValueEn.split(".");Ot[0]=parseInt(Ot[0],10),Ot[1]?Ot[1]=parseFloat("0."+Ot[1],10):Ot[1]=null;var an=ye.durationPluralKey(ze,Ot[0],Ot[1]),fn=m(ze,ye),In=!1,pn={};I(ye._durationLabelTypes,function(Wt){var En=M(fn,function(Sn){return Sn.type===Wt.type&&Sn.key===an});En&&(pn[En.type]=En.label,u(B.text,Wt.string)&&(B.text=B.text.replace(Wt.string,En.label),In=!0))}),st&&!In&&(fn.sort(p),I(fn,function(Wt){if(pn[Wt.type]===Wt.label)return u(B.text,Wt.label)?!1:void 0;if(u(B.text,Wt.label))return B.text=B.text.replace(Wt.label,pn[Wt.type]),!1}))}}),Zt=P(Zt,function(B){if(!B.type)return B.text;var ze=M(Ue,function(Ot){return Ot.type===B.type});if(!ze)return"";var Ge="";return Ee&&(Ge+=B.text),(le&&Dt||!le&&gt)&&(Ge+="< ",Dt=!1,gt=!1),(le&&gt||!le&&Dt)&&(Ge+="> ",Dt=!1,gt=!1),le&&(ze.value>0||It===""||M(ne,ze.type)||M(te,ze.type))&&(Ge+="-",le=!1),B.type==="milliseconds"&&ze.formattedValueMS?Ge+=ze.formattedValueMS:Ge+=ze.formattedValue,Ee||(Ge+=B.text),Ge}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var H=this.duration,L=function(ve){return H._data[ve]},Y=M(this.types,L),se=E(this.types,L);switch(Y){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(Y===se)return"d __";case"weeks":return Y===se?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(Y===se)return"M __";case"years":return Y===se?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function de(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=re,H.duration.fn.format=ue,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",v)}var he=function(H,L,Y){return H.toLocaleString(L,Y)};r=j()&&Q(he),i=r&&oe(he);var ce=function(H,L,Y){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,Y).format(H)};return o=Q(ce),l=o&&oe(ce),de(n),de})}(na)),na.exports}Kv();const Zv=["true","t","yes","y","on","1"],Jv=["false","f","no","n","off","0"];function Et(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Ti(e){return Object.hasOwn(e,"isError")&&e.isError}function Qv(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Zl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function El(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function eb(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Tl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Pi(e,t){return Le(e)?t||{}:Le(t)?e||{}:Cc(e,t)}function Jl(e){if(Le(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:lt(n)):[lt(t)]}catch{return[lt(e)]}}function Td(e){return typeof e=="string"||e instanceof String?!0:(e instanceof kh&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function tb(e){return e?.startsWith("{")&&e.endsWith("}")}function lt(e){try{try{return xh(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Dd(e){if(Le(e))return null;if(typeof e=="boolean")return e;const t=lt(e).toLowerCase().trim();if(t==="")return null;if(Zv.includes(t))return!0;if(Jv.includes(t))return!1}function mo(e){if(Le(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=io.unformat(e.trim());if(at(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Od(e){return Le(e)?"":lt(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ha(e){if(Le(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return lt(e)}}function nb(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function Ur(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function ga(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Le(t)||t===""?at(n)?(n===0&&(e=Math.round(e)),io(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):io(e).format({thousandSeparated:!1,mantissa:nb(e),trimMantissa:!0}):t==="plain"?io(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Ur(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Ur(e,{style:"percent",minimumFractionDigits:at(n)?Math.max(n-2,0):0,maximumFractionDigits:at(n)?Math.max(n-2,0):2}):t==="dollar"?Ur(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Ur(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Ur(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Ur(e,{notation:t}):t==="accounting"?io(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Ur(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):mg.sprintf(t,e)}function Lu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw l}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function jo(e){if(Le(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Gr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Gr.utc(e);if(n.isValid())return n.toDate();const r=Gr.utc(e,[Gr.HTML5_FMT.TIME_MS,Gr.HTML5_FMT.TIME_SECONDS,Gr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Pd(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function rb(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const ib=new RegExp(/(\r\n|\n|\r)/gm);function vo(e){return e.indexOf(`
177
+ `)!==-1?e.replace(ib," "):e}function ob(e,t){if(Le(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const ab=Jn("div",{target:"e1ugbj0f0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),Ld=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Ka.parse(e):Ka.parse(Ka.stringify(e))}catch{n=void 0}return Le(n)?Ne(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:ha(e)??"",onChange:()=>{}}):Ne(ab,{"data-testid":"stJsonColumnViewer",children:Ne(vg,{src:n,collapsed:2,theme:Mh(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},lb=e=>{const t=e.theme,n=e.value.data;return Ne(Ld,{jsonValue:n.value||n.displayValue,theme:t})},sb=e=>{const t=e.theme,n=e.value;return Ne(Ld,{jsonValue:n.data,theme:t})},ub={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Wl(e,r??ha(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??ha(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:lb})},Fd="line_chart",cb="area_chart",Ad="bar_chart",db=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Ql(e,t,n,r){const i=Pi({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),o=db(r);let l;i.color==="auto"||i.color==="auto-inverse"?l=r.colors.greenColor:l=i.color?o.get(i.color)??i.color:void 0;const a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:l,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===Fd?":material/show_chart:":e===Ad?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(Le(s))return El();const u=Jl(s),c=[];let d=[];if(u.length===0)return El();let g=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER;for(let v=0;v<u.length;v++){const b=mo(u[v]);if(Number.isNaN(b)||Le(b))return Et(lt(u),`The value cannot be interpreted as a numeric array. ${lt(b)} is not a number.`);b>g&&(g=b),b<h&&(h=b),c.push(b)}let p,m;if(u.length===1){let v;g<=0?v=g===0?1:0:v=g,p=i.y_max??v,m=i.y_min??(g>=0?0:g)}else p=i.y_max??g,m=i.y_min??h;if(Le(m)||Le(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Et("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);c.length>0&&(g>p||h<m)?d=c.map(v=>g-h===0?g>(p||1)?p:m:(p-m)*((v-h)/(g-h))+m):d=c;let y=l;return(i.color==="auto"&&d[0]>d[d.length-1]||i.color==="auto-inverse"&&d[0]<d[d.length-1])&&(y=r.colors.redColor),{...a,copyData:c.join(","),data:{...a.data,values:d,displayValues:c.map(v=>ga(v)),yAxis:[m,p],color:y},isMissingValue:Le(s)}},getCellValue(s){return s.kind===Z.Loading||s.data?.values===void 0?null:s.data?.values}}}function _d(e,t){return Ql(Fd,e,"line",t)}_d.isEditableType=!1;function Hd(e,t){return Ql(Ad,e,"bar",t)}Hd.isEditableType=!1;function zd(e,t){return Ql(cb,e,"area",t)}zd.isEditableType=!1;function es(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(tn(t.radii.md),tn(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=Dd(r),i===void 0?Et(lt(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Le(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}es.isEditableType=!0;function Fu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ts(e,t,n,r,i,o,l){const a=Pi({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(at(a.timezone))try{s=Fu(_s(),a.timezone)?.utcOffset()||void 0}catch{}let u;at(a.min_value)&&(u=jo(a.min_value)||void 0);let c;at(a.max_value)&&(c=jo(a.max_value)||void 0);const d={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const p=jo(h);return p===null?!t.isRequired:!(p===void 0||at(u)&&o(p)<o(u)||at(c)&&o(p)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,p){if(p===!0){const k=g(h);if(k===!1)return Et(lt(h),"Invalid input.");k instanceof Date&&(h=k)}const m=jo(h);let y="",v="",b=s;if(m===void 0)return Et(lt(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let k=_s.utc(m);if(!k.isValid())return Et(lt(m),`Invalid moment date. This should never happen. Please report this bug.
178
+ Error: ${k.toString()}`);if(a.timezone){try{k=Fu(k,a.timezone)}catch(E){return Et(k.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
179
+ Error: ${E}`)}b=k.utcOffset()}try{v=Lu(k,a.format||n,e)}catch(E){return Et(k.toISOString(),`Failed to format the date for rendering with: ${a.format}.
180
+ Error: ${E}`)}y=Lu(k,n,e)}return{...d,copyData:y,isMissingValue:Le(m),data:{...d.data,date:m,displayDate:v,timezoneOffset:b}}},getCellValue(h){return Le(h?.data?.date)?null:o(h.data.date)}}}function ns(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=Rh(e.arrowType),r=at(n)||at(e?.columnTypeOptions?.timezone);return ts("datetime",e,r?t+"Z":t,1,"datetime-local",i=>r?i.toISOString():i.toISOString().replace("Z",""),n)}ns.isEditableType=!0;function rs(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),ts("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}rs.isEditableType=!0;function is(e){return ts("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}is.isEditableType=!0;function Vd(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=at(n)?[lt(n)]:[];return{...t,data:r,isMissingValue:!at(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Vd.isEditableType=!1;function $d(e){const t={kind:Z.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=at(n)?vo(ha(n)):"";return{...t,copyData:r,isMissingValue:Le(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Et(lt(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}$d.isEditableType=!1;function Nd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(s){n=`Invalid validate regex: ${t.validate}.
181
+ Error: ${s}`}let r=!1,i=t.display_text,o;if(!Le(i)){if(i.startsWith(":material/")&&Ih(i))i=Eh(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const l={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:Th.iconFont,linkColor:void 0}}},a=s=>{if(Le(s))return!e.isRequired;const u=lt(s);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:a,getCell(s,u){if(Le(s))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=s;if(typeof n=="string")return Et(lt(c),n);if(u&&a(c)===!1)return Et(lt(c),"Invalid input.");let d="";return c&&(o!==void 0?d=ob(o,c):d=i||c),{...l,data:c,displayData:d,isMissingValue:Le(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(s){return Le(s.data)?null:s.data}}}Nd.isEditableType=!0;function os(e){const t={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(Le(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=Jl(n);return{...t,data:{...t.data,values:r},copyData:Od(r),...e.isEditable&&!Td(n)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(n){return Le(n.data?.values)?null:n.data.values}}}os.isEditableType=!0;const fb=e=>{const t=Oh(e);return new Map(Object.entries({red:t.redbg,blue:t.bluebg,green:t.greenbg,yellow:t.yellowbg,violet:t.violetbg,purple:t.purplebg,orange:t.orangebg,gray:t.graybg,grey:t.graybg,primary:t.primarybg}))},hb=(e,t)=>{if(Le(e))return[];const n=fb(t),r=t.colors.chartCategoricalColors,i=Co(t);let o=0;return e.filter(l=>l!==null&&l!=="").map(l=>{if(typeof l=="string")return{value:lt(l).trim(),label:void 0,color:void 0};let a;l.color==="auto"?(a=Xr(r[o%r.length],i?.7:.6),o+=1):l.color&&(a=n.get(l.color)??l.color);const s=a?Dh(a,t.colors.bgColor):void 0;return{value:lt(l.value).trim(),label:l.label??void 0,color:s}})};function Bd(e,t){const n=Pi({options:[],accept_new_options:!1},e.columnTypeOptions),r=hb(n.options,t),i=new Set(r.map(l=>l.value)),o={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(l,a){if(Le(l))return{...o,data:{...o.data,values:null},isMissingValue:!0,copyData:""};let s=Jl(l);return s=s.map(u=>lt(u).trim()),a&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(u=>i.has(u)),s.length===0)?Et(lt(l),"The values could not be matched with the configured options."):{...o,data:{...o.data,values:s},copyData:Od(s),...e.isEditable&&!Td(l)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(l){return Le(l.data?.values)?null:l.data.values}}}Bd.isEditableType=!0;function as(e){const t=Pi({step:Sc(e.arrowType)?1:void 0,min_value:Ph(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Lh(e.arrowType)||Fh(e.arrowType)),r=Le(t.min_value)||t.min_value<0,i=at(t.step)&&!Number.isNaN(t.step)?Pd(t.step):void 0,o={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},l=a=>{let s=mo(a);if(Le(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return at(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),at(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:l,getCell(a,s){if(s===!0){const d=l(a);if(d===!1)return Et(lt(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=mo(a),c="";if(at(u)){if(Number.isNaN(u))return Et(lt(a),"The value cannot be interpreted as a number.");if(at(i)&&(u=rb(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Et(lt(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=bl(u,e.arrowType):c=ga(u,t.format,i)}catch(d){return Et(lt(u),at(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Le(u),copyData:Le(u)?"":lt(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}as.isEditableType=!0;function bo(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=at(n)?lt(n):null,i=at(r)?vo(r):"";return{...t,data:r,displayData:i,isMissingValue:Le(n)}}catch(r){return Et(lt(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}bo.isEditableType=!1;const gb=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Wd(e,t){const n=Sc(e.arrowType),r=Pi({min_value:0,max_value:n?100:1,format:n?"%3d%%":"percent",step:n?1:void 0,color:void 0},e.columnTypeOptions),i=gb(t),o=Le(r.step)||Number.isNaN(r.step)?void 0:Pd(r.step);let l;try{l=ga(r.max_value,r.format,o)}catch{l=lt(r.max_value)}const a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:r.min_value,max:r.max_value,step:r.step??.01,value:r.min_value,label:String(r.min_value),measureLabel:l}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(s){if(Le(s))return El();if(Le(r.min_value)||Le(r.max_value)||Number.isNaN(r.min_value)||Number.isNaN(r.max_value)||r.min_value>=r.max_value)return Et("Invalid min/max parameters",`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(at(r.step)&&Number.isNaN(r.step))return Et("Invalid step parameter",`The step parameter (${r.step}) must be a valid number.`);const u=mo(s);if(Number.isNaN(u)||Le(u))return Et(lt(s),"The value cannot be interpreted as a number.");if(Number.isInteger(u)&&!Number.isSafeInteger(u))return Et(lt(s),"The value is larger than the maximum supported integer values in number columns (2^53).");let c="";try{c=ga(u,r.format,o)}catch(h){return Et(lt(u),at(r.format)?`Failed to format the number based on the provided format configuration: (${r.format}). Error: ${h}`:`Failed to format the number. Error: ${h}`)}const d=Math.min(r.max_value,Math.max(r.min_value,u));let g;if(r.color==="auto"||r.color==="auto-inverse"){const h=r.max_value-r.min_value,m=(h===0?0:(d-r.min_value)/h)>.5;r.color==="auto"?g=m?t?.colors.greenColor:t?.colors.redColor:g=m?t?.colors.redColor:t?.colors.greenColor}else r.color&&(g=i.get(r.color)??r.color);return{...a,isMissingValue:Le(s),copyData:String(u),data:{...a.data,value:d,label:c,measureLabel:c.length>l.length?c:l,color:g}}},getCellValue(s){return s.kind===Z.Loading||s.data?.value===void 0?null:s.data?.value}}}Wd.isEditableType=!1;const pb=e=>Le(e)?[]:e.filter(t=>at(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=lt(t.value).trim();return{value:r,label:t.label??r}}const n=lt(t).trim();return{value:n,label:n}});function ls(e){let t="string";const n=Pi({options:xc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=s=>typeof s=="object"&&s!==null&&"value"in s,i=s=>r(s)?typeof s.value:typeof s,o=new Set(n.options.map(i));o.size===1&&(o.has("number")||o.has("bigint")?t="number":o.has("boolean")&&(t="boolean"));const l=pb(n.options),a={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...l],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,u){let c=null;return at(s)&&s!==""&&(c=lt(s)),u&&!a.data.allowedValues.some(g=>g===null?c===null:typeof g=="string"?g===c:typeof g=="object"&&"value"in g?g.value===c:!1)?Et(lt(c),"The value is not part of the allowed options."):{...a,isMissingValue:c===null,copyData:c||"",data:{...a.data,value:c}}},getCellValue(s){return Le(s.data?.value)||s.data?.value===""?null:t==="number"?mo(s.data?.value)??null:t==="boolean"?Dd(s.data?.value)??null:s.data?.value}}}ls.isEditableType=!0;function ss(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
182
+ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Le(o))return!e.isRequired;let l=lt(o),a=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(l)===!1?!1:a?l:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,l){if(typeof n=="string")return Et(lt(o),n);if(l){const a=i(o);if(a===!1)return Et(lt(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=at(o)?lt(o):null,s=at(a)?vo(a):"";return{...r,isMissingValue:Le(a),data:a,displayData:s}}catch(a){return Et("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ss.isEditableType=!0;const Au=Jn("img",{target:"e3b94od0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),mb=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Ne("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Ne(Au,{src:t})}):Ne(Au,{src:t})},_u=new Map(Object.entries({object:bo,text:ss,checkbox:es,selectbox:ls,list:os,multiselect:Bd,number:as,link:Nd,datetime:ns,date:is,time:rs,line_chart:_d,bar_chart:Hd,area_chart:zd,image:Vd,progress:Wd,json:$d})),vb=[ub];function ll(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function bb(e,t,n){const r={};if(!n.includes(t))return e;const i=ll(t,"color",n);i&&(r.textDark=i,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=i),e.kind===Z.Uri&&(r.linkColor=i));const o=ll(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const l=ll(t,"font-weight",n);return l&&(r.baseFontStyle=`${l} ${jh.sm}`),r?{...e,themeOverride:r}:e}function wb(e){return Vh(e)||$h(e)?ss:Nh(e)?ns:kc(e)?rs:Bh(e)?is:Wh(e)||Uh(e)?bo:xc(e)?es:Gh(e)?as:Xh(e)?ls:Yh(e)?os:bo}function Ud(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function us(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function yb(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=Ud(n),o=e.columnTypes[t];let l=!0;return zh(o)&&(l=!1),us({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:l,arrowType:o,isIndex:!0,isPinned:!0})}function Cb(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=Ud(n),o=e.columnTypes[t];return us({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function Gd(){return us({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:qh.INDEX,arrowField:new Ah("",new _h,!0),pandasType:void 0}})}function Hu(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(Gd()),t;for(let o=0;o<r;o++)t.push(yb(e,o));for(let o=0;o<i;o++)t.push(Cb(e,o+r));return t}function Sb(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(at(t.content)?vo(bl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&at(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;kc(t.contentType)&&at(t.field?.type?.unit)?o=gg(t.content,t.field):o=Gr.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if(Hh(t.contentType)){const o=Le(t.content)?null:bl(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(Ti(i))return i;if(!e.isEditable){if(n&&at(n?.displayContent)){const o=vo(n.displayContent);i.kind===Z.Text?i={...i,displayData:o}:i.kind===Z.Number&&Le(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===Z.Uri&&Le(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===Z.Custom&&i.data?.kind==="date-picker-cell"&&Le(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=bb(i,n.cssId,r))}return i}function Xd(e,t){return t?t?.useStretch??!1:e.useContainerWidth??!1}function Yd(e,t){return t?t.pixelWidth?t.pixelWidth:void 0:e.width||void 0}function xb(e){return e?.useContent??!1}function kb(e,t){return t?!1:e?.useStretch??!1}function Mb(e){return e?.useContent??!1}function Rb(e,t){return t?t.pixelHeight?t.pixelHeight:void 0:e.height||void 0}function sl({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const ra="_index",zu="_pos:",Vu={small:75,medium:200,large:400},jd=Al.getLogger("useColumnLoader");function Ib(e){if(!Le(e)){if(typeof e=="number")return e;if(e in Vu)return Vu[e]}}const qo=(e,t)=>Kh(e,t,(r,i)=>{if(wc(i))return i});function $u(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ra)&&(n=qo(n,t.get(ra)??{})),t.has(`${zu}${e.indexNumber}`)&&(n=qo(n,t.get(`${zu}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ra&&(n=qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=qo(n,t.get(e.id)??{})),Ng(n)?e:Cc({...e},{title:n.label,width:Ib(n.width),isEditable:at(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function Eb(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return jd.error(t),new Map}}function Nu(e){const t=e.columnTypeOptions?.type;let n;return at(t)&&(_u.has(t)?n=_u.get(t):jd.warn(`Unknown column type configured in column configuration: ${t}`)),Le(n)&&(n=wb(e.arrowType)),n}function Tb(e,t,n,r,i){const o=Kr(),l=f.useMemo(()=>Eb(e.columns),[e.columns]),[a,s]=f.useState(l);f.useEffect(()=>{s(l)},[l]);const u=f.useMemo(()=>Xd(e,i),[e,i]),c=f.useMemo(()=>Yd(e,i),[e,i]),d=u||at(c)&&c>0,g=at(e.rowHeight)&&e.rowHeight>tn("4rem"),h=f.useMemo(()=>Hu(t).map(m=>{let y={...m,...$u(m,a),isStretched:d};const v=Nu(y);return(e.editingMode===nn.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(y={...y,isEditable:!1}),e.editingMode!==nn.EditingMode.READ_ONLY&&y.isEditable==!0&&(y={...y,icon:"editable"},y.isRequired&&e.editingMode===nn.EditingMode.DYNAMIC&&(y={...y,isHidden:!1})),v(y,o)}),[t,a,d,e.editingMode,n,o]);return{columns:f.useMemo(()=>{const m=Hu(t).map(k=>{let E={...k,...$u(k,a),isStretched:d,isWrappingAllowed:g};const M=Nu(E);return(e.editingMode===nn.EditingMode.READ_ONLY||n||M.isEditableType===!1)&&(E={...E,isEditable:!1}),e.editingMode!==nn.EditingMode.READ_ONLY&&E.isEditable==!0&&(E={...E,icon:"editable"},E.isRequired&&e.editingMode===nn.EditingMode.DYNAMIC&&(E={...E,isHidden:!1})),M(E,o)}).filter(k=>!k.isHidden),y=[],v=[];r?.length?(m.forEach(k=>{k.isIndex&&!r.includes(k.name)&&!r.includes(k.id)&&k.isPinned!==!1&&y.push(k)}),r.forEach(k=>{const E=m.find(M=>M.name===k||M.id===k);E&&(E.isPinned?y.push(E):v.push(E))})):m.forEach(k=>{k.isPinned?y.push(k):v.push(k)});const b=[...y,...v];return b.length>0?b:[bo(Gd())]},[t,a,g,d,n,e.editingMode,r,o]),allColumns:h,setColumnConfigMapping:s}}function Yr(e){return e.isIndex?ra:Le(e.name)?"":e.name}class Ko{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,l,a)=>{const s={};o.forEach((u,c)=>{const d=n.get(c);d&&(s[Yr(d)]=d.getCellValue(u))}),r.edited_rows[l]=s}),this.addedRows.forEach(o=>{const l={};let a=!1;o.forEach((s,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(s);d.isRequired&&d.isEditable&&Zl(s)&&(a=!0),at(g)&&(l[Yr(d)]=g)}}),a||r.added_rows.push(l)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,l)=>l===void 0?null:l)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(l=>{i.set(l.indexNumber,l)});const o=new Map;n.forEach(l=>{o.set(Yr(l),l)}),Object.keys(r.edited_rows).forEach(l=>{const a=Number(l),s=r.edited_rows[l];Object.keys(s).forEach(u=>{const c=s[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(l=>{const a=new Map;n.forEach(s=>{a.set(s.indexNumber,s.getCell(null))}),Object.keys(l).forEach(s=>{const u=l[s],c=o.get(s);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Le(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const wo=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function Db(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>wo({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function Ob(e,t,n,r,i,o){const l=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||l?0:e.filter(c=>c.isPinned).length,s=f.useCallback(c=>{o(d=>wo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>wo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:s,freezeColumns:a}}function Pb(e,t,n,r,i){return{onColumnMoved:f.useCallback((l,a)=>{const s=[...e],[u]=s.splice(l,1);s.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(s.map(c=>c.id))},[e,t,n,r,i])}}function Lb(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,l,a,s)=>{o.id&&n(new Map(t).set(o.id,s))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function Fb(e){switch(e.kind){case Z.Number:return e.data?.toString()??"";case Z.Boolean:return e.data?.toString()??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(t=>t.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Bu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function Ab(e,t){return e=Bu(e),t=Bu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function _b(e,t){return e>t?1:e===t?0:-1}function Hb(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),l=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let p=0;p<n;p++)h[1]=p,c[d][p]=Fb(r(h))}return Ir(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:p}=u[h],m=c[h][d],y=c[h][g];let v;if(p.mode==="raw"?v=_b(m,y):p.mode==="smart"?v=Ab(m,y):v=m.localeCompare(y),v!==0)return(p.direction??"asc")==="desc"&&(v=-v),v}return 0})},[r,n,i,o]),a=f.useCallback(u=>l===void 0?u:l[u],[l]),s=f.useCallback(([u,c])=>l===void 0?r([u,c]):(c=l[c],r([u,c])),[r,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:s}}function zb(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function Vb(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:l}=Hb({columns:t.map(u=>Tl(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>zb(t,r),[t,r]),s=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:Tl(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:s,getOriginalIndex:l,getCellContent:o}}function $b(e,t){const n=f.useCallback(i=>{t(o=>wo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>wo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Nb(){return{provideEditor:f.useCallback(t=>{if(t.kind===Z.Text&&t.readonly&&tb(t.data))return{editor:sb}},[])}}const Bb={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:l}=e;let{values:a,yAxis:s,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,p]=s;if(a.length===0)return!0;a=a.map(I=>Math.min(1,Math.max(0,(I-h)/(p-h))));const m=r.cellHorizontalPadding,y=m+i.x,v=i.y+3,b=i.height-6,k=i.width-m*2,E=p-h,M=p<=0?v:h>=0?v+b:v+b*(p/E);if(!g&&h<=0&&p>=0&&(n.beginPath(),n.moveTo(y,M),n.lineTo(y+k,M),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const I=2,P=(a.length-1)*I,S=(k-P)/a.length;let C=y;for(const F of a){const T=v+b-F*b;n.moveTo(C,M),n.lineTo(C+S,M),n.lineTo(C+S,T),n.lineTo(C,T),C+=S+I}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const I=(i.width-16)/(a.length-1),P=a.map((C,F)=>({x:y+I*F,y:v+b-C*b}));n.moveTo(P[0].x,P[0].y);let S=0;if(P.length>2)for(S=1;S<P.length-2;S++){const C=(P[S].x+P[S+1].x)/2,F=(P[S].y+P[S+1].y)/2;n.quadraticCurveTo(P[S].x,P[S].y,C,F)}if(n.quadraticCurveTo(P[S].x,P[S].y,P[S+1].x,P[S+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-m,M),n.lineTo(i.x+m,M),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const C=n.createLinearGradient(0,v,0,v+b*1.4);C.addColorStop(0,u??r.accentColor);const[F,T,x]=ho(u??r.accentColor);C.addColorStop(1,`rgba(${F}, ${T}, ${x}, 0)`),n.fillStyle=C,n.fill(),n.globalAlpha=1}if(l!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const C=Math.min(a.length-1,Math.max(0,Math.round((l-m)/I)));n.moveTo(y+C*I,i.y+1),n.lineTo(y+C*I,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[C],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Wu(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function Uu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uu(Object(n),!0).forEach(function(r){ro(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Wb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function qd(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,l=o===void 0?null:o,a=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,p=lr(e,Wb),m=f.useState(a!==void 0?a:n),y=fr(m,2),v=y[0],b=y[1],k=f.useState(s!==void 0?s:i),E=fr(k,2),M=E[0],I=E[1],P=f.useState(h!==void 0?h:l),S=fr(P,2),C=S[0],F=S[1],T=f.useCallback(function(j,oe){typeof u=="function"&&u(j,oe),F(j)},[u]),x=f.useCallback(function(j,oe){var Q;typeof c=="function"&&(Q=c(j,oe)),b(Q!==void 0?Q:j)},[c]),D=f.useCallback(function(){typeof g=="function"&&g(),I(!0)},[g]),O=f.useCallback(function(){typeof d=="function"&&d(),I(!1)},[d]),R=a!==void 0?a:v,N=s!==void 0?s:M,W=h!==void 0?h:C;return Ae(Ae({},p),{},{inputValue:R,menuIsOpen:N,onChange:T,onInputChange:x,onMenuClose:O,onMenuOpen:D,value:W})}function Ub(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Gb=Math.min,Xb=Math.max,pa=Math.round,Zo=Math.floor,ma=e=>({x:e,y:e});function Yb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ma(){return typeof window<"u"}function Kd(e){return Jd(e)?(e.nodeName||"").toLowerCase():"#document"}function gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zd(e){var t;return(t=(Jd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jd(e){return Ma()?e instanceof Node||e instanceof gr(e).Node:!1}function jb(e){return Ma()?e instanceof Element||e instanceof gr(e).Element:!1}function cs(e){return Ma()?e instanceof HTMLElement||e instanceof gr(e).HTMLElement:!1}function Gu(e){return!Ma()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gr(e).ShadowRoot}function Qd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ds(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function qb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Kb(e){return["html","body","#document"].includes(Kd(e))}function ds(e){return gr(e).getComputedStyle(e)}function Zb(e){if(Kd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gu(e)&&e.host||Zd(e);return Gu(t)?t.host:t}function ef(e){const t=Zb(e);return Kb(t)?e.ownerDocument?e.ownerDocument.body:e.body:cs(t)&&Qd(t)?t:ef(t)}function va(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ef(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=gr(i);if(o){const a=Dl(l);return t.concat(l,l.visualViewport||[],Qd(i)?i:[],a&&n?va(a):[])}return t.concat(i,va(i,[],n))}function Dl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jb(e){const t=ds(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cs(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=pa(n)!==o||pa(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function fs(e){return jb(e)?e:e.contextElement}function Xu(e){const t=fs(e);if(!cs(t))return ma(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Jb(t);let l=(o?pa(n.width):n.width)/r,a=(o?pa(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Qb=ma(0);function e1(e){const t=gr(e);return!qb()||!t.visualViewport?Qb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t1(e,t,n){return!1}function Yu(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=fs(e);let l=ma(1);t&&(l=Xu(e));const a=t1()?e1(o):ma(0);let s=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const g=gr(o),h=r;let p=g,m=Dl(p);for(;m&&r&&h!==p;){const y=Xu(m),v=m.getBoundingClientRect(),b=ds(m),k=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,E=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;s*=y.x,u*=y.y,c*=y.x,d*=y.y,s+=k,u+=E,p=gr(m),m=Dl(p)}}return Yb({width:c,height:d,x:s,y:u})}function n1(e,t){let n=null,r;const i=Zd(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Zo(c),p=Zo(i.clientWidth-(u+d)),m=Zo(i.clientHeight-(c+g)),y=Zo(u),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Xb(0,Gb(1,s))||1};let k=!0;function E(M){const I=M[0].intersectionRatio;if(I!==s){if(!k)return l();I?l(!1,I):r=setTimeout(()=>{l(!1,1e-7)},1e3)}k=!1}try{n=new IntersectionObserver(E,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return l(!0),o}function r1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=fs(e),c=i||o?[...u?va(u):[],...va(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?n1(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var k;(k=h)==null||k.observe(t)})),n()}),u&&!s&&h.observe(u),h.observe(t));let p,m=s?Yu(e):null;s&&y();function y(){const v=Yu(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,s&&cancelAnimationFrame(p)}}var Ol=f.useLayoutEffect,i1=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ba=function(){};function o1(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function a1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&o.push("".concat(o1(e,l)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var wa=function(t){return p1(t)?t.filter(Boolean):Zh(t)==="object"&&t!==null?[t]:[]},tf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=lr(t,i1);return Ae({},n)},jt=function(t,n,r){var i=t.cx,o=t.getStyles,l=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},l(n,t),a)}};function Ra(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function l1(e){return Ra(e)?window.innerHeight:e.clientHeight}function nf(e){return Ra(e)?window.pageYOffset:e.scrollTop}function ya(e,t){if(Ra(e)){window.scrollTo(0,t);return}e.scrollTop=t}function s1(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function u1(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Jo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ba,i=nf(e),o=t-i,l=10,a=0;function s(){a+=l;var u=u1(a,i,o,n);ya(e,u),a<n?window.requestAnimationFrame(s):r(e)}s()}function ju(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ya(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ya(e,Math.max(t.offsetTop-i,0))}function c1(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function qu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function d1(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var rf=!1,f1={get passive(){return rf=!0}},Qo=typeof window<"u"?window:{};Qo.addEventListener&&Qo.removeEventListener&&(Qo.addEventListener("p",ba,f1),Qo.removeEventListener("p",ba,!1));var h1=rf;function g1(e){return e!=null}function p1(e){return Array.isArray(e)}function oo(e,t,n){return e?t:n}var m1=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(l){var a=fr(l,1),s=a[0];return!r.includes(s)});return o.reduce(function(l,a){var s=fr(a,2),u=s[0],c=s[1];return l[u]=c,l},{})},v1=["children","innerProps"],b1=["children","innerProps"];function w1(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,l=e.isFixedPosition,a=e.controlHeight,s=s1(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,p=g.height,m=g.top,y=n.offsetParent.getBoundingClientRect(),v=y.top,b=l?window.innerHeight:l1(s),k=nf(s),E=parseInt(getComputedStyle(n).marginBottom,10),M=parseInt(getComputedStyle(n).marginTop,10),I=v-M,P=b-m,S=I+k,C=d-k-m,F=h-b+k+E,T=k+m-M,x=160;switch(i){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!l)return o&&Jo(s,F,x),{placement:"bottom",maxHeight:t};if(!l&&C>=r||l&&P>=r){o&&Jo(s,F,x);var D=l?P-E:C-E;return{placement:"bottom",maxHeight:D}}if(i==="auto"||l){var O=t,R=l?I:S;return R>=r&&(O=Math.min(R-E-a,t)),{placement:"top",maxHeight:O}}if(i==="bottom")return o&&ya(s,F),{placement:"bottom",maxHeight:t};break;case"top":if(I>=p)return{placement:"top",maxHeight:t};if(S>=p&&!l)return o&&Jo(s,T,x),{placement:"top",maxHeight:t};if(!l&&S>=r||l&&I>=r){var N=t;return(!l&&S>=r||l&&I>=r)&&(N=l?I-M:S-M),o&&Jo(s,T,x),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function y1(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var of=function(t){return t==="auto"?"bottom":t},C1=function(t,n){var r,i=t.placement,o=t.theme,l=o.borderRadius,a=o.spacing,s=o.colors;return Ae((r={label:"menu"},ro(r,y1(i),"100%"),ro(r,"position","absolute"),ro(r,"width","100%"),ro(r,"zIndex",1),r),n?{}:{backgroundColor:s.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},af=f.createContext(null),S1=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,l=t.menuPosition,a=t.menuShouldScrollIntoView,s=t.theme,u=f.useContext(af)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=fr(g,2),p=h[0],m=h[1],y=f.useState(null),v=fr(y,2),b=v[0],k=v[1],E=s.spacing.controlHeight;return Ol(function(){var M=d.current;if(M){var I=l==="fixed",P=a&&!I,S=w1({maxHeight:i,menuEl:M,minHeight:r,placement:o,shouldScroll:P,isFixedPosition:I,controlHeight:E});m(S.maxHeight),k(S.placement),c?.(S.placement)}},[i,o,l,a,r,c,E]),n({ref:d,placerProps:Ae(Ae({},t),{},{placement:b||of(o),maxHeight:p})})},x1=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return _e("div",$e({},jt(t,"menu",{menu:!0}),{ref:r},i),n)},k1=x1,M1=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Ae({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},R1=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return _e("div",$e({},jt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},lf=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Ae({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},I1=lf,E1=lf,T1=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=lr(t,v1);return _e("div",$e({},jt(Ae(Ae({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},D1=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=lr(t,b1);return _e("div",$e({},jt(Ae(Ae({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},O1=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},P1=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,l=t.menuPlacement,a=t.menuPosition,s=f.useRef(null),u=f.useRef(null),c=f.useState(of(l)),d=fr(c,2),g=d[0],h=d[1],p=f.useMemo(function(){return{setPortalPlacement:h}},[]),m=f.useState(null),y=fr(m,2),v=y[0],b=y[1],k=f.useCallback(function(){if(i){var P=c1(i),S=a==="fixed"?0:window.pageYOffset,C=P[g]+S;(C!==v?.offset||P.left!==v?.rect.left||P.width!==v?.rect.width)&&b({offset:C,rect:P})}},[i,a,g,v?.offset,v?.rect.left,v?.rect.width]);Ol(function(){k()},[k]);var E=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&s.current&&(u.current=r1(i,s.current,k,{elementResize:"ResizeObserver"in window}))},[i,k]);Ol(function(){E()},[E]);var M=f.useCallback(function(P){s.current=P,E()},[E]);if(!n&&a!=="fixed"||!v)return null;var I=_e("div",$e({ref:M},jt(Ae(Ae({},t),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),r);return _e(af.Provider,{value:p},n?Mc.createPortal(I,n):I)},L1=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},F1=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return _e("div",$e({},jt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},A1=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,l=t.selectProps.controlShouldRenderValue;return Ae({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},_1=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return _e("div",$e({},jt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},H1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},z1=function(t){var n=t.children,r=t.innerProps;return _e("div",$e({},jt(t,"indicatorsContainer",{indicators:!0}),r),n)},Ku,V1=["size"],$1=["innerProps","isRtl","size"],N1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},sf=function(t){var n=t.size,r=lr(t,V1);return _e("svg",$e({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:N1},r))},hs=function(t){return _e(sf,$e({size:20},t),_e("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},uf=function(t){return _e(sf,$e({size:20},t),_e("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},cf=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ae({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:o*2,":hover":{color:r?l.neutral80:l.neutral40}})},B1=cf,W1=function(t){var n=t.children,r=t.innerProps;return _e("div",$e({},jt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||_e(uf,null))},U1=cf,G1=function(t){var n=t.children,r=t.innerProps;return _e("div",$e({},jt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||_e(hs,null))},X1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ae({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:o*2,marginTop:o*2})},Y1=function(t){var n=t.innerProps;return _e("span",$e({},n,jt(t,"indicatorSeparator",{"indicator-separator":!0})))},j1=Jh(Ku||(Ku=Ub([`
183
+ 0%, 80%, 100% { opacity: 0; }
184
+ 40% { opacity: 1; }
185
+ `]))),q1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,a=o.spacing.baseUnit;return Ae({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:a*2})},ul=function(t){var n=t.delay,r=t.offset;return _e("span",{css:Rc({animation:"".concat(j1," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},K1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=lr(t,$1);return _e("div",$e({},jt(Ae(Ae({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(ul,{delay:0,offset:r}),_e(ul,{delay:160,offset:!0}),_e(ul,{delay:320,offset:!r}))},Z1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,a=o.borderRadius,s=o.spacing;return Ae({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},J1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,a=t.menuIsOpen;return _e("div",$e({ref:o},jt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),l,{"aria-disabled":r||void 0}),n)},Q1=J1,ew=["data"],tw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},nw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,a=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return _e("div",$e({},jt(t,"group",{group:!0}),s),_e(l,$e({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},rw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ae({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},iw=function(t){var n=tf(t);n.data;var r=lr(n,ew);return _e("div",$e({},jt(t,"groupHeading",{"group-heading":!0}),r))},ow=nw,aw=["innerRef","isDisabled","isHidden","inputClassName"],lw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,a=o.colors;return Ae(Ae({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},sw),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:a.neutral80})},df={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},sw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ae({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},df)},uw=function(t){return Ae({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},df)},cw=function(t){var n=t.cx,r=t.value,i=tf(t),o=i.innerRef,l=i.isDisabled,a=i.isHidden,s=i.inputClassName,u=lr(i,aw);return _e("div",$e({},jt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",$e({className:n({input:!0},s),ref:o,style:uw(a),disabled:l},u)))},dw=cw,fw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Ae({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},hw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Ae({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},gw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,a=t.isFocused;return Ae({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},ff=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},pw=ff,mw=ff;function vw(e){var t=e.children,n=e.innerProps;return _e("div",$e({role:"button"},n),t||_e(hs,{size:14}))}var bw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,a=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return _e(u,{data:i,innerProps:Ae(Ae({},jt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:s},_e(c,{data:i,innerProps:Ae({},jt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),_e(d,{data:i,innerProps:Ae(Ae({},jt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:s}))},ww=bw,yw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,a=l.spacing,s=l.colors;return Ae({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Cw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,a=t.innerProps;return _e("div",$e({},jt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},a),n)},Sw=Cw,xw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ae({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},kw=function(t){var n=t.children,r=t.innerProps;return _e("div",$e({},jt(t,"placeholder",{placeholder:!0}),r),n)},Mw=kw,Rw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Ae({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Iw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return _e("div",$e({},jt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Ew=Iw,gs={ClearIndicator:G1,Control:Q1,DropdownIndicator:W1,DownChevron:uf,CrossIcon:hs,Group:ow,GroupHeading:iw,IndicatorsContainer:z1,IndicatorSeparator:Y1,Input:dw,LoadingIndicator:K1,Menu:k1,MenuList:R1,MenuPortal:P1,LoadingMessage:D1,NoOptionsMessage:T1,MultiValue:ww,MultiValueContainer:pw,MultiValueLabel:mw,MultiValueRemove:vw,Option:Sw,Placeholder:Mw,SelectContainer:F1,SingleValue:Ew,ValueContainer:_1},Tw=function(t){return Ae(Ae({},gs),t.components)},Zu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dw(e,t){return!!(e===t||Zu(e)&&Zu(t))}function Ow(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dw(e[n],t[n]))return!1;return!0}function Pw(e,t){t===void 0&&(t=Ow);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var Lw={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Fw=function(t){return _e("span",$e({css:Lw},t))},Ju=Fw,Aw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,l=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,l=o===void 0?"":o,a=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(l," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},_w=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,a=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,p=s.isMulti,m=s.isOptionDisabled,y=s.isSearchable,v=s.menuIsOpen,b=s.options,k=s.screenReaderStatus,E=s.tabSelectsValue,M=s.isLoading,I=s["aria-label"],P=s["aria-live"],S=f.useMemo(function(){return Ae(Ae({},Aw),d||{})},[d]),C=f.useMemo(function(){var R="";if(n&&S.onChange){var N=n.option,W=n.options,j=n.removedValue,oe=n.removedValues,Q=n.value,re=function(L){return Array.isArray(L)?null:L},ue=j||N||re(Q),ae=ue?g(ue):"",de=W||oe||void 0,he=de?de.map(g):[],ce=Ae({isDisabled:ue&&m(ue,a),label:ae,labels:he},n);R=S.onChange(ce)}return R},[n,S,m,a,g]),F=f.useMemo(function(){var R="",N=r||i,W=!!(r&&a&&a.includes(r));if(N&&S.onFocus){var j={focused:N,label:g(N),isDisabled:m(N,a),isSelected:W,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};R=S.onFocus(j)}return R},[r,i,g,m,S,o,a,c]),T=f.useMemo(function(){var R="";if(v&&b.length&&!M&&S.onFilter){var N=k({count:o.length});R=S.onFilter({inputValue:h,resultsMessage:N})}return R},[o,h,v,S,b,k,M]),x=n?.action==="initial-input-focus",D=f.useMemo(function(){var R="";if(S.guidance){var N=i?"value":v?"menu":"input";R=S.guidance({"aria-label":I,context:N,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:E,isInitialFocus:x})}return R},[I,r,i,p,m,y,v,S,a,E,x]),O=_e(f.Fragment,null,_e("span",{id:"aria-selection"},C),_e("span",{id:"aria-focused"},F),_e("span",{id:"aria-results"},T),_e("span",{id:"aria-guidance"},D));return _e(f.Fragment,null,_e(Ju,{id:u},x&&O),_e(Ju,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!x&&O))},Hw=_w,Pl=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],zw=new RegExp("["+Pl.map(function(e){return e.letters}).join("")+"]","g"),hf={};for(var cl=0;cl<Pl.length;cl++)for(var dl=Pl[cl],fl=0;fl<dl.letters.length;fl++)hf[dl.letters[fl]]=dl.base;var gf=function(t){return t.replace(zw,function(n){return hf[n]})},Vw=Pw(gf),Qu=function(t){return t.replace(/^\s+|\s+$/g,"")},$w=function(t){return"".concat(t.label," ").concat(t.value)},Nw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ae({ignoreCase:!0,ignoreAccents:!0,stringify:$w,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,a=i.stringify,s=i.trim,u=i.matchFrom,c=s?Qu(r):r,d=s?Qu(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=Vw(c),d=gf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Bw=["innerRef"];function Ww(e){var t=e.innerRef,n=lr(e,Bw),r=m1(n,"onExited","in","enter","exit","appear");return _e("input",$e({ref:t},r,{css:Rc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Uw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Gw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),a=f.useRef(!1),s=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,v){if(u.current!==null){var b=u.current,k=b.scrollTop,E=b.scrollHeight,M=b.clientHeight,I=u.current,P=v>0,S=E-M-k,C=!1;S>v&&l.current&&(r&&r(y),l.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&v>S?(n&&!l.current&&n(y),I.scrollTop=E,C=!0,l.current=!0):!P&&-v>k&&(i&&!a.current&&i(y),I.scrollTop=0,C=!0,a.current=!0),C&&Uw(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){s.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var v=s.current-y.changedTouches[0].clientY;c(y,v)},[c]),p=f.useCallback(function(y){if(y){var v=h1?{passive:!1}:!1;y.addEventListener("wheel",d,v),y.addEventListener("touchstart",g,v),y.addEventListener("touchmove",h,v)}},[h,g,d]),m=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return p(y),function(){m(y)}}},[t,p,m]),function(y){u.current=y}}var ec=["boxSizing","height","overflow","paddingRight","position"],tc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function nc(e){e.cancelable&&e.preventDefault()}function rc(e){e.stopPropagation()}function ic(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function oc(){return"ontouchstart"in window||navigator.maxTouchPoints}var ac=!!(typeof window<"u"&&window.document&&window.document.createElement),no=0,Ci={capture:!1,passive:!1};function Xw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;if(r&&ec.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&no<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(tc).forEach(function(p){var m=tc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&oc()&&(u.addEventListener("touchmove",nc,Ci),s&&(s.addEventListener("touchstart",ic,Ci),s.addEventListener("touchmove",rc,Ci))),no+=1}},[r]),a=f.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;no=Math.max(no-1,0),r&&no<1&&ec.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&oc()&&(u.removeEventListener("touchmove",nc,Ci),s&&(s.removeEventListener("touchstart",ic,Ci),s.removeEventListener("touchmove",rc,Ci)))}},[r]);return f.useEffect(function(){if(t){var s=o.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){o.current=s}}var Yw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function qw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,u=Gw({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),c=Xw({isEnabled:n}),d=function(h){u(h),c(h)};return _e(f.Fragment,null,n&&_e("div",{onClick:Yw,css:jw}),t(d))}var Kw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Zw=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Kw,value:"",onChange:function(){}})},Jw=Zw;function ps(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Qw(){return ps(/^iPhone/i)}function pf(){return ps(/^Mac/i)}function ey(){return ps(/^iPad/i)||pf()&&navigator.maxTouchPoints>1}function ty(){return Qw()||ey()}function ny(){return pf()||ty()}var ry=function(t){return t.label},mf=function(t){return t.label},vf=function(t){return t.value},iy=function(t){return!!t.isDisabled},oy={clearIndicator:U1,container:L1,control:Z1,dropdownIndicator:B1,group:tw,groupHeading:rw,indicatorsContainer:H1,indicatorSeparator:X1,input:lw,loadingIndicator:q1,loadingMessage:E1,menu:C1,menuList:M1,menuPortal:O1,multiValue:fw,multiValueLabel:hw,multiValueRemove:gw,noOptionsMessage:I1,option:yw,placeholder:xw,singleValue:Rw,valueContainer:A1},ay={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},ly=4,bf=4,sy=38,uy=bf*2,cy={baseUnit:bf,controlHeight:sy,menuGutter:uy},hl={borderRadius:ly,colors:ay,spacing:cy},dy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:qu(),captureMenuScroll:!qu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Nw(),formatGroupLabel:ry,getOptionLabel:mf,getOptionValue:vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:iy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!d1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function lc(e,t,n,r){var i=Cf(e,t,n),o=Sf(e,t,n),l=yf(e,t),a=Ca(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:a,index:r}}function ia(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,a){return lc(e,l,t,a)}).filter(function(l){return uc(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=lc(e,n,t,r);return uc(e,o)?o:void 0}).filter(g1)}function wf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ei(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function sc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ei(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function fy(e,t){return wf(ia(e,t))}function uc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,a=t.value;return(!kf(e)||!o)&&xf(e,{label:l,value:a,data:i},r)}function hy(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function gy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var gl=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},yf=function(t,n){return t.getOptionLabel(n)},Ca=function(t,n){return t.getOptionValue(n)};function Cf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Sf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ca(e,t);return n.some(function(i){return Ca(e,i)===r})}function xf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var kf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},py=1,ms=function(e){kg(n,e);var t=Ig(n);function n(r){var i;if(Rg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=ny(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(s,h),m=i.isOptionDisabled(s,h);if(p){var y=i.getOptionValue(s);i.setValue(h.filter(function(v){return i.getOptionValue(v)!==y}),"deselect-option",s)}else if(!m)d?i.setValue([].concat(Ei(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=oo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(oo(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=oo(s,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return gl(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return sc(ia(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return a1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return yf(i.props,s)},i.getOptionValue=function(s){return Ca(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=oy[s](u,c);d.boxSizing="border-box";var g=i.props.styles[s];return g?g(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return Tw(i.props)},i.buildCategorizedOptions=function(){return ia(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return wf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Ae({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ra(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return kf(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,y=u.menuIsOpen,v=u.onKeyDown,b=u.tabSelectsValue,k=u.openMenuOnFocus,E=i.state,M=E.focusedOption,I=E.focusedValue,P=E.selectValue;if(!m&&!(typeof v=="function"&&(v(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(I)i.removeValue(I);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!y||!b||!M||k&&i.isOptionSelected(M,P))return;i.selectOption(M);break;case"Enter":if(s.keyCode===229)break;if(y){if(!M||i.isComposing)return;i.selectOption(M);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!M)return;i.selectOption(M);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++py),i.state.selectValue=wa(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),a=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[a],i.state.focusedOptionId=gl(o,l[a])}return i}return Mg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ju(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,a=o.menuIsOpen,s=this.state.isFocused;(s&&!l&&i.isDisabled||s&&a&&!i.menuIsOpen)&&this.focusInput(),s&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ju(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,l=this.state,a=l.selectValue,s=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,l=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=l.indexOf(a);a||(s=-1);var u=l.length-1,c=-1;if(l.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var s=0,u=a.indexOf(l);l||(u=-1),i==="up"?s=u>0?u-1:a.length-1:i==="down"?s=(u+1)%a.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>a.length-1&&(s=a.length-1)):i==="last"&&(s=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(hl):Ae(Ae({},hl),this.props.theme):hl}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,a=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:a,getValue:s,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return Cf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Sf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return xf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,l=i.isSearchable,a=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,k=a||this.getElementId("input"),E=Ae(Ae(Ae({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?f.createElement(p,$e({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:k,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},E)):f.createElement(Ww,$e({id:k,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ba,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,a=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,v=h.inputValue,b=h.placeholder,k=this.state,E=k.selectValue,M=k.focusedValue,I=k.isFocused;if(!this.hasValue()||!p)return v?null:f.createElement(d,$e({},g,{key:"placeholder",isDisabled:m,isFocused:I,innerProps:{id:this.getElementId("placeholder")}}),b);if(y)return E.map(function(S,C){var F=S===M,T="".concat(i.getOptionLabel(S),"-").concat(i.getOptionValue(S));return f.createElement(l,$e({},g,{components:{Container:a,Label:s,Remove:u},isFocused:F,isDisabled:m,key:T,index:C,removeProps:{onClick:function(){return i.removeValue(S)},onTouchEnd:function(){return i.removeValue(S)},onMouseDown:function(D){D.preventDefault()}},data:S}),i.formatOptionLabel(S,"value"))});if(v)return null;var P=E[0];return f.createElement(c,$e({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,$e({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,$e({},l,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var a=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,$e({},a,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,$e({},l,{innerProps:u,isDisabled:a,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,a=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,y=this.props,v=y.captureMenuScroll,b=y.inputValue,k=y.isLoading,E=y.loadingMessage,M=y.minMenuHeight,I=y.maxMenuHeight,P=y.menuIsOpen,S=y.menuPlacement,C=y.menuPosition,F=y.menuPortalTarget,T=y.menuShouldBlockScroll,x=y.menuShouldScrollIntoView,D=y.noOptionsMessage,O=y.onMenuScrollToTop,R=y.onMenuScrollToBottom;if(!P)return null;var N=function(ae,de){var he=ae.type,ce=ae.data,H=ae.isDisabled,L=ae.isSelected,Y=ae.label,se=ae.value,le=m===ce,ve=H?void 0:function(){return i.onOptionHover(ce)},ge=H?void 0:function(){return i.selectOption(ce)},Je="".concat(i.getElementId("option"),"-").concat(de),ke={id:Je,onClick:ge,onMouseMove:ve,onMouseOver:ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:L};return f.createElement(h,$e({},p,{innerProps:ke,data:ce,isDisabled:H,isSelected:L,key:Je,label:Y,type:he,value:se,isFocused:le,innerRef:le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(ue){if(ue.type==="group"){var ae=ue.data,de=ue.options,he=ue.index,ce="".concat(i.getElementId("group"),"-").concat(he),H="".concat(ce,"-heading");return f.createElement(l,$e({},p,{key:ce,data:ae,options:de,Heading:a,headingProps:{id:H,data:ue.data},label:i.formatGroupLabel(ue.data)}),ue.options.map(function(L){return N(L,"".concat(he,"-").concat(L.index))}))}else if(ue.type==="option")return N(ue,"".concat(ue.index))});else if(k){var j=E({inputValue:b});if(j===null)return null;W=f.createElement(d,p,j)}else{var oe=D({inputValue:b});if(oe===null)return null;W=f.createElement(g,p,oe)}var Q={minMenuHeight:M,maxMenuHeight:I,menuPlacement:S,menuPosition:C,menuShouldScrollIntoView:x},re=f.createElement(S1,$e({},p,Q),function(ue){var ae=ue.ref,de=ue.placerProps,he=de.placement,ce=de.maxHeight;return f.createElement(s,$e({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:k,placement:he}),f.createElement(qw,{captureEnabled:v,onTopArrive:O,onBottomArrive:R,lockEnabled:T},function(H){return f.createElement(u,$e({},p,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:k,maxHeight:ce,focusedOption:m}),W)}))});return F||C==="fixed"?f.createElement(c,$e({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:S,menuPosition:C}),re):re}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,a=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(Jw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(s)if(l){var g=d.map(function(m){return i.getOptionValue(m)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(m,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(m)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,a=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Hw,$e({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:a,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,a=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,$e({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,$e({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(s,$e({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,$e({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,a=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,v=i.isMulti,b=wa(p),k={};if(l&&(p!==l.value||h!==l.options||m!==l.menuIsOpen||y!==l.inputValue)){var E=m?fy(i,b):[],M=m?sc(ia(i,b),"".concat(g,"-option")):[],I=a?hy(o,b):null,P=gy(o,E),S=gl(M,P);k={selectValue:b,focusedOption:P,focusedOptionId:S,focusableOptionsWithIds:M,focusedValue:I,clearFocusValueOnUpdate:!1}}var C=s!=null&&i!==l?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},F=u,T=c&&d;return c&&!T&&(F={value:oo(v,b,b[0]||null),options:b,action:"initial-input-focus"},T=!d),u?.action==="initial-input-focus"&&(F=null),Ae(Ae(Ae({},k),C),{},{prevProps:i,ariaSelection:F,prevWasFocused:T})}}]),n}(f.Component);ms.defaultProps=dy;var my=f.forwardRef(function(e,t){var n=qd(e);return f.createElement(ms,$e({ref:t},n))}),Mf=my;const vy=e=>{const{Menu:t}=gs,{children:n,...r}=e;return f.createElement(t,{...r},n)},by=sn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),wy=sn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),yy=sn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Cy=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:l}=t.data,[a,s]=f.useState(l),[u,c]=f.useState(r??""),d=cd(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(yy,null,f.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(by,null,f.createElement(Mf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:p?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(wy,null,f.createElement(vy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(s(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Sy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),a=typeof l=="string"?l:l?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Qn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Cy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function xy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const ky={marginRight:8},My={display:"flex",alignItems:"center",flexGrow:1},Ry={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:l,value:a,label:s,measureLabel:u,color:c}=t.data,d=i.x+r.cellHorizontalPadding,g=i.y+i.height/2,h=l-o,p=(a-o)/h,m=`${xy(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Ul(n,m)/2;n.save();let b=0;s!==void 0&&(n.font=m,b=Dr(u??s,n,m).width+r.cellHorizontalPadding);const k=i.width-r.cellHorizontalPadding*2-b;if(k>=v){const E=n.createLinearGradient(d,g,d+k,g),M=c??r.accentColor;E.addColorStop(0,M),E.addColorStop(p,M),E.addColorStop(p,r.bgBubble),E.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=E,Wu(n,d,g-v/2,k,v,v/2),n.fill(),n.beginPath(),Wu(n,d+.5,g-v/2+.5,k-1,v-1,(v-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,g+Qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return f.createElement("label",{style:My},f.createElement("input",{style:ky,type:"range",value:r,min:i,max:o,step:l,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Iy=sn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),pl=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Ey=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?pl(n,t.min,o):t.min,a=t.max instanceof Date?pl(n,t.max,o):t.max,s=pl(n,t.date,o);return e.value.readonly?$t.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):$t.createElement(Iy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Ty={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Wl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ey}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var Dy=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],cc=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),l=String(r.getOptionLabel(n)).toLowerCase();return o===i||l===i},ml={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return cc(t,o,i)})||r.some(function(o){return cc(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function Oy(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,l=o===void 0?ml.formatCreateLabel:o,a=e.isValidNewOption,s=a===void 0?ml.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?ml.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=lr(e,Dy),y=m.getOptionValue,v=y===void 0?vf:y,b=m.getOptionLabel,k=b===void 0?mf:b,E=m.inputValue,M=m.isLoading,I=m.isMulti,P=m.value,S=m.name,C=f.useMemo(function(){return s(E,wa(P),h,{getOptionValue:v,getOptionLabel:k})?c(E,l(E)):void 0},[l,c,k,v,E,s,h,P]),F=f.useMemo(function(){return(n||!M)&&C?i==="first"?[C].concat(Ei(h)):[].concat(Ei(h),[C]):h},[n,i,M,C,h]),T=f.useCallback(function(x,D){if(D.action!=="select-option")return p(x,D);var O=Array.isArray(x)?x:[x];if(O[O.length-1]===C){if(d)d(E);else{var R=c(E,E),N={action:"create-option",name:S,option:R};p(oo(I,[].concat(Ei(wa(P)),[R]),R),N)}return}p(x,D)},[c,E,I,S,C,d,p,P]);return Ae(Ae({},m),{},{options:F,onChange:T})}var Py=f.forwardRef(function(e,t){var n=qd(e),r=Oy(n);return f.createElement(ms,$e({ref:t},r))}),Ly=Py;const vs="__value",Fy=new RegExp(`^${vs}\\d+__`),Ay=sn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),_y=sn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),oa=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),Rf=(e,t,n)=>e==null?[]:e.map((r,i)=>{const o=n?`${vs}${i}__`:"",l=t.find(a=>a.value===r);return l?{...l,value:`${o}${l.value}`}:{value:`${o}${r}`,label:r}}),Hy=e=>{const{Menu:t}=gs,{children:n,...r}=e;return f.createElement(t,{...r},n)},zy=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i,portalElementRef:o}=e,{options:l,values:a,allowCreation:s,allowDuplicates:u}=t.data,c=cd(),[d,g]=f.useState(a),[h,p]=f.useState(!0),[m,y]=f.useState(n??""),v=f.useMemo(()=>oa(l??[]),[l]),b=s&&u&&v.length===0,k=f.useCallback(S=>{h&&S.stopPropagation()},[h]),E={control:(S,C)=>({...S,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:C.isDisabled?"auto":S.pointerEvents,cursor:C.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:c.bgCell}),option:(S,C)=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...C.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(S,{isDisabled:C})=>C?{display:"none"}:{...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:S=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:S=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:S=>({...S,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(S,{data:C})=>({...S,backgroundColor:C.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:C,isDisabled:F})=>({...S,paddingRight:F?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:C.color?Cl(C.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:C,isDisabled:F,isFocused:T})=>F?{display:"none"}:{...S,color:C.color?Cl(C.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:T?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},M=f.useCallback(S=>{const C=S.map(F=>u&&F.startsWith(vs)?F.replace(new RegExp(Fy),""):F);g(C),r({...t,data:{...t.data,values:C}})},[t,r,u]),I=S=>{switch(S.key){case"Enter":case"Tab":if(!m){i(t,[0,1]);return}u&&s&&(y(""),M([...d??[],m]),p(!1),S.preventDefault())}},P=s?Ly:Mf;return f.createElement(Ay,{onKeyDown:k,"data-testid":"multi-select-cell"},f.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:y,options:v,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&u&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:h,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Rf(d,v,u),onKeyDown:t.readonly?void 0:I,menuPlacement:"auto",menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:E,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>b?null:f.createElement(_y,null,f.createElement(Hy,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&M(S.map(C=>C.value))}}))},Vy={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:l,options:a}=t.data;if(l==null)return!0;const s=oa(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:d}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of l){const m=s.find(M=>M.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),v=m?.label??p,k=Dr(v,n).width+r.bubblePadding*2,E=r.bubbleHeight/2;if(d!==u.x&&d+k>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),Zn(n,d,h,k,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Cl(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(v,d+r.bubblePadding,h+E+Qn(n,r)),d+=k+r.bubbleMargin,d>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=Rf(r,oa(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),l=o.reduce((a,s)=>e.measureText(s).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:l+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:zy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=oa(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},$y="None";function dc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Ny=(e,t)=>{const{cell:n,theme:r,ctx:i}=e;Wl({...e,theme:{...r,textDark:r.textLight,headerFontFull:`${r.headerFontStyle} ${r.fontFamily}`,baseFontFull:`${r.baseFontStyle} ${r.fontFamily}`,markerFontFull:`${r.markerFontStyle} ${r.fontFamily}`}},t,n.contentAlign),i.fillStyle=r.textDark};function By(e,t){const n=f.useCallback((i,o)=>{const{cell:l,theme:a,ctx:s,rect:u}=i,c=i.col;if(Ti(l))dc(s,u,a);else if(Zl(l)&&c<e.length){const d=e[c],g=t??$y;["checkbox","line_chart","bar_chart","progress"].includes(d.kind)?o():Ny(i,g),d.isRequired&&d.isEditable&&dc(s,u,a);return}o()},[e,t]),r=f.useMemo(()=>[Bb,Sy,Ry,Ty,Vy,...vb],[]);return{drawCell:n,customRenderers:r}}function Wy(){const e=Kr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:Xr(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Xr(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Xr(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Xr(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(tn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Xr(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(tn(e.spacing.sm)),cellVerticalPadding:Math.round(tn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Qh(e.colors.secondaryBg,.1),bubbleHeight:Math.round(tn("1.25rem")),bubblePadding:Math.round(tn(e.spacing.sm)),bubbleMargin:Math.round(tn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(tn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(tn("25rem")),minColumnWidth:Math.round(tn("3.125rem")),maxColumnWidth:Math.round(tn("62.5rem")),maxColumnAutoWidth:Math.round(tn("31.25rem")),defaultRowHeight:Math.round(tn("2.1875rem")),defaultHeaderHeight:Math.round(tn("2.1875rem")),bgRowHovered:eg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Uy=Al.getLogger("useDataEditor");function Gy(e,t,n,r,i,o,l,a,s){const u=f.useCallback(([m,y],v)=>{const b=e[m];if(!b.isEditable)return;const k=b.indexNumber,E=n.current.getOriginalRowIndex(i(y)),M=r([m,y]),I=b.getCellValue(M),P=b.getCellValue(v);if(!Ti(M)&&P===I)return;const S=b.getCell(P,!0);Ti(S)?Uy.warn(`Not applying the cell edit since it causes this error:
186
+ ${S.data}`):(n.current.setCell(k,E,{...S,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const m=new Map;e.forEach(y=>{m.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(m),l()},[e,n,t,l]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const y=m.rows.toArray().map(v=>n.current.getOriginalRowIndex(i(v)));return n.current.deleteRows(y),l(),s(),a(),!1}if(m.current?.range){const y=[],v=m.current.range;for(let b=v.y;b<v.y+v.height;b++)for(let k=v.x;k<v.x+v.width;k++){const E=e[k];E.isEditable&&!E.isRequired&&(y.push({cell:[k,b]}),u([k,b],E.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,s,l]),h=f.useCallback((m,y)=>{const[v,b]=m,k=[];for(let E=0;E<y.length;E++){const M=y[E];if(E+b>=n.current.getNumRows()){if(t)break;c()}for(let I=0;I<M.length;I++){const P=M[I],S=E+b,C=I+v;if(C>=e.length)break;const F=e[C];if(F.isEditable){const T=F.getCell(P,!0);if(at(T)&&!Ti(T)){const x=F.indexNumber,D=n.current.getOriginalRowIndex(i(S)),O=F.getCellValue(r([C,S]));F.getCellValue(T)!==O&&(n.current.setCell(x,D,{...T,lastUpdated:performance.now()}),k.push({cell:[C,S]}))}}}k.length>0&&(a(),o(k))}return!1},[e,n,t,i,r,c,a,o]),p=f.useCallback((m,y)=>{const v=m[0];if(v>=e.length)return!0;const b=e[v];if(b.validateInput){const k=b.validateInput(b.getCellValue(y));return k===!0||k===!1?k:b.getCell(k)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:p}}const If=",",ao='"',Xy='"',Ef=`
187
+ `,Yy="\uFEFF",jy=new RegExp(`[${[If,ao,Ef].join("")}]`),fc=Al.getLogger("useDataExporter");function hc(e){return e.map(t=>qy(t)).join(If)+Ef}function qy(e){if(Le(e))return"";const t=lt(e);return jy.test(t)?`${ao}${t.replace(new RegExp(ao,"g"),Xy+ao)}${ao}`:t}async function gc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Yy));const o=n.map(l=>l.name);await e.write(i.encode(hc(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(hc(a)))}await e.close()}function Ky(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fl(()=>import("./es6.4AP97RGk.js").then(c=>c.a),__vite__mapDeps([21,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await gc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{fc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await gc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Sg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(s){fc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Zy(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],s=a.indexNumber,u=r.current.getOriginalRowIndex(l),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(s,u);if(at(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}const d=e.getCell(u,s),g=pg(e,u,s);return Sb(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
188
+ Error: ${a}`)}},[t,n,e,r])}}function Jy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Qy(e,t,n,r,i){const[o,l]=f.useState({columns:et.empty(),rows:et.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(nn.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(nn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(nn.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(nn.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(b=>{const k=!qa(b.rows.toArray(),o.rows.toArray()),E=!qa(b.columns.toArray(),o.columns.toArray()),M=!qa(b.current,o.current),I=a&&k||u&&E||d&&M;let P=b;if(E&&P.columns.length>=0){let S=P.columns;r.forEach((C,F)=>{C.isIndex&&(S=S.remove(F))}),S.length<P.columns.length&&(P={...P,columns:S})}l(P),I&&i(P,d)},[o,a,u,d,i,r]),v=f.useCallback((b=!1,k=!1)=>{const E={columns:k?o.columns:et.empty(),rows:b?o.rows:et.empty(),current:void 0};l(E),(!b&&a||!k&&u||d)&&i(E,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:v,processSelectionChange:y}}function eC(e,t,n,r,i,o,l,a,s,u,c){const d=e.rowHeight??t.defaultRowHeight,g=r?2:1,h=e.editingMode===nn.EditingMode.DYNAMIC?1:0,p=n+h,m=sl({numRows:p,rowHeight:d,theme:t,numHeaderRows:g}),y=Rb(e,s),v=kb(s,c),b=Mb(s),k=v?Math.max(1,Math.min(n,3)):1,E=sl({numRows:k,rowHeight:d,theme:t}),M=1e4;let I=Math.max(m,E),P=Math.min(I,t.defaultTableHeight);if(v&&u&&u>0)I=Math.max(u,I);else if(b){const W=Math.ceil(M/d),j=Math.min(p,W),oe=sl({numRows:j,rowHeight:d,theme:t,numHeaderRows:g})+1;P=Math.max(oe,E),I=Math.max(P,I)}else y&&(P=Math.max(y,E),I=Math.max(P,I));o&&(P=Math.min(P,o),I=Math.min(I,o),y||(P=I));const S=t.minColumnWidth+2*t.tableBorderWidth,C=Math.max(i,S);let F,T=C;const x=Xd(e,a),D=Yd(e,a),O=xb(a);x?F=C:D?(F=Math.min(Math.max(D,S),C),T=Math.min(Math.max(D,T),C)):O&&(F=void 0);const[R,N]=f.useState({width:F||"100%",height:v?"100%":P});return f.useLayoutEffect(()=>{x&&R.width==="100%"&&N(W=>({...W,width:C}))},[C]),f.useLayoutEffect(()=>{N(W=>({...W,width:F||"100%"}))},[F]),f.useLayoutEffect(()=>{N(W=>({...W,height:v?"100%":P}))},[P,n,u,v,c]),f.useLayoutEffect(()=>{if(l){const W=x||at(D)&&D>0;N({width:W?T:"100%",height:I})}else N({width:F||"100%",height:P})},[l]),{minHeight:E,maxHeight:I,minWidth:S,maxWidth:T,rowHeight:d,resizableSize:R,setResizableSize:N}}const tC=600,nC="⚠️ Please fill out this cell.";function rC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),l=f.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(s.kind==="header"&&at(g))d=g.help;else if(s.kind==="cell"){const h=t([u,c]);Ti(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Zl(h)?d=nC:Qv(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},tC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:l}}const Tf=Jn("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Rr=Jn("div",{target:"e32gfpu1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),Df=Jn("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),iC=Jn("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),oC=Jn("div",{target:"e32gfpu4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),aC=Jn("div",{target:"e32gfpu5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),lC=Jn("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),sC=Jn("button",{target:"e32gfpu7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),pc=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],uC={number:pc,progress:pc,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function cC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const a=Kr(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=a,g=uC[e]||[];return g.length===0?Ne(Ic,{}):Ne(xa,{triggerType:Ec.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ne(Tf,{role:"menu",children:g.map(h=>wn(Rr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:h.icon}),h.label]},h.format))}),placement:Sa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:Co(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:l})}const dC=f.memo(cC);function fC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:a,column:s,onChangeFormat:u,onAutosize:c}){const d=Kr(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:y,fontWeights:v}=d,{isCopied:b,copyToClipboard:k}=tg();f.useEffect(()=>{function I(P){P.preventDefault()}return document.addEventListener("wheel",I,{passive:!1}),document.addEventListener("touchmove",I,{passive:!1}),()=>{document.removeEventListener("wheel",I),document.removeEventListener("touchmove",I)}},[]);const E=f.useCallback(()=>{o()},[o]),M=f.useCallback(()=>{k(s.title)},[s.title,k]);return Ne(xa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:wn(Tf,{children:[wn(iC,{children:[Ne(oC,{title:s.kind,children:Ne(jn,{size:"base",iconValue:s.typeIcon||":material/notes:"})}),wn(aC,{title:s.title,children:[Ne(lC,{children:s.title}),Ne(sC,{onClick:M,title:"Copy column name","aria-label":"Copy column name",children:Ne(jn,{size:"sm",iconValue:b?":material/check:":":material/content_copy:"})})]})]}),l&&wn(Ic,{children:[wn(Rr,{onClick:()=>{l("asc"),E()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),wn(Rr,{onClick:()=>{l("desc"),E()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ne(Df,{})]}),u&&Ne(dC,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:E,children:wn(Rr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[wn("div",{children:[Ne(jn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),Ne(jn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&wn(Rr,{onClick:()=>{c(),E()},children:[Ne(jn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&wn(Rr,{onClick:()=>{i(),E()},children:[Ne(jn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&wn(Rr,{onClick:()=>{r(),E()},children:[Ne(jn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),a&&wn(Rr,{onClick:()=>{a(),E()},children:[Ne(jn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Sa.bottomRight,accessibilityType:Tc.menu,showArrow:!1,popoverMargin:tn("0.375rem"),onClickOutside:g?void 0:E,onEsc:E,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:Co(d)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:v.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Ne("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const hC=f.memo(fC),gC="(index)";function vl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const mc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Kr();return Ne(Cg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:yg.default,labelPlacement:wg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:l,$isIndeterminate:a})=>{const s=l||a?i.colors.primary:i.colors.fadedText40;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(l||a)?`0 0 0 0.2rem ${Xr(i.colors.primary,.5)}`:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},pC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:a})=>{const s=Kr(),u=h=>!(h.isHidden===!0||vl(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=vl(p,t);h?(i(p.id),m&&n(y=>[...y,p.id])):r(p.id)})};return Ne(xa,{triggerType:Ec.click,placement:Sa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>wn("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[Ne(mc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),Ne(Df,{}),Ne("div",{children:e.map(h=>{const p=vl(h,t);return Ne(mc,{label:!h.title&&h.isIndex?gC:h.title,initialValue:!(h.isHidden===!0||p),onChange:m=>{m?(i(h.id),p&&n(y=>[...y,h.id])):r(h.id)}},h.id)})})]}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Co(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Ne("div",{children:o})})},mC=f.memo(pC),vc=Jn("div",{target:"eofyeyo0"})(({theme:e,disableResize:t,minHeight:n})=>({position:"relative",display:t?"flex":"inline-block",height:"100%","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",minHeight:n,borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}));function vC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Kr(),{colors:a,fontSizes:s,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ne(xa,{content:Ne(ng,{"data-testid":"stDataFrameTooltipContent",children:Ne(rg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Sa.top,accessibilityType:Tc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Co(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ne("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const bC=f.memo(vC),bc=150,wC=15e4,yC="0.5rem";function CC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:l,widthConfig:a,heightConfig:s}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Fs(cg),{isInHorizontalLayout:p,isInRoot:m}=Fs(ig),y=f.useRef(null),v=f.useRef(null),b=og(),{height:k,elementRef:E}=ag(),M=Wy(),{getRowThemeOverride:I,onItemHovered:P}=Jy(M),{enforceDownloadInNewTab:S=!1}=f.useContext(lg),[C,F]=f.useState(!0),[T,x]=f.useState(!1),[D,O]=f.useState(!1),[R,N]=f.useState(!1),[W,j]=f.useState(),[oe,Q]=f.useState(!1),re=f.useCallback(()=>Q(Ce=>!Ce),[]),ue=f.useCallback(()=>Q(!1),[]),ae=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Le(e.editingMode)&&(e.editingMode=nn.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:he}=nn.EditingMode,ce=t.dimensions,H=Math.max(0,ce.numDataRows),L=H===0&&!(e.editingMode===he&&ce.numDataColumns>0),Y=H>wC,se=!Y&&!L&&e.editingMode!==he,le=!L&&e.editingMode===he&&!n,ve=f.useRef(new Ko(H)),[ge,Je]=f.useState(ve.current.getNumRows());f.useEffect(()=>{ve.current=new Ko(H),Je(ve.current.getNumRows())},[H]);const ke=f.useCallback(()=>{ve.current=new Ko(H),Je(ve.current.getNumRows())},[H]),[Pt,xt]=f.useState(e.columnOrder);f.useEffect(()=>{xt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Oe,allColumns:te,setColumnConfigMapping:me}=Tb(e,t,n,Pt,a);f.useEffect(()=>{if(e.editingMode===de||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});Ce&&(ve.current.fromJson(Ce,Oe),Je(ve.current.getNumRows()))},[]);const{getCellContent:we}=Zy(t,Oe,ge,ve),{columns:ne,sortColumn:ye,getOriginalIndex:Pe,getCellContent:Ee}=Vb(H,Oe,we),st=f.useCallback((Ce,wt)=>{if(!r)return;const _t={selection:{rows:[],columns:[],cells:[]}};if(_t.selection.rows=Ce.rows.toArray().map(Jt=>Pe(Jt)),_t.selection.columns=Ce.columns.toArray().map(Jt=>Yr(ne[Jt])),wt&&Ce.current){const{cell:Jt,range:Xt}=Ce.current;if(Xt)for(let hn=Xt.y;hn<Xt.y+Xt.height;hn++)for(let Wn=Xt.x;Wn<Xt.x+Xt.width;Wn++)ne[Wn].isIndex||_t.selection.cells.push([Pe(hn),Yr(ne[Wn])]);else if(Jt){const[hn,Wn]=Jt;ne[hn].isIndex||_t.selection.cells.push([Pe(Wn),Yr(ne[hn])])}}const zn=JSON.stringify(_t),Tn=r.getStringValue({id:e.id,formId:e.formId});(Tn===void 0||Tn!==zn)&&r.setStringValue({id:e.id,formId:e.formId},zn,{fromUi:!0},o)},[ne,e.id,e.formId,r,o,Pe]),{debouncedCallback:Fe}=Ou(st,bc),{gridSelection:Ye,isRowSelectionActivated:Te,isMultiRowSelectionActivated:Re,isColumnSelectionActivated:He,isMultiColumnSelectionActivated:ht,isCellSelectionActivated:tt,isMultiCellSelectionActivated:je,isRowSelected:gt,isColumnSelected:Gt,isCellSelected:Dt,clearSelection:ct,processSelectionChange:qt}=Qy(e,L,n,ne,Fe);f.useEffect(()=>{tt||ct(!0,!0)},[u]);const Kt=f.useCallback(Ce=>{v.current?.updateCells(Ce)},[]);f.useEffect(()=>{if(!Te&&!He&&!tt||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});if(Ce){const wt=ne.map(Xt=>Yr(Xt)),_t=JSON.parse(Ce);let zn=et.empty(),Tn=et.empty(),Jt;if(_t.selection?.rows?.forEach(Xt=>{zn=zn.add(Xt)}),_t.selection?.columns?.forEach(Xt=>{Tn=Tn.add(wt.indexOf(Xt))}),tt&&!je){const[Xt,hn]=_t.selection?.cells?.[0]??[];Xt!==void 0&&hn!==void 0&&(Jt=[wt.indexOf(hn),Xt])}if(zn.length>0||Tn.length>0||Jt!==void 0){const Xt={rows:zn,columns:Tn,current:Jt?{cell:Jt,range:{x:Jt[0],y:Jt[1],width:1,height:1},rangeStack:[]}:void 0};qt(Xt)}}},[]);const Dn=f.useCallback(()=>{ge!==ve.current.getNumRows()&&Je(ve.current.getNumRows())},[ge]),It=f.useCallback(()=>{if(!r)return;const Ce=ve.current.toJson(ne);let wt=r.getStringValue({id:e.id,formId:e.formId});wt===void 0&&(wt=new Ko(0).toJson([])),Ce!==wt&&r.setStringValue({id:e.id,formId:e.formId},Ce,{fromUi:!0},o)},[ne,e.id,e.formId,r,o]),{debouncedCallback:pt}=Ou(It,bc),{exportToCsv:On}=Ky(Ee,ne,ge,S),{onCellEdited:Ct,onPaste:un,onRowAppended:gn,onDelete:Ie,validateCell:mt}=Gy(ne,e.editingMode!==he,ve,Ee,Pe,Kt,Dn,pt,ct),Tt=f.useMemo(()=>L?[0]:le?[ge]:[],[L,le,ge]),{tooltip:dn,clearTooltip:Bt,onItemHovered:rn}=rC(ne,Ee,Tt),{drawCell:Pn,customRenderers:on}=By(ne,e.placeholder??void 0),{provideEditor:Zt}=Nb(),Ue=f.useCallback(Ce=>({...Ce,hasMenu:!L}),[L]),kt=f.useMemo(()=>ne.map(Ce=>Ue(Tl(Ce))),[ne,Ue]),{columns:Rn,onColumnResize:Lt}=Lb(kt),bt=t.dimensions.numHeaderRows>1,{minHeight:Cn,maxHeight:er,minWidth:tr,maxWidth:B,rowHeight:ze,resizableSize:Ge,setResizableSize:Ot}=eC(e,M,ge,bt,g||0,h,u,a,s,k,m),an=f.useCallback(([Ce,wt])=>({...eb(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:M.glideTheme.textLight},span:[0,Math.max(ne.length-1,0)]}),[ne,M.glideTheme.textLight]),fn=f.useCallback(()=>{ke(),ct()},[ke,ct]);fg({element:e,widgetMgr:r,onFormCleared:fn});const{pinColumn:In,unpinColumn:pn,freezeColumns:Wt}=Ob(ne,L,g||0,M.minColumnWidth,ct,me),{changeColumnFormat:En}=Db(me),{hideColumn:Sn,showColumn:Li}=$b(ct,me),{onColumnMoved:ei}=Pb(ne,Wt,In,pn,xt);f.useEffect(()=>{let Ce;const wt=requestAnimationFrame(()=>{Ce=setTimeout(()=>{if(E.current&&v.current){const _t=E.current?.querySelector(".dvn-stack")?.getBoundingClientRect();_t&&(O(_t.height>E.current.clientHeight),N(_t.width>E.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(wt),Ce&&clearTimeout(Ce)}},[Ge,ge,Rn,E]),f.useEffect(()=>{te.length==ne.length&&Q(!1)},[te.length,ne.length]);const Pr=!!(p||a?.useContent&&!m);return wn(vc,{className:"stDataFrame","data-testid":"stDataFrame",ref:E,isInHorizontalLayout:p,minHeight:Cn,disableResize:Pr,onPointerDown:Ce=>{if(E.current){const wt=E.current.getBoundingClientRect(),_t=(b||Math.round(tn(yC)))+1;R&&wt.height-_t<Ce.clientY-wt.top&&Ce.stopPropagation(),D&&wt.width-_t<Ce.clientX-wt.left&&Ce.stopPropagation()}},onBlur:Ce=>{!C&&!ae&&!Ce.currentTarget.contains(Ce.relatedTarget)&&!tt&&ct(!0,!0)},children:[wn(dg,{isFullScreen:u,disableFullscreenMode:i,locked:gt&&!Te||Dt||ae&&C||oe,onExpand:c,onCollapse:d,target:vc,children:[l?.map(Ce=>Ce),(Te&&gt||He&&Gt||tt&&Dt)&&Ne(yi,{label:"Clear selection",icon:xg,onClick:()=>{ct(),Bt()}}),le&&gt&&Ne(yi,{label:"Delete row(s)",icon:Eg,onClick:()=>{Ie&&(Ie(Ye),Bt())}}),le&&!gt&&Ne(yi,{label:"Add row",icon:Oc,onClick:()=>{gn&&(F(!0),gn(),Bt(),v.current?.scrollTo(0,ge,"vertical"))}}),!L&&te.length>ne.length&&Ne(mC,{columns:te,columnOrder:Pt,setColumnOrder:xt,hideColumn:Sn,showColumn:Li,isOpen:oe,onClose:ue,children:Ne(yi,{label:"Show/hide columns",icon:Lc,onClick:re})}),!Y&&!L&&Ne(yi,{label:"Download as CSV",icon:Tg,onClick:On}),!L&&Ne(yi,{label:"Search",icon:Pc,onClick:()=>{T?x(!1):(F(!0),x(!0)),Bt()}})]}),Ne(sg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:Ge,style:{border:`${M.tableBorderWidth}px solid ${M.glideTheme.borderColor}`,borderRadius:`${M.tableBorderRadius}`},minHeight:Cn,maxHeight:er,minWidth:tr,maxWidth:Pr?void 0:B,size:Ge,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!Pr,bottomLeft:!1,topLeft:!1},grid:[1,ze],snapGap:ze/3,onResizeStop:(Ce,wt,_t,zn)=>{if(y.current){const Tn=2*M.tableBorderWidth;Ot({width:y.current.size.width,height:er-y.current.size.height===Tn?y.current.size.height+Tn:y.current.size.height})}},children:Ne(jv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:v,columns:Rn,rows:L?1:ge,minColumnWidth:M.minColumnWidth,maxColumnWidth:M.maxColumnWidth,maxColumnAutoWidth:M.maxColumnAutoWidth,rowHeight:ze,headerHeight:M.defaultHeaderHeight,getCellContent:L?an:Ee,onColumnResize:ae?void 0:Lt,resizeIndicator:"header",freezeColumns:Wt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ae?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:He?void 0:ei,onItemHovered:Ce=>{P?.(Ce),rn?.(Ce)},keybindings:{downFill:!0,...tt||Y?{selectAll:!1}:{}},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(x(wt=>!wt),Ce.stopPropagation(),Ce.preventDefault())},showSearch:T,searchResults:T?void 0:[],onSearchClose:()=>{x(!1),Bt()},onHeaderClicked:(Ce,wt)=>{!se||He||(T&&x(!1),Te&&gt?ct():ct(!0,!0),ye(Ce,"auto"))},gridSelection:Ye,onGridSelectionChange:Ce=>{(C||ae)&&(qt(Ce),dn!==void 0&&Bt(),j(void 0),Q(!1))},theme:M.glideTheme,getRowThemeOverride:I,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&C?F(!1):Ce.kind!=="out-of-bounds"&&!C&&F(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:R?-b:void 0,paddingRight:D?-b:void 0},provideEditor:Zt,drawCell:Pn,customRenderers:on,imageEditorOverride:mb,headerIcons:M.headerIcons,validateCell:mt,onHeaderMenuClick:(Ce,wt)=>{oe||j({columnIdx:Ce,headerBounds:wt})},onPaste:!1,...Te&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:M.glideTheme.bgHeader,bgCellMedium:M.glideTheme.bgHeader,textMedium:M.glideTheme.textLight}},rowSelectionMode:Re?"multi":"auto",rowSelect:n?"none":Re?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...He&&{columnSelect:n?"none":ht?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:ht?"multi":"auto",rangeSelectionBlending:"additive"},...tt&&{rangeSelect:je?"rect":"cell",rangeSelectionBlending:"additive"},...!L&&e.editingMode!==de&&!n&&{fillHandle:!ae,onCellEdited:Ct,onPaste:un,onDelete:Ie},...!L&&e.editingMode===he&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:M.glideTheme.bgHeader,bgCellMedium:M.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:gn,onHeaderClicked:void 0}})}),dn?.content&&Ne(bC,{top:dn.top,left:dn.left,content:dn.content,clearTooltip:Bt}),W&&Mc.createPortal(Ne(hC,{top:W.headerBounds.y+W.headerBounds.height,left:W.headerBounds.x+W.headerBounds.width,column:Oe[W.columnIdx],onCloseMenu:()=>j(void 0),onSortColumn:se?Ce=>{T&&x(!1),ct(!(Te&&gt),!0),ye(W.columnIdx,Ce,!0)}:void 0,isColumnPinned:Oe[W.columnIdx].isPinned,onUnpinColumn:()=>{pn(Oe[W.columnIdx].id)},onPinColumn:()=>{In(Oe[W.columnIdx].id)},onHideColumn:()=>{Sn(Oe[W.columnIdx].id)},onChangeFormat:Ce=>{En(Oe[W.columnIdx].id,Ce),setTimeout(()=>{v.current?.remeasureColumns(et.fromSingleSelection(W.columnIdx))},100)},onAutosize:()=>{v.current?.remeasureColumns(et.fromSingleSelection(W.columnIdx))}}),document.querySelector("#portal"))]})}const SC=ug(CC),Of=f.memo(SC),xC=({data:e,height:t,width:n,customToolbarActions:r})=>Ne(Of,{element:new nn({useContainerWidth:!0,editingMode:nn.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new As.WidthConfig({useStretch:!0}),heightConfig:t?new As.HeightConfig({pixelHeight:t}):void 0}),NC=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:xC,default:Of},Symbol.toStringTag,{value:"Module"}));export{O0 as C,xC as R,ud as T,Mi as a,jg as b,NC as c,Si as i,um as m,sn as s};