streamlit-nightly 1.22.1.dev20230506__py2.py3-none-any.whl → 1.22.1.dev20230508__py2.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.
- streamlit/elements/arrow.py +14 -1
- streamlit/elements/data_editor.py +16 -0
- streamlit/elements/dataframe_selector.py +11 -1
- streamlit/file_util.py +0 -6
- streamlit/proto/Arrow_pb2.py +6 -6
- streamlit/static/asset-manifest.json +3 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/339.adb9bc91.chunk.js +1 -0
- streamlit/static/static/js/{main.c3e7270f.js → main.4c931ca2.js} +2 -2
- streamlit/web/server/app_static_file_handler.py +6 -2
- streamlit/web/server/routes.py +0 -7
- streamlit/web/server/server.py +0 -6
- {streamlit_nightly-1.22.1.dev20230506.dist-info → streamlit_nightly-1.22.1.dev20230508.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.22.1.dev20230506.dist-info → streamlit_nightly-1.22.1.dev20230508.dist-info}/RECORD +19 -20
- streamlit/static/assets/streamlit.css +0 -1243
- streamlit/static/static/js/339.c7961eea.chunk.js +0 -1
- /streamlit/static/static/js/{main.c3e7270f.js.LICENSE.txt → main.4c931ca2.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.22.1.dev20230506.data → streamlit_nightly-1.22.1.dev20230508.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.22.1.dev20230506.dist-info → streamlit_nightly-1.22.1.dev20230508.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.22.1.dev20230506.dist-info → streamlit_nightly-1.22.1.dev20230508.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.22.1.dev20230506.dist-info → streamlit_nightly-1.22.1.dev20230508.dist-info}/top_level.txt +0 -0
streamlit/elements/arrow.py
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
from __future__ import annotations
|
15
15
|
|
16
16
|
from collections.abc import Iterable
|
17
|
-
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union, cast
|
17
|
+
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union, cast
|
18
18
|
|
19
19
|
import pyarrow as pa
|
20
20
|
from numpy import ndarray
|
@@ -51,6 +51,7 @@ class ArrowMixin:
|
|
51
51
|
*,
|
52
52
|
use_container_width: bool = False,
|
53
53
|
hide_index: bool | None = None,
|
54
|
+
column_order: Iterable[str] | None = None,
|
54
55
|
) -> "DeltaGenerator":
|
55
56
|
"""Display a dataframe as an interactive table.
|
56
57
|
|
@@ -81,6 +82,14 @@ class ArrowMixin:
|
|
81
82
|
the index column(s) is automatically determined based on the index
|
82
83
|
type and input data format.
|
83
84
|
|
85
|
+
column_order : iterable of str or None
|
86
|
+
Specifies the display order of all non-index columns, affecting both
|
87
|
+
the order and visibility of columns to the user. For example,
|
88
|
+
specifying `column_order=("col2", "col1")` will display 'col2' first,
|
89
|
+
followed by 'col1', and all other non-index columns in the data will
|
90
|
+
be hidden. If None (default), the order is inherited from the
|
91
|
+
original data structure.
|
92
|
+
|
84
93
|
Examples
|
85
94
|
--------
|
86
95
|
>>> import streamlit as st
|
@@ -119,6 +128,10 @@ class ArrowMixin:
|
|
119
128
|
proto.width = width
|
120
129
|
if height:
|
121
130
|
proto.height = height
|
131
|
+
|
132
|
+
if column_order:
|
133
|
+
proto.column_order[:] = column_order
|
134
|
+
|
122
135
|
proto.editing_mode = ArrowProto.EditingMode.READ_ONLY
|
123
136
|
|
124
137
|
marshall(proto, data, default_uuid)
|
@@ -414,6 +414,7 @@ class DataEditorMixin:
|
|
414
414
|
height: Optional[int] = None,
|
415
415
|
use_container_width: bool = False,
|
416
416
|
hide_index: bool | None = None,
|
417
|
+
column_order: Iterable[str] | None = None,
|
417
418
|
num_rows: Literal["fixed", "dynamic"] = "fixed",
|
418
419
|
disabled: bool | Iterable[str] = False,
|
419
420
|
key: Optional[Key] = None,
|
@@ -432,6 +433,7 @@ class DataEditorMixin:
|
|
432
433
|
height: Optional[int] = None,
|
433
434
|
use_container_width: bool = False,
|
434
435
|
hide_index: bool | None = None,
|
436
|
+
column_order: Iterable[str] | None = None,
|
435
437
|
num_rows: Literal["fixed", "dynamic"] = "fixed",
|
436
438
|
disabled: bool | Iterable[str] = False,
|
437
439
|
key: Optional[Key] = None,
|
@@ -450,6 +452,7 @@ class DataEditorMixin:
|
|
450
452
|
height: Optional[int] = None,
|
451
453
|
use_container_width: bool = False,
|
452
454
|
hide_index: bool | None = None,
|
455
|
+
column_order: Iterable[str] | None = None,
|
453
456
|
num_rows: Literal["fixed", "dynamic"] = "fixed",
|
454
457
|
disabled: bool | Iterable[str] = False,
|
455
458
|
key: Optional[Key] = None,
|
@@ -485,6 +488,14 @@ class DataEditorMixin:
|
|
485
488
|
the index column(s) is automatically determined based on the index
|
486
489
|
type and input data format.
|
487
490
|
|
491
|
+
column_order : iterable of str or None
|
492
|
+
Specifies the display order of all non-index columns, affecting both
|
493
|
+
the order and visibility of columns to the user. For example,
|
494
|
+
specifying `column_order=("col2", "col1")` will display 'col2' first,
|
495
|
+
followed by 'col1', and all other non-index columns in the data will
|
496
|
+
be hidden. If None (default), the order is inherited from the
|
497
|
+
original data structure.
|
498
|
+
|
488
499
|
num_rows : "fixed" or "dynamic"
|
489
500
|
Specifies if the user can add and delete rows in the data editor.
|
490
501
|
If "fixed", the user cannot add or delete rows. If "dynamic", the user can
|
@@ -635,14 +646,19 @@ class DataEditorMixin:
|
|
635
646
|
if height:
|
636
647
|
proto.height = height
|
637
648
|
|
649
|
+
if column_order:
|
650
|
+
proto.column_order[:] = column_order
|
651
|
+
|
638
652
|
# Only set disabled to true if it is actually true
|
639
653
|
# It can also be a list of columns, which should result in false here.
|
640
654
|
proto.disabled = disabled is True
|
655
|
+
|
641
656
|
proto.editing_mode = (
|
642
657
|
ArrowProto.EditingMode.DYNAMIC
|
643
658
|
if num_rows == "dynamic"
|
644
659
|
else ArrowProto.EditingMode.FIXED
|
645
660
|
)
|
661
|
+
|
646
662
|
proto.form_id = current_form_id(self.dg)
|
647
663
|
|
648
664
|
if type_util.is_pandas_styler(data):
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"""
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
|
-
from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Union, cast
|
20
|
+
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Sequence, Union, cast
|
21
21
|
|
22
22
|
from typing_extensions import Literal
|
23
23
|
|
@@ -48,6 +48,7 @@ class DataFrameSelectorMixin:
|
|
48
48
|
*,
|
49
49
|
use_container_width: bool = False,
|
50
50
|
hide_index: bool | None = None,
|
51
|
+
column_order: Iterable[str] | None = None,
|
51
52
|
) -> "DeltaGenerator":
|
52
53
|
"""Display a dataframe as an interactive table.
|
53
54
|
|
@@ -85,6 +86,14 @@ class DataFrameSelectorMixin:
|
|
85
86
|
the index column(s) is automatically determined based on the index
|
86
87
|
type and input data format.
|
87
88
|
|
89
|
+
column_order : iterable of str or None
|
90
|
+
Specifies the display order of all non-index columns, affecting both
|
91
|
+
the order and visibility of columns to the user. For example,
|
92
|
+
specifying `column_order=("col2", "col1")` will display 'col2' first,
|
93
|
+
followed by 'col1', and all other non-index columns in the data will
|
94
|
+
be hidden. If None (default), the order is inherited from the
|
95
|
+
original data structure.
|
96
|
+
|
88
97
|
Examples
|
89
98
|
--------
|
90
99
|
>>> import streamlit as st
|
@@ -128,6 +137,7 @@ class DataFrameSelectorMixin:
|
|
128
137
|
height,
|
129
138
|
use_container_width=use_container_width,
|
130
139
|
hide_index=hide_index,
|
140
|
+
column_order=column_order,
|
131
141
|
)
|
132
142
|
else:
|
133
143
|
return self.dg._legacy_dataframe(data, width, height)
|
streamlit/file_util.py
CHANGED
@@ -129,12 +129,6 @@ def get_app_static_dir(main_script_path: str) -> str:
|
|
129
129
|
return os.path.abspath(static_dir)
|
130
130
|
|
131
131
|
|
132
|
-
def get_assets_dir():
|
133
|
-
"""Get the folder where static assets live."""
|
134
|
-
dirname = os.path.dirname(os.path.normpath(__file__))
|
135
|
-
return os.path.normpath(os.path.join(dirname, "static/assets"))
|
136
|
-
|
137
|
-
|
138
132
|
def get_streamlit_file_path(*filepath) -> str:
|
139
133
|
"""Return the full path to a file in ~/.streamlit.
|
140
134
|
|
streamlit/proto/Arrow_pb2.py
CHANGED
@@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
|
|
13
13
|
|
14
14
|
|
15
15
|
|
16
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Arrow.proto\"\
|
16
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Arrow.proto\"\xa0\x02\n\x05\x41rrow\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x17\n\x06styler\x18\x02 \x01(\x0b\x32\x07.Styler\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x1b\n\x13use_container_width\x18\x05 \x01(\x08\x12\n\n\x02id\x18\x06 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x07 \x01(\t\x12(\n\x0c\x65\x64iting_mode\x18\x08 \x01(\x0e\x32\x12.Arrow.EditingMode\x12\x10\n\x08\x64isabled\x18\t \x01(\x08\x12\x0f\n\x07\x66orm_id\x18\n \x01(\t\x12\x14\n\x0c\x63olumn_order\x18\x0b \x03(\t\"4\n\x0b\x45\x64itingMode\x12\r\n\tREAD_ONLY\x10\x00\x12\t\n\x05\x46IXED\x10\x01\x12\x0b\n\x07\x44YNAMIC\x10\x02\"O\n\x06Styler\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x61ption\x18\x02 \x01(\t\x12\x0e\n\x06styles\x18\x03 \x01(\t\x12\x16\n\x0e\x64isplay_values\x18\x04 \x01(\x0c\x62\x06proto3')
|
17
17
|
|
18
18
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
19
19
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Arrow_pb2', globals())
|
@@ -21,9 +21,9 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
21
21
|
|
22
22
|
DESCRIPTOR._options = None
|
23
23
|
_ARROW._serialized_start=32
|
24
|
-
_ARROW._serialized_end=
|
25
|
-
_ARROW_EDITINGMODE._serialized_start=
|
26
|
-
_ARROW_EDITINGMODE._serialized_end=
|
27
|
-
_STYLER._serialized_start=
|
28
|
-
_STYLER._serialized_end=
|
24
|
+
_ARROW._serialized_end=320
|
25
|
+
_ARROW_EDITINGMODE._serialized_start=268
|
26
|
+
_ARROW_EDITINGMODE._serialized_end=320
|
27
|
+
_STYLER._serialized_start=322
|
28
|
+
_STYLER._serialized_end=401
|
29
29
|
# @@protoc_insertion_point(module_scope)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.f4a8738f.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.4c931ca2.js",
|
5
5
|
"static/js/464.53a4cca5.chunk.js": "./static/js/464.53a4cca5.chunk.js",
|
6
6
|
"static/js/480.ace5e591.chunk.js": "./static/js/480.ace5e591.chunk.js",
|
7
7
|
"static/js/441.18a5aa7a.chunk.js": "./static/js/441.18a5aa7a.chunk.js",
|
8
8
|
"static/js/329.8b7f8f94.chunk.js": "./static/js/329.8b7f8f94.chunk.js",
|
9
9
|
"static/css/339.23fa976d.chunk.css": "./static/css/339.23fa976d.chunk.css",
|
10
|
-
"static/js/339.
|
10
|
+
"static/js/339.adb9bc91.chunk.js": "./static/js/339.adb9bc91.chunk.js",
|
11
11
|
"static/js/218.0fc6d526.chunk.js": "./static/js/218.0fc6d526.chunk.js",
|
12
12
|
"static/js/695.1b40a7eb.chunk.js": "./static/js/695.1b40a7eb.chunk.js",
|
13
13
|
"static/js/320.9055c063.chunk.js": "./static/js/320.9055c063.chunk.js",
|
@@ -143,6 +143,6 @@
|
|
143
143
|
},
|
144
144
|
"entrypoints": [
|
145
145
|
"static/css/main.f4a8738f.css",
|
146
|
-
"static/js/main.
|
146
|
+
"static/js/main.4c931ca2.js"
|
147
147
|
]
|
148
148
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.4c931ca2.js"></script><link href="./static/css/main.f4a8738f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[339],{72475:function(e,t,n){n.r(t),n.d(t,{default:function(){return nt}});var i=n(93433),a=n(29439),r=n(1413),o=n(47313),l=n(56130),u=n(91719),d=n(30161),s=n(55982),c=n(44970),m=n(64577),f=n(17453),v=n(15671),g=n(43144),h=function(){function e(t){(0,v.Z)(this,e),this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}return(0,g.Z)(e,[{key:"toJson",value:function(e){var t=new Map;e.forEach((function(e){t.set(e.indexNumber,e)}));var n={edited_cells:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((function(e,i,a){e.forEach((function(e,a,r){var o=t.get(a);o&&(n.edited_cells["".concat(i,":").concat(a)]=o.getCellValue(e))}))})),this.addedRows.forEach((function(e){var i={};e.forEach((function(e,n,a){var r=t.get(n);if(r){var o=r.getCellValue(e);(0,f.bb)(o)&&(i[n]=o)}})),n.added_rows.push(i)})),n.deleted_rows=this.deletedRows,JSON.stringify(n,(function(e,t){return void 0===t?null:t}))}},{key:"fromJson",value:function(e,t){var n=this,i=JSON.parse(e),r=new Map;t.forEach((function(e){r.set(e.indexNumber,e)})),Object.keys(i.edited_cells).forEach((function(e){var t=e.split(":").map(Number),o=(0,a.Z)(t,2),l=o[0],u=o[1],d=r.get(u);if(d){var s,c=d.getCell(i.edited_cells[e]);if(c)0==n.editedCells.has(l)&&n.editedCells.set(l,new Map),null===(s=n.editedCells.get(l))||void 0===s||s.set(u,c)}})),i.added_rows.forEach((function(e){var i=new Map;t.forEach((function(e){i.set(e.indexNumber,e.getCell(void 0))})),Object.keys(e).forEach((function(t){var n=r.get(Number(t));if(n){var a=n.getCell(e[Number(t)]);a&&i.set(Number(t),a)}})),n.addedRows.push(i)})),this.deletedRows=i.deleted_rows}},{key:"isAddedRow",value:function(e){return e>=this.numRows}},{key:"getCell",value:function(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);var n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}},{key:"setCell",value:function(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map),this.editedCells.get(t).set(e,n)}}},{key:"addRow",value:function(e){this.addedRows.push(e)}},{key:"deleteRows",value:function(e){var t=this;e.sort((function(e,t){return t-e})).forEach((function(e){t.deleteRow(e)}))}},{key:"deleteRow",value:function(e){(0,f.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort((function(e,t){return e-t}))),this.editedCells.delete(e)))}},{key:"getOriginalRowIndex",value:function(e){for(var t=e,n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}},{key:"getNumRows",value:function(){return this.numRows+this.addedRows.length-this.deletedRows.length}}]),e}(),p=n(2120),b=n(83985);var y=function(){var e=(0,b.u)(),t=o.useMemo((function(){return{editable:function(e){return'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.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{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,p.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,p.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.bgMix,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,p.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25,tableBorderRadius:e.radii.md,headerIcons:t}},w=n(66463),x=n(70816),C=n.n(x),Z=n(32998),N=n(16031),E=n(35394),M=n.n(E),T=n(17076),k=n(11368),R=n(58327),_=n(45973),S=(n(49161),n(82374),["true","t","yes","y","on","1"]),O=["false","f","no","n","off","0"];function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:l.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function D(e){return e.hasOwnProperty("isError")&&e.isError}function A(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function H(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?{kind:l.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:l.p6.Loading,allowOverlay:!1}}function z(e){return(0,r.Z)((0,r.Z)({id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon},e.isStretched&&{grow:e.isIndex?1:3}),e.width&&{width:e.width})}function V(e,t){return(0,f.le)(e)?t||{}:(0,f.le)(t)?e||{}:(0,N.merge)(e,t)}function F(e){if((0,f.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(n){return[e]}}try{var t=JSON.parse(JSON.stringify(e,(function(e,t){return"bigint"===typeof t?Number(t):t})));return(0,N.isArray)(t)?t.map((function(e){return["string","number","boolean","null"].includes(typeof e)?e:L(e)})):[L(t)]}catch(n){return[L(e)]}}function L(e){try{try{return(0,N.toString)(e)}catch(t){return JSON.stringify(e,(function(e,t){return"bigint"===typeof t?Number(t):t}))}}catch(t){return"[".concat(typeof e,"]")}}function W(e){if((0,f.le)(e))return null;if("boolean"===typeof e)return e;var t=L(e).toLowerCase().trim();return""===t?null:!!S.includes(t)||!O.includes(t)&&void 0}function j(e){if((0,f.le)(e))return null;if((0,N.isArray)(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{var t=M().unformat(e.trim());if((0,f.bb)(t))return t}catch(n){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function B(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,f.le)(t)||""===t?(0===n&&(e=Math.round(e)),M()(e).format((0,f.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):(0,T.sprintf)(t,e)}function P(e,t){if("localized"===t)return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate());if("distance"===t)return(0,k.Z)(e.toDate(),new Date);if("relative"===t)return(0,R.Z)(e.toDate(),new Date);var n=e.tz();return(0,f.bb)(n)?(0,_.Z)(e.toDate(),n,t):0!==e.utcOffset()?(0,_.Z)(e.toDate(),e.format("Z"),t):(0,_.Z)(e.toDate(),"UTC",t)}function q(e){if((0,f.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{var t=Number(e);if(!isNaN(t)){var n=t;t>=Math.pow(10,18)?n=t/Math.pow(1e3,3):t>=Math.pow(10,15)?n=t/Math.pow(1e3,2):t>=Math.pow(10,12)&&(n=t/1e3);var i=C().unix(n).utc();if(i.isValid())return i.toDate()}if("string"===typeof e){var a=C().utc(e);if(a.isValid())return a.toDate();var r=C().utc(e,[C().HTML5_FMT.TIME_MS,C().HTML5_FMT.TIME_SECONDS,C().HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch(o){return}}function J(e){if(e%1===0)return 0;var t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}function Y(e){var t={kind:l.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"object",sortMode:"default",isEditable:!1,getCell:function(e){try{var n=(0,f.bb)(e)?L(e):null,i=(0,f.bb)(n)?n:"";return(0,r.Z)((0,r.Z)({},t),{},{data:n,displayData:i,isMissingValue:(0,f.le)(e)})}catch(a){return I(L(e),"The value cannot be interpreted as a string. Error: ".concat(a))}},getCellValue:function(e){return void 0===e.data?null:e.data}})}Y.isEditableType=!1;var U=Y;function G(e){var t=e.columnTypeOptions||{},n=void 0;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(o)}var i={kind:l.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},a=function(i){if((0,f.le)(i))return!e.isRequired;var a=L(i),r=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),r=!0),!(n instanceof RegExp&&!1===n.test(a))&&(!r||a)};return(0,r.Z)((0,r.Z)({},e),{},{kind:"text",sortMode:"default",validateInput:a,getCell:function(e,t){if("string"===typeof n)return I(L(e),n);if(t){var l=a(e);if(!1===l)return I(L(e),"Invalid input.");"string"===typeof l&&(e=l)}try{var u=(0,f.bb)(e)?L(e):null,d=(0,f.bb)(u)?u:"";return(0,r.Z)((0,r.Z)({},i),{},{isMissingValue:(0,f.le)(u),data:u,displayData:d})}catch(o){return I("Incompatible value","The value cannot be interpreted as string. Error: ".concat(o))}},getCellValue:function(e){return void 0===e.data?null:e.data}})}G.isEditableType=!0;var K=G;function X(e){var t={kind:l.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"checkbox",sortMode:"default",getCell:function(e){var n;return void 0===(n=W(e))?I(L(e),"The value cannot be interpreted as boolean."):(0,r.Z)((0,r.Z)({},t),{},{data:n})},getCellValue:function(e){return void 0===e.data?null:e.data}})}X.isEditableType=!0;var Q=X;function $(e){var t="string",n=V({options:"bool"===Z.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),a=new Set(n.options.map((function(e){return typeof e})));1===a.size&&(a.has("number")||a.has("bigint")?t="number":a.has("boolean")&&(t="boolean"));var o={kind:l.p6.Custom,allowOverlay:e.isEditable,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[].concat((0,i.Z)(!0!==e.isRequired?[""]:[]),(0,i.Z)(n.options.filter((function(e){return""!==e})).map((function(e){return L(e)})))),value:"",readonly:!e.isEditable}};return(0,r.Z)((0,r.Z)({},e),{},{kind:"selectbox",sortMode:"default",getCell:function(e,t){var n="";return(0,f.bb)(e)&&(n=L(e)),t&&!o.data.allowedValues.includes(n)?I(L(n),"The value is not part of the allowed options."):(0,r.Z)((0,r.Z)({},o),{},{isMissingValue:""===n,copyData:n,data:(0,r.Z)((0,r.Z)({},o.data),{},{value:n})})},getCellValue:function(e){var n,i,a,r,o,l,u;return void 0===(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(r=j(null===(o=e.data)||void 0===o?void 0:o.value))&&void 0!==r?r:null:"boolean"===t?null!==(l=W(null===(u=e.data)||void 0===u?void 0:u.value))&&void 0!==l?l:null:null===(a=e.data)||void 0===a?void 0:a.value}})}$.isEditableType=!0;var ee=$;function te(e){var t={kind:l.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"list",sortMode:"default",isEditable:!1,getCell:function(e){var n=(0,f.le)(e)?[]:F(e);return(0,r.Z)((0,r.Z)({},t),{},{data:n,isMissingValue:(0,f.le)(e),copyData:(0,f.le)(e)?"":L(n.map((function(e){return(0,N.isString)(e)&&e.includes(",")?e.replace(/,/g," "):e})))})},getCellValue:function(e){return(0,f.le)(e.data)||A(e)?null:e.data}})}te.isEditableType=!1;var ne=te;function ie(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function ae(e){var t=Z.fu.getTypeName(e.arrowType),n=V({step:ie(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0},e.columnTypeOptions),i=(0,f.le)(n.min_value)||n.min_value<0,a=(0,f.bb)(n.step)&&!Number.isNaN(n.step)?J(n.step):void 0,o={kind:l.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:a},u=function(t){var i=j(t);if((0,f.le)(i))return!e.isRequired;if(Number.isNaN(i))return!1;var a=!1;return(0,f.bb)(n.max_value)&&i>n.max_value&&(i=n.max_value,a=!0),!((0,f.bb)(n.min_value)&&i<n.min_value)&&(!a||i)};return(0,r.Z)((0,r.Z)({},e),{},{kind:"number",sortMode:"smart",validateInput:u,getCell:function(e,t){if(!0===t){var i=u(e);if(!1===i)return I(L(e),"Invalid input.");"number"===typeof i&&(e=i)}var l,d,s=j(e),c="";if((0,f.bb)(s)){if(Number.isNaN(s))return I(L(e),"The value cannot be interpreted as a number.");if((0,f.bb)(a)&&(l=s,s=0===(d=a)?Math.trunc(l):Math.trunc(l*Math.pow(10,d))/Math.pow(10,d)),Number.isInteger(s)&&!Number.isSafeInteger(s))return I(L(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{c=B(s,n.format,a)}catch(m){return I(L(s),(0,f.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(m):"Failed to format the number. Error: ".concat(m))}}return(0,r.Z)((0,r.Z)({},o),{},{data:s,displayData:c,isMissingValue:(0,f.le)(s)})},getCellValue:function(e){return void 0===e.data?null:e.data}})}ae.isEditableType=!0;var re=ae;function oe(e){var t=e.columnTypeOptions||{},n=void 0;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(o)}var i={kind:l.p6.Uri,data:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"},a=function(i){if((0,f.le)(i))return!e.isRequired;var a=L(i),r=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),r=!0),!(n instanceof RegExp&&!1===n.test(a))&&(!r||a)};return(0,r.Z)((0,r.Z)({},e),{},{kind:"link",sortMode:"default",validateInput:a,getCell:function(e,t){if("string"===typeof n)return I(L(e),n);if(t){var o=a(e);if(!1===o)return I(L(e),"Invalid input.");"string"===typeof o&&(e=o)}return(0,r.Z)((0,r.Z)({},i),{},{data:(0,f.bb)(e)?L(e):null,isMissingValue:(0,f.le)(e)})},getCellValue:function(e){return void 0===e.data?null:e.data}})}oe.isEditableType=!0;var le=oe;function ue(e){var t={kind:l.p6.Image,data:[],displayData:[],allowAdd:!1,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"image",sortMode:"default",isEditable:!1,getCell:function(e){var n=(0,f.bb)(e)?[L(e)]:[];return(0,r.Z)((0,r.Z)({},t),{},{data:n,isMissingValue:!(0,f.bb)(e),displayData:n})},getCellValue:function(e){return void 0===e.data||0===e.data.length?null:e.data[0]}})}ue.isEditableType=!1;var de=ue;function se(e){var t,n=ie(Z.fu.getTypeName(e.arrowType)),i=V({min_value:0,max_value:n?100:1,step:n?1:.01,format:n?"%3d%%":"percent"},e.columnTypeOptions);try{t=B(i.max_value,i.format)}catch(u){t=L(i.max_value)}var a=(0,f.le)(i.step)||Number.isNaN(i.step)?void 0:J(i.step),o={kind:l.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:i.min_value,max:i.max_value,step:i.step,value:i.min_value,label:String(i.min_value),measureLabel:t,readonly:!0}};return(0,r.Z)((0,r.Z)({},e),{},{kind:"progress",sortMode:"smart",isEditable:!1,getCell:function(e){if((0,f.le)(e))return H();if((0,f.le)(i.min_value)||(0,f.le)(i.max_value)||Number.isNaN(i.min_value)||Number.isNaN(i.max_value)||i.min_value>=i.max_value)return I("Invalid min/max parameters","The min_value (".concat(i.min_value,") and max_value (").concat(i.max_value,") parameters must be valid numbers."));if((0,f.le)(i.step)||Number.isNaN(i.step))return I("Invalid step parameter","The step parameter (".concat(i.step,") must be a valid number."));var t=j(e);if(Number.isNaN(t)||(0,f.le)(t))return I(L(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return I(L(e),"The value is larger than the maximum supported integer values in number columns (2^53).");var n="";try{n=B(t,i.format,a)}catch(u){return I(L(t),(0,f.bb)(i.format)?"Failed to format the number based on the provided format configuration: (".concat(i.format,"). Error: ").concat(u):"Failed to format the number. Error: ".concat(u))}var l=Math.min(i.max_value,Math.max(i.min_value,t));return(0,r.Z)((0,r.Z)({},o),{},{isMissingValue:(0,f.le)(e),copyData:String(t),data:(0,r.Z)((0,r.Z)({},o.data),{},{value:l,label:n})})},getCellValue:function(e){var t,n;return e.kind===l.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}})}se.isEditableType=!1;var ce=se;function me(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function fe(e,t,n,i,a,o,u){var d,s=V({format:n,step:i,timezone:u},t.columnTypeOptions),c=void 0;if((0,f.bb)(s.timezone))try{var m;c=(null===(m=me(C()(),s.timezone))||void 0===m?void 0:m.utcOffset())||void 0}catch(b){}var v=void 0;(0,f.bb)(s.min_value)&&(v=q(s.min_value)||void 0);var g=void 0;(0,f.bb)(s.max_value)&&(g=q(s.max_value)||void 0);var h={kind:l.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-time-cell",date:void 0,displayDate:"",step:(null===(d=s.step)||void 0===d?void 0:d.toString())||"1",format:a,min:v,max:g}},p=function(e){var n=q(e);return null===n?!t.isRequired:void 0!==n&&(!((0,f.bb)(v)&&o(n)<o(v))&&!((0,f.bb)(g)&&o(n)>o(g)))};return(0,r.Z)((0,r.Z)({},t),{},{kind:e,sortMode:"default",validateInput:p,getCell:function(e,i){if(!0===i){var a=p(e);if(!1===a)return I(L(e),"Invalid input.");a instanceof Date&&(e=a)}var o=q(e),u="",d="",m=c;if(void 0===o)return I(L(e),"The value cannot be interpreted as a datetime object.");if(null!==o){var v=C().utc(o);if(!v.isValid())return I(L(o),"This should never happen. Please report this bug. \nError: ".concat(v.toString()));if(s.timezone){try{v=me(v,s.timezone)}catch(b){return I(v.toISOString(),"Failed to adjust to the provided timezone: ".concat(s.timezone,". \nError: ").concat(b))}m=v.utcOffset()}try{d=P(v,s.format||n)}catch(b){return I(v.toISOString(),"Failed to format the date for rendering with: ".concat(s.format,". \nError: ").concat(b))}u=P(v,n)}return t.isEditable?(0,r.Z)((0,r.Z)({},h),{},{copyData:u,isMissingValue:(0,f.le)(o),data:(0,r.Z)((0,r.Z)({},h.data),{},{date:o,displayDate:d,timezoneOffset:m})}):{kind:l.p6.Text,isMissingValue:(0,f.le)(o),data:""!==u?u:null,displayData:d,allowOverlay:!0,contentAlignment:t.contentAlignment,readonly:!0,style:t.isIndex?"faded":"normal"}},getCellValue:function(e){var t;return e.kind===l.p6.Text?void 0===e.data?null:e.data:(0,f.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:o(e.data.date)}})}function ve(e){var t,n,i,a=null===(t=e.arrowType)||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.timezone,r=(0,f.bb)(a)||(0,f.bb)(null===e||void 0===e||null===(i=e.columnTypeOptions)||void 0===i?void 0:i.timezone);return fe("datetime",e,r?"yyyy-MM-dd HH:mm:ssxxx":"yyyy-MM-dd HH:mm:ss",1,"datetime-local",(function(e){return r?e.toISOString():e.toISOString().replace("Z","")}),a)}function ge(e){var t,n,i="HH:mm:ss.SSS";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)>=1&&(i="HH:mm:ss"),fe("time",e,i,.1,"time",(function(e){return e.toISOString().split("T")[1].replace("Z","")}))}function he(e){return fe("date",e,"yyyy-MM-dd",1,"date",(function(e){return e.toISOString().split("T")[0]}))}function pe(e,t,n){var i=V({y_min:0,y_max:1},t.columnTypeOptions),a={kind:l.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return(0,r.Z)((0,r.Z)({},t),{},{kind:e,sortMode:"default",isEditable:!1,getCell:function(e){if((0,f.le)(i.y_min)||(0,f.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return I("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,f.le)(e))return H();var t=F(e),o=[],l=[];if(0===t.length)return H();for(var u=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,s=0;s<t.length;s++){var c=j(t[s]);if(Number.isNaN(c)||(0,f.le)(c))return I(L(t),"The value cannot be interpreted as a numeric array. ".concat(L(c)," is not a number."));c>u&&(u=c),c<d&&(d=c),o.push(c)}return"line"===n&&o.length<=2?H():(l=o.length>0&&(u>i.y_max||d<i.y_min)?o.map((function(e){return u-d===0?u>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-d)/(u-d))+(i.y_min||0)})):o,(0,r.Z)((0,r.Z)({},a),{},{copyData:o.join(","),data:(0,r.Z)((0,r.Z)({},a.data),{},{values:l,displayValues:o.map((function(e){return B(e)}))}),isMissingValue:(0,f.le)(e)}))},getCellValue:function(e){var t,n;return e.kind===l.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}})}function be(e){return pe("line_chart",e,"line")}function ye(e){return pe("bar_chart",e,"bar")}ve.isEditableType=!0,ge.isEditableType=!0,he.isEditableType=!0,be.isEditableType=!1,ye.isEditableType=!1;var we=n(47167),xe=n(46417);var Ce=(0,we.Z)("input",{target:"ep8mq70"})({name:"mno8rz",styles:"min-height:26px;border:none;outline:none;background-color:transparent;font-size:var(--gdg-editor-font-size);font-family:var(--gdg-font-family);color:var(--gdg-text-dark);::-webkit-calendar-picker-indicator{background-color:white;}"}),Ze=function(e,t){if(void 0===t||null===t)return"";var n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error("Unknown date kind ".concat(e))}},Ne=function(e){var t=e.value.data,n=t.format,i=t.displayDate,a=void 0===t.step||Number.isNaN(Number(t.step))?void 0:Number(t.step),o=t.min instanceof Date?Ze(n,t.min):t.min,u=t.max instanceof Date?Ze(n,t.max):t.max,d=t.date,s=t.timezoneOffset?60*t.timezoneOffset*1e3:0;s&&d&&(d=new Date(d.getTime()+s));var c=Ze(n,d);return e.value.readonly?(0,xe.jsx)(l.t5,{highlight:!0,autoFocus:!1,disabled:!0,value:null!==i&&void 0!==i?i:"",onChange:function(){}}):(0,xe.jsx)(Ce,{"data-testid":"date-time-cell",required:!0,type:n,defaultValue:c,min:o,max:u,step:a,autoFocus:!0,onChange:function(t){isNaN(t.target.valueAsNumber)?e.onChange((0,r.Z)((0,r.Z)({},e.value),{},{data:(0,r.Z)((0,r.Z)({},e.value.data),{},{date:void 0})})):e.onChange((0,r.Z)((0,r.Z)({},e.value),{},{data:(0,r.Z)((0,r.Z)({},e.value.data),{},{date:new Date(t.target.valueAsNumber-s)})}))}})},Ee={kind:l.p6.Custom,isMatch:function(e){return"date-time-cell"===e.data.kind},draw:function(e,t){var n=t.data.displayDate;return(0,l.uN)(e,n,t.contentAlign),!0},measure:function(e,t){var n=t.data.displayDate;return e.measureText(n).width+16},provideEditor:function(){return{editor:Ne}},onPaste:function(e,t){var n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),"time"===t.format&&Number.isNaN(n)&&(n=Date.parse("1970-01-01T".concat(e,"Z"))))),(0,r.Z)((0,r.Z)({},t),{},{date:Number.isNaN(n)?void 0:new Date(n)})}},Me=(0,we.Z)("img",{target:"ezrmkt60"})((function(){return{maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"}}),""),Te=function(e){var t=e.urls,n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,xe.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,xe.jsx)(Me,{src:n})}):(0,xe.jsx)(Me,{src:n})},ke=new Map(Object.entries({object:U,text:K,checkbox:Q,selectbox:ee,list:ne,number:re,link:le,datetime:ve,date:he,time:ge,line_chart:be,bar_chart:ye,image:de,progress:ce})),Re=[Ee];function _e(e,t,n){var i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");var a=i.exec(n);if(a)return a[1].trim()}function Se(e){return e.replace(/(\r\n|\n|\r)/gm," ")}function Oe(e,t,n){var i={},a=_e(t,"color",n);a&&(i.textDark=a);var o=_e(t,"background-color",n);return o&&(i.bgCell=o),"yellow"===o&&void 0===a&&(i.textDark="#31333F"),i?(0,r.Z)((0,r.Z)({},e),{},{themeOverride:i}):e}function Ie(e,t){var n=e.types.index[t],i=e.indexNames[t],a=!0;return"range"===Z.fu.getTypeName(n)&&(a=!1),{id:"index-".concat(t),name:i,title:i,isEditable:a,arrowType:n,isIndex:!0,isHidden:!1}}function De(e,t){var n,i=e.columns[0][t],a=e.types.data[t];if((0,f.le)(a)&&(a={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===Z.fu.getTypeName(a)){var r=e.getCategoricalOptions(t);(0,f.bb)(r)&&(n={options:r})}return{id:"column-".concat(i,"-").concat(t),name:i,title:i,isEditable:!0,arrowType:a,columnTypeOptions:n,isIndex:!1,isHidden:!1}}var Ae=function(e,t,n,i){var u=o.useCallback((function(o){var u=(0,a.Z)(o,2),d=u[0],s=u[1];if(d>t.length-1)return I("Column index out of bounds.","This should never happen. Please report this bug.");if(s>n-1)return I("Row index out of bounds.","This should never happen. Please report this bug.");var c=t[d],m=c.indexNumber,v=i.current.getOriginalRowIndex(s);if(c.isEditable||i.current.isAddedRow(v)){var g=i.current.getCell(m,v);if(void 0!==g)return g}try{return function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("object"===e.kind)n=e.getCell((0,f.bb)(t.content)?Se(Z.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,f.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var a,o,u;u="time"===Z.fu.getTypeName(e.arrowType)&&(0,f.bb)(null===(a=t.field)||void 0===a||null===(o=a.type)||void 0===o?void 0:o.unit)?C().unix(Z.fu.adjustTimestamp(t.content,t.field)).utc().toDate():C().utc(Number(t.content)).toDate(),n=e.getCell(u)}else n=e.getCell(t.content);if(D(n))return n;if(!e.isEditable){if((0,f.bb)(t.displayContent)){var d=Se(t.displayContent);(n.kind===l.p6.Text||n.kind===l.p6.Number)&&(n=(0,r.Z)((0,r.Z)({},n),{},{displayData:d}))}i&&t.cssId&&(n=Oe(n,t.cssId,i))}return n}(c,e.getCell(v+1,m),e.cssStyles)}catch(h){return(0,w.H)(h),I("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(h))}}),[t,n,e,i]);return{getCellContent:u}};var He=function(e,t,n,i,r){var l,u=function(e){return Math.max(35*e+1+2,73)}(t+1+(e.editingMode===m.Eh.EditingMode.DYNAMIC?1:0)),d=Math.min(u,400);e.height&&(d=Math.max(e.height,73),u=Math.max(e.height,u)),i&&(d=Math.min(d,i),u=Math.min(u,i),e.height||(d=u));var s=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),s=Math.min(Math.max(e.width,s),n));var c=o.useState({width:l||"100%",height:d}),v=(0,a.Z)(c,2),g=v[0],h=v[1];return o.useLayoutEffect((function(){e.useContainerWidth&&"100%"===g.width&&h({width:n,height:g.height})}),[n]),o.useLayoutEffect((function(){h({width:g.width,height:d})}),[t]),o.useLayoutEffect((function(){h({width:l||"100%",height:g.height})}),[l]),o.useLayoutEffect((function(){h({width:g.width,height:d})}),[d]),o.useLayoutEffect((function(){if(r){var t=e.useContainerWidth||(0,f.bb)(e.width)&&e.width>0;h({width:t?s:"100%",height:u})}else h({width:l||"100%",height:d})}),[r]),{rowHeight:35,minHeight:73,maxHeight:u,minWidth:52,maxWidth:s,resizableSize:g,setResizableSize:h}};var ze=function(e,t,n,i,l,u,d){var s=o.useCallback((function(t,o){var u=(0,a.Z)(t,2),s=u[0],c=u[1],m=e[s];if(m.isEditable){var f=m.indexNumber,v=n.current.getOriginalRowIndex(l(c)),g=i([s,c]),h=m.getCellValue(g),p=m.getCellValue(o);if(D(g)||p!==h){var b=m.getCell(p,!0);D(b)?(0,w.KE)("Not applying the cell edit since it causes this error:\n ".concat(b.data)):(n.current.setCell(f,v,(0,r.Z)((0,r.Z)({},b),{},{lastUpdated:performance.now()})),d())}}}),[e,n,l,i,d]),c=o.useCallback((function(){if(!t){var i=new Map;e.forEach((function(e){i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),d(!1,!1)}}),[e,n,t,d]),m=o.useCallback((function(i){var a;if(i.rows.length>0){if(t)return!0;var r=i.rows.toArray().map((function(e){return n.current.getOriginalRowIndex(l(e))}));return n.current.deleteRows(r),d(!0),!1}if(null!==(a=i.current)&&void 0!==a&&a.range){for(var o=[],c=i.current.range,m=c.y;m<c.y+c.height;m++)for(var f=c.x;f<c.x+c.width;f++){var v=e[f];v.isEditable&&!v.isRequired&&(o.push({cell:[f,m]}),s([f,m],v.getCell(null)))}return o.length>0&&(d(),u(o)),!1}return!0}),[e,n,t,u,l,d,s]),v=o.useCallback((function(o,s){for(var m=(0,a.Z)(o,2),v=m[0],g=m[1],h=[],p=0;p<s.length;p++){var b=s[p];if(p+g>=n.current.getNumRows()){if(t)break;c()}for(var y=0;y<b.length;y++){var w=b[y],x=p+g,C=y+v;if(C>=e.length)break;var Z=e[C];if(Z.isEditable){var N=Z.getCell(w,!0);if((0,f.bb)(N)&&!D(N)){var E=Z.indexNumber,M=n.current.getOriginalRowIndex(l(x)),T=Z.getCellValue(i([C,x]));Z.getCellValue(N)!==T&&(n.current.setCell(E,M,(0,r.Z)((0,r.Z)({},N),{},{lastUpdated:performance.now()})),h.push({cell:[C,x]}))}}}h.length>0&&(d(),u(h))}return!1}),[e,n,t,l,i,c,d,u]),g=o.useCallback((function(t,n){var i=t[0];if(i>=e.length)return!0;var a=e[i];if(a.validateInput){var r=a.validateInput(a.getCellValue(n));return!0===r||!1===r?r:a.getCell(r)}return!0}),[e]);return{onCellEdited:s,onPaste:v,onRowAppended:c,onDelete:m,validateCell:g}};var Ve=function(e){var t=(0,o.useState)((function(){return new Map})),n=(0,a.Z)(t,2),i=n[0],l=n[1],u=o.useCallback((function(e,t,n,a){e.id&&l(new Map(i).set(e.id,a))}),[i]);return{columns:e.map((function(e){return e.id&&i.has(e.id)&&void 0!==i.get(e.id)?(0,r.Z)((0,r.Z)({},e),{},{width:i.get(e.id),grow:0}):e})),onColumnResize:u}},Fe=n(34264);var Le=function(e,t,n){var i=o.useState(),l=(0,a.Z)(i,2),u=l[0],d=l[1],s=(0,Fe.fF)({columns:t.map((function(e){return z(e)})),getCellContent:n,rows:e,sort:u}),c=s.getCellContent,m=s.getOriginalIndex,f=function(e,t){return void 0===t?e:e.map((function(e){return e.id===t.column.id?(0,r.Z)((0,r.Z)({},e),{},{title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}):e}))}(t,u),v=o.useCallback((function(e){var t="asc",n=f[e];if(u&&u.column.id===n.id){if("asc"!==u.direction)return void d(void 0);t="desc"}d({column:z(n),direction:t,mode:n.sortMode})}),[u,f]);return{columns:f,sortColumn:v,getOriginalIndex:m,getCellContent:c}},We="index",je="col:",Be={small:75,medium:200,large:400};function Pe(e){var t;return(0,f.bb)(e.customType)&&(ke.has(e.customType)?t=ke.get(e.customType):(0,w.KE)("Unknown column type configured in column configuration: ".concat(e.customType))),(0,f.le)(t)&&(t=function(e){var t=e?Z.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?K:["datetime","datetimetz"].includes(t)?ve:"time"===t?ge:"date"===t?he:["object","decimal","bytes"].includes(t)?U:["bool"].includes(t)?Q:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range"].includes(t)?re:"categorical"===t?ee:t.startsWith("list")?ne:U):U}(e.arrowType)),t}var qe=function(e,t,n){var i=function(e){if(!e.columns)return new Map;try{return new Map(Object.entries(JSON.parse(e.columns)))}catch(t){return(0,w.H)(t),new Map}}(e),a=e.useContainerWidth||(0,f.bb)(e.width)&&e.width>0,o=function(e){var t,n,i,a,o,l,u=[],d=null!==(t=null===(n=e.types)||void 0===n||null===(i=n.index)||void 0===i?void 0:i.length)&&void 0!==t?t:0,s=null!==(a=null===(o=e.columns)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.length)&&void 0!==a?a:0;if(0===d&&0===s)return u.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),u;for(var c=0;c<d;c++){var m=(0,r.Z)((0,r.Z)({},Ie(e,c)),{},{indexNumber:c});u.push(m)}for(var f=0;f<s;f++){var v=(0,r.Z)((0,r.Z)({},De(e,f)),{},{indexNumber:f+d});u.push(v)}return u}(t).map((function(t){var o=(0,r.Z)((0,r.Z)((0,r.Z)({},t),function(e,t){var n,i;return t?(t.has(e.name)?i=t.get(e.name):t.has("".concat(je).concat(e.indexNumber))?i=t.get("".concat(je).concat(e.indexNumber)):e.isIndex&&t.has(We)&&(i=t.get(We)),i?(0,N.merge)((0,r.Z)({},e),{title:i.title,width:(0,f.bb)(i.width)&&i.width in Be?Be[i.width]:void 0,customType:null===(n=i.type)||void 0===n?void 0:n.toLowerCase().trim(),isEditable:(0,f.bb)(i.disabled)?!i.disabled:void 0,isHidden:i.hidden,isRequired:i.required,columnTypeOptions:i.type_options,contentAlignment:i.alignment,defaultValue:i.default,help:i.help}):e):e}(t,i)),{},{isStretched:a}),l=Pe(o);return(e.editingMode===m.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(o=(0,r.Z)((0,r.Z)({},o),{},{isEditable:!1})),e.editingMode!==m.Eh.EditingMode.READ_ONLY&&1==o.isEditable&&(o=(0,r.Z)((0,r.Z)({},o),{},{icon:"editable"})),l(o)})).filter((function(e){return!e.isHidden}));if(e.columnOrder&&e.columnOrder.length>0){var l=[];o.forEach((function(e){e.isIndex&&l.push(e)})),e.columnOrder.forEach((function(e){var t=o.find((function(t){return t.name===e}));t&&!t.isIndex&&l.push(t)})),o=l}return{columns:o.length>0?o:[U({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}};var Je=function(e,t){var n=o.useState(),i=(0,a.Z)(n,2),r=i[0],l=i[1],u=o.useRef(null),d=o.useCallback((function(n){if(clearTimeout(u.current),u.current=0,l(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){var i,a=n.location[0],r=n.location[1];if(a<0)return;if("header"===n.kind&&e.length>a&&(0,f.bb)(e[a]))i=e[a].help;else if("cell"===n.kind){var o=t([a,r]);(function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip})(o)&&(i=o.tooltip)}i&&(u.current=setTimeout((function(){i&&l({content:i,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,l,u]);return{tooltip:r,clearTooltip:o.useCallback((function(){l(void 0)}),[l]),onItemHovered:d}},Ye=n(4942),Ue=(0,we.Z)("div",{target:"ebxhiwi0"})((function(e){var t;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.theme.radii.md},"& .dvn-scroller":(t={scrollbarWidth:"thin"},(0,Ye.Z)(t,"overflowX","overlay !important"),(0,Ye.Z)(t,"overflowY","overlay !important"),t)}}),""),Ge=n(84028),Ke=n(18550),Xe=n(13689),Qe=n(93196),$e=n(70135);var et=function(e){var t=e.top,n=e.left,i=e.content,r=e.clearTooltip,l=o.useState(!0),u=(0,a.Z)(l,2),d=u[0],s=u[1],c=(0,b.u)(),m=c.colors,f=c.fontSizes,v=c.radii,g=o.useCallback((function(){s(!1),r()}),[r,s]);return(0,xe.jsx)(Ge.Z,{content:(0,xe.jsx)(Qe.Uo,{className:"stTooltipContent",children:(0,xe.jsx)(Xe.ZP,{style:{fontSize:f.sm},source:i,allowHTML:!1})}),placement:Ke.r4.top,accessibilityType:Ke.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:v.md,borderTopRightRadius:v.md,borderBottomLeftRadius:v.md,borderBottomRightRadius:v.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,$e.Iy)(c)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:f.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:d,children:(0,xe.jsx)("div",{className:"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},tt=(n(47288),function(e){var t=e.cell,n=e.theme;return!!A(t)&&((0,l.uN)((0,r.Z)((0,r.Z)({},e),{},{theme:(0,r.Z)((0,r.Z)({},n),{},{textDark:n.textLight,textMedium:n.textLight}),spriteManager:{},hyperWrapping:!1}),"None",t.contentAlign),!0)});var nt=(0,c.Z)((function(e){var t=e.element,n=e.data,c=e.width,v=e.height,g=e.disabled,p=e.widgetMgr,b=e.isFullScreen,w=o.useRef(null),x=o.useRef(null),C=(0,u.Bn)(),Z=y(),N=o.useState(!0),E=(0,a.Z)(N,2),M=E[0],T=E[1],k=o.useMemo((function(){return window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}),[]),R=o.useState({columns:l.EV.empty(),rows:l.EV.empty(),current:void 0}),_=(0,a.Z)(R,2),S=_[0],O=_[1],I=o.useCallback((function(){O({columns:l.EV.empty(),rows:l.EV.empty(),current:void 0})}),[]),D=o.useCallback((function(e){var t;null===(t=x.current)||void 0===t||t.updateCells(e)}),[]);(0,f.le)(t.editingMode)&&(t.editingMode=m.Eh.EditingMode.READ_ONLY);var A=m.Eh.EditingMode,H=A.READ_ONLY,V=A.DYNAMIC,F=n.dimensions,L=Math.max(0,F.rows-1),W=0===L&&!(t.editingMode===V&&F.dataColumns>0),j=L>15e4,B=o.useRef(new h(L)),P=o.useState(B.current.getNumRows()),q=(0,a.Z)(P,2),J=q[0],Y=q[1];o.useEffect((function(){B.current=new h(L),Y(B.current.getNumRows())}),[L]);var U=o.useCallback((function(){B.current=new h(L),Y(B.current.getNumRows())}),[L]),G=qe(t,n,g).columns;o.useEffect((function(){if(t.editingMode!==H){var e=p.getStringValue(t);e&&(B.current.fromJson(e,G),Y(B.current.getNumRows()))}}),[]);var K=Ae(n,G,J,B).getCellContent,X=Le(L,G,K),Q=X.columns,$=X.sortColumn,ee=X.getOriginalIndex,te=X.getCellContent,ne=o.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];J!==B.current.getNumRows()&&Y(B.current.getNumRows()),e&&I(),(0,f.Ds)(100,(function(){var e=B.current.toJson(Q),i=p.getStringValue(t);void 0===i&&(i=new h(0).toJson([])),e!==i&&p.setStringValue(t,e,{fromUi:n})}))()}),[p,t,J,I,Q]),ie=ze(Q,t.editingMode!==V,B,te,ee,D,ne),ae=ie.onCellEdited,re=ie.onPaste,oe=ie.onRowAppended,le=ie.onDelete,ue=ie.validateCell,de=Je(Q,te),se=de.tooltip,ce=de.clearTooltip,me=de.onItemHovered,fe=Ve(Q.map((function(e){return z(e)}))),ve=fe.columns,ge=fe.onColumnResize,he=He(t,J,c,v,b),pe=he.rowHeight,be=he.minHeight,ye=he.maxHeight,we=he.minWidth,Ce=he.maxWidth,Ze=he.resizableSize,Ne=he.setResizableSize,Ee=o.useCallback((function(e){var t=(0,a.Z)(e,2);t[0],t[1];return(0,r.Z)((0,r.Z)({},function(e,t){var n=t?"faded":"normal";return{kind:l.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}(!0,!1)),{},{displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:Z.textLight},span:[0,Math.max(Q.length-1,0)]})}),[Q,Z.textLight]);return o.useEffect((function(){var e=new s.Kz;return e.manageFormClearListener(p,t.formId,U),function(){e.disconnect()}}),[t.formId,U,p]),(0,xe.jsxs)(Ue,{className:"stDataFrame",onBlur:function(){M||k||I()},children:[(0,xe.jsx)(d.e,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:Ze,style:{border:"1px solid ".concat(Z.borderColor),borderRadius:"".concat(Z.tableBorderRadius)},minHeight:be,maxHeight:ye,minWidth:we,maxWidth:Ce,size:Ze,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,pe],snapGap:pe/3,onResizeStop:function(e,t,n,i){w.current&&Ne({width:w.current.size.width,height:ye-w.current.size.height===3?w.current.size.height+3:w.current.size.height})},children:(0,xe.jsx)(l.Nd,(0,r.Z)((0,r.Z)({className:"glideDataEditor",ref:x,columns:ve,rows:W?1:J,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:pe,headerHeight:pe,getCellContent:W?Ee:te,onColumnResize:ge,freezeColumns:W?0:Q.filter((function(e){return e.isIndex})).length,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:function(e){return!(e>=Q.length&&(t.useContainerWidth||"100%"===Ze.width))},getCellsForSelection:!0,rowMarkers:"none",rangeSelect:k?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:me,keybindings:{search:!0,downFill:!0},onHeaderClicked:W||j?void 0:$,gridSelection:S,onGridSelectionChange:function(e){(M||k)&&(O(e),void 0!==se&&ce())},drawCell:tt,theme:Z,onMouseMove:function(e){"out-of-bounds"===e.kind&&M?T(!1):"out-of-bounds"===e.kind||M||T(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1},customRenderers:[].concat((0,i.Z)(C.customRenderers),(0,i.Z)(Re)),imageEditorOverride:Te,headerIcons:Z.headerIcons,validateCell:ue,onPaste:!1},!W&&t.editingMode!==H&&!g&&{fillHandle:!k,onCellEdited:ae,onPaste:re,onDelete:le}),!W&&t.editingMode===V&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:Z.bgHeader,bgCellMedium:Z.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"auto",rowSelect:g?"none":"multi",onRowAppended:g?void 0:oe,onHeaderClicked:void 0}))}),se&&se.content&&(0,xe.jsx)(et,{top:se.top,left:se.left,content:se.content,clearTooltip:ce})]})}))}}]);
|