@stlite/desktop 0.47.1 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dump_artifacts.js +1 -1
- package/build/asset-manifest.json +20 -20
- package/build/index.html +1 -1
- package/build/static/css/8957.cd5b39ce.chunk.css +1 -0
- package/build/static/js/1122.cbaa29b2.chunk.js +1 -0
- package/build/static/js/{144.7b870b6f.chunk.js → 144.a72a0130.chunk.js} +1 -1
- package/build/static/js/{1740.893c6c48.chunk.js → 1740.f2cc8a49.chunk.js} +1 -1
- package/build/static/js/{2448.e6f85eda.chunk.js → 2448.7dff34e3.chunk.js} +1 -1
- package/build/static/js/2694.2ef7325a.chunk.js +2 -0
- package/build/static/js/4004.725eef9d.chunk.js +1 -0
- package/build/static/js/{4021.ec2e87b0.chunk.js → 4021.d0a55d54.chunk.js} +1 -1
- package/build/static/js/{4785.f0fa2d5d.chunk.js → 4785.f21e0ace.chunk.js} +1 -1
- package/build/static/js/5599.f94de6cb.chunk.js +1 -0
- package/build/static/js/5783.26aeaea5.chunk.js +1 -0
- package/build/static/js/6134.243d4a10.chunk.js +1 -0
- package/build/static/js/7125.0ba671ec.chunk.js +1 -0
- package/build/static/js/7332.71a3c522.chunk.js +1 -0
- package/build/static/js/{8050.029f3dc8.chunk.js → 8050.54afb9d0.chunk.js} +1 -1
- package/build/static/js/8957.ff10b5e2.chunk.js +1 -0
- package/build/static/js/main.b5316fd2.js +28 -0
- package/build/static/js/{main.f5b1d852.js.LICENSE.txt → main.b5316fd2.js.LICENSE.txt} +23 -25
- package/package.json +8 -8
- package/wheels/stlite_server-0.1.0-py3-none-any.whl +0 -0
- package/wheels/streamlit-1.32.2-cp311-none-any.whl +0 -0
- package/build/static/css/9699.7ce51b75.chunk.css +0 -1
- package/build/static/js/1122.422f58fc.chunk.js +0 -1
- package/build/static/js/2372.844b5190.chunk.js +0 -2
- package/build/static/js/4949.391c96be.chunk.js +0 -2
- package/build/static/js/4949.391c96be.chunk.js.LICENSE.txt +0 -45
- package/build/static/js/6134.20400e9e.chunk.js +0 -1
- package/build/static/js/7125.afecc159.chunk.js +0 -1
- package/build/static/js/7332.c686e157.chunk.js +0 -1
- package/build/static/js/790.4b5acd65.chunk.js +0 -1
- package/build/static/js/9699.fd4930f2.chunk.js +0 -1
- package/build/static/js/main.f5b1d852.js +0 -28
- package/build/static/media/index.294a0edb7af7d19b781b.cjs +0 -1
- package/build/static/media/index.c05687ef19f5bac24939.cjs +0 -1
- package/build/static/media/index.cf5b321a6e04bf47c12e.cjs +0 -1
- package/build/static/media/index.db61103fb7fdd62b9c44.cjs +0 -1
- package/build/static/media/index.f29488c1099d5e3883ac.cjs +0 -1
- package/wheels/streamlit-1.31.0-cp311-none-any.whl +0 -0
- /package/build/static/js/{2372.844b5190.chunk.js.LICENSE.txt → 2694.2ef7325a.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* @toast-ui/editor
|
|
3
|
-
* @version 3.2.2 | Fri Feb 17 2023
|
|
4
|
-
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation.
|
|
10
|
-
|
|
11
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
12
|
-
purpose with or without fee is hereby granted.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
-
***************************************************************************** */
|
|
22
|
-
|
|
23
|
-
/*! *****************************************************************************
|
|
24
|
-
Copyright (c) Microsoft Corporation.
|
|
25
|
-
|
|
26
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
27
|
-
purpose with or without fee is hereby granted.
|
|
28
|
-
|
|
29
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
30
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
31
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
32
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
33
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
34
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
35
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
36
|
-
***************************************************************************** */
|
|
37
|
-
|
|
38
|
-
/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @toast-ui/editor
|
|
42
|
-
* @version 3.2.2 | Fri Feb 17 2023
|
|
43
|
-
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
44
|
-
* @license MIT
|
|
45
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[6134],{26134:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var s=r(5057),a=r(60913),i=r(4153),n=r(96266);const d=528;function o(e){let{element:t,width:r,endpoints:o}=e;const c=(0,s.useRef)(null),{type:l,url:u,startTime:h}=t,m=(0,i.O0)(u);(0,s.useEffect)((()=>{c.current&&(c.current.currentTime=h)}),[h]),(0,s.useEffect)((()=>{const e=c.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]);const f=e=>{const{startTime:r}=t;return r?"".concat(e,"?start=").concat(r):e};if(l===a.nk.Type.YOUTUBE_IFRAME){const e=0!==r?.75*r:d;return(0,n.jsx)("iframe",{"data-testid":"stVideo",title:m,src:f(m),width:r,height:e,style:{colorScheme:"light dark"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,n.jsx)("video",{"data-testid":"stVideo",ref:c,controls:!0,src:o.buildMediaURL(m),className:"stVideo",style:{width:r,height:0===r?d:void 0}})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7125],{69212:(e,t,i)=>{i.d(t,{$:()=>c,Z:()=>p});var s=i(5057),n=i(47206),l=i(31808),a=i(96601),r=i(16449),o=i(80099),d=i(96266);let c=function(e){return e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl",e}({});const p=function(e){let{value:t,width:i,size:p=c.SMALL,overrides:g}=e;const h=(0,n.u)(),u={xs:h.spacing.twoXS,sm:h.spacing.sm,md:h.spacing.lg,lg:h.spacing.xl,xl:h.spacing.twoXL},{activeTheme:m}=s.useContext(l.E),f=!(0,a.MJ)(m),x={BarContainer:{style:{marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:i?i.toString():void 0,marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none,height:u[p],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?h.colors.primary:h.colors.blue70,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS})}};return(0,d.jsx)(r.Z,{value:t,overrides:(0,o.aO)(x,g)})}},61914:(e,t,i)=>{i.d(t,{R:()=>s});class s{setStatus(e){return new s(this.name,this.size,this.id,e)}constructor(e,t,i,s){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=i,this.status=s}}},97125:(e,t,i)=>{i.r(t),i.d(t,{default:()=>he});var s=i(51673),n=i(50482),l=i.n(n),a=i(38954),r=i.n(a),o=i(5057),d=i(60913),c=i(52955),p=i(50120);let g=function(e){return e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b",e}({});const h=(0,p.rA)()?1024:1e3,u=[g.Gigabyte,g.Megabyte,g.Kilobyte,g.Byte],m=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t||(t=g.Byte),i<0&&(i=0),e<0)throw new Error("Size must be greater than or equal to 0");const s=u.indexOf(t);return s&&e>h/2?m(e/h,u[s-1],i):"".concat(e.toFixed(i)).concat(t.toUpperCase())};var f=i(38944),x=i(93905),w=i(21034),b=i(98790),y=i(49525),S=i(38830),F=i(44088),v=i(82160);const j=(0,v.Z)("section",{target:"e1b2p2ww15"})((e=>{let{isDisabled:t,theme:i}=e;return{display:"flex",alignItems:"center",padding:i.spacing.lg,backgroundColor:i.colors.secondaryBg,borderRadius:i.radii.lg,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 1px ".concat(i.colors.primary)},color:t?i.colors.gray:i.colors.bodyText}}),""),I=(0,v.Z)("div",{target:"e1b2p2ww14"})((()=>({marginRight:"auto",alignItems:"center",display:"flex"})),""),M=(0,v.Z)("span",{target:"e1b2p2ww13"})((e=>{let{theme:t}=e;return{color:t.colors.darkenedBgMix100,marginRight:t.spacing.lg}}),""),z=(0,v.Z)("span",{target:"e1b2p2ww12"})((e=>{let{theme:t}=e;return{marginBottom:t.spacing.twoXS}}),""),L=(0,v.Z)("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),U=(0,v.Z)("div",{target:"e1b2p2ww10"})((e=>{let{theme:t}=e;return{left:0,right:0,lineHeight:t.lineHeights.tight,paddingTop:t.spacing.md,paddingLeft:t.spacing.lg,paddingRight:t.spacing.lg}}),""),C=(0,v.Z)("ul",{target:"e1b2p2ww9"})((()=>({listStyleType:"none",marginBottom:0})),""),B=(0,v.Z)("li",{target:"e1b2p2ww8"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,padding:t.spacing.none}}),""),Z=(0,v.Z)("div",{target:"e1b2p2ww7"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"baseline",flex:1,paddingLeft:t.spacing.lg,overflow:"hidden"}}),""),R=(0,v.Z)("div",{target:"e1b2p2ww6"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.sm,marginBottom:t.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),""),k=(0,v.Z)("div",{target:"e1b2p2ww5"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",marginBottom:t.spacing.twoXS}}),""),T=(0,v.Z)("span",{target:"e1b2p2ww4"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.twoXS}}),""),D=(0,v.Z)("div",{target:"e1b2p2ww3"})((e=>{let{theme:t}=e;return{display:"flex",padding:t.spacing.twoXS,color:t.colors.darkenedBgMix100}}),""),X=(0,v.Z)("small",{target:"e1b2p2ww2"})((e=>{let{theme:t}=e;return{color:t.colors.danger,fontSize:t.fontSizes.sm,height:t.fontSizes.sm,lineHeight:t.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),""),P=(0,v.Z)("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),E=e=>({[j]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[I]:{marginBottom:e.spacing.lg},[M]:{display:"none"},[U]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[R]:{width:e.sizes.full},[Z]:{flexDirection:"column"},[X]:{height:"auto",whiteSpace:"initial"},[P]:{display:"none"},[B]:{margin:e.spacing.none,padding:e.spacing.none}}),A=(0,v.Z)("div",{target:"e1b2p2ww0"})((e=>{let{theme:t}=e;return t.inSidebar?E(t):{["@media (max-width: ".concat(t.breakpoints.sm,")")]:E(t)}}),"");var V=i(44071),W=i(73401),N=i(67600),O=i(96266);const H=e=>{let{multiple:t,acceptedExtensions:i,maxSizeBytes:s}=e;return(0,O.jsxs)(I,{"data-testid":"stFileDropzoneInstructions",children:[(0,O.jsx)(M,{children:(0,O.jsx)(W.Z,{content:V.n,size:"threeXL"})}),(0,O.jsxs)(L,{children:[(0,O.jsxs)(z,{children:["Drag and drop file",t?"s":""," here"]}),(0,O.jsxs)(N.x,{children:["Limit ".concat(m(s,g.Byte,0)," per file"),i.length?" \u2022 ".concat(i.map((e=>e.replace(/^\./,"").toUpperCase())).join(", ")):null]})]})]})},_=e=>{let{onDrop:t,multiple:i,acceptedExtensions:s,maxSizeBytes:n,disabled:l,label:a}=e;return(0,O.jsx)(y.ZP,{onDrop:t,multiple:i,accept:s.length?s:void 0,maxSize:n,disabled:l,useFsAccessApi:!1,children:e=>{let{getRootProps:t,getInputProps:r}=e;return(0,O.jsxs)(j,{...t(),"data-testid":"stFileUploadDropzone",isDisabled:l,"aria-label":a,children:[(0,O.jsx)("input",{"data-testid":"stDropzoneInput",...r()}),(0,O.jsx)(H,{multiple:i,acceptedExtensions:s,maxSizeBytes:n}),(0,O.jsx)(S.ZP,{kind:F.nW.SECONDARY,disabled:l,size:F.V5.SMALL,children:"Browse files"})]})}})};var G=i(56129),K=i.n(G),$=i(75427),q=i(5642);const J=(0,v.Z)("div",{target:"e16k0npc1"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:t.spacing.twoXS,marginBottom:t.spacing.twoXS}}),""),Y=(0,v.Z)("div",{target:"e16k0npc0"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"center",color:t.colors.fadedText40}}),""),Q=e=>{let{className:t,currentPage:i,totalPages:s,onNext:n,onPrevious:l}=e;return(0,O.jsxs)(J,{className:t,"data-testid":"stPagination",children:[(0,O.jsx)(N.x,{children:"Showing page ".concat(i," of ").concat(s)}),(0,O.jsxs)(Y,{children:[(0,O.jsx)(S.ZP,{onClick:l,kind:F.nW.MINIMAL,children:(0,O.jsx)(W.Z,{content:$.s,size:"xl"})}),(0,O.jsx)(S.ZP,{onClick:n,kind:F.nW.MINIMAL,children:(0,O.jsx)(W.Z,{content:q._,size:"xl"})})]})]})};var ee=i(15717);const te=(e,t)=>Math.ceil(e.length/t),ie=e=>K()((t=>{let{pageSize:i,items:s,resetOnAdd:n,...l}=t;const[a,r]=(0,o.useState)(0),[d,c]=(0,o.useState)(te(s,i)),p=(0,ee.D)(s);(0,o.useEffect)((()=>{p&&p.length!==s.length&&c(te(s,i)),p&&p.length<s.length?n&&r(0):a+1>=d&&r(d-1)}),[s,a,i,p,n,d]);const g=s.slice(a*i,a*i+i);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(e,{items:g,...l}),s.length>i?(0,O.jsx)(Q,{className:"streamlit-paginator",pageSize:i,totalPages:d,currentPage:a+1,onNext:()=>{r(Math.min(a+1,d-1))},onPrevious:()=>{r(Math.max(0,a-1))}}):null]})}),e);var se=i(15766),ne=i(31906),le=i(13324),ae=i(69212);const re=e=>{let{fileInfo:t}=e;return"uploading"===t.status.type?(0,O.jsx)(ae.Z,{value:t.status.progress,size:ae.$.SMALL,overrides:{Bar:{style:{marginLeft:0,marginTop:"4px"}}}}):"error"===t.status.type?(0,O.jsxs)(X,{children:[(0,O.jsx)(T,{"data-testid":"stUploadedFileErrorMessage",children:t.status.errorMessage}),(0,O.jsx)(P,{children:(0,O.jsx)(W.Z,{content:se.j,size:"lg"})})]}):"uploaded"===t.status.type?(0,O.jsx)(N.x,{children:m(t.size,g.Byte)}):null},oe=e=>{let{fileInfo:t,onDelete:i}=e;return(0,O.jsxs)(k,{className:"uploadedFile","data-testid":"stUploadedFile",children:[(0,O.jsx)(D,{children:(0,O.jsx)(W.Z,{content:ne.h,size:"twoXL"})}),(0,O.jsxs)(Z,{className:"uploadedFileData",children:[(0,O.jsx)(R,{className:"uploadedFileName",title:t.name,children:t.name}),(0,O.jsx)(re,{fileInfo:t})]}),(0,O.jsx)("div",{"data-testid":"fileDeleteBtn",children:(0,O.jsx)(S.ZP,{onClick:()=>i(t.id),kind:F.nW.MINIMAL,children:(0,O.jsx)(W.Z,{content:le.U,size:"lg"})})})]})},de=ie((e=>{let{items:t,onDelete:i}=e;return(0,O.jsx)(C,{children:t.map((e=>(0,O.jsx)(B,{children:(0,O.jsx)(oe,{fileInfo:e,onDelete:i})},e.id)))})})),ce=e=>(0,O.jsx)(U,{children:(0,O.jsx)(de,{...e})});var pe=i(61914);class ge extends o.PureComponent{constructor(e){super(e),this.formClearHelper=new c.K,this.localFileIdCounter=1,this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:i}=this.props,s=i.getFileUploaderStateValue(t);l()(e,s)||i.setFileUploaderStateValue(t,e,{fromUi:!0})},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:i}=this.props,{multipleFiles:s}=i;if(!s&&0===e.length&&t.length>1){const i=t.findIndex((e=>1===e.errors.length&&"too-many-files"===e.errors[0].code));i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then((t=>{if(!s&&e.length>0){const e=this.state.files.find((e=>"error"!==e.status.type));e&&this.deleteFile(e.id)}r()(t,e).forEach((e=>{let[t,i]=e;this.uploadFile(t,i)}))})).catch((t=>{this.addFiles(e.map((e=>new pe.R(e.name,e.size,this.nextLocalFileId(),{type:"error",errorMessage:t}))))})),t.length>0){const e=t.map((e=>{const{file:t}=e;return new pe.R(t.name,t.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(e.errors[0].code,e.file)})}));this.addFiles(e)}},this.uploadFile=(e,t)=>{const i=s.Z.CancelToken.source(),n=new pe.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,n.id)),i.token).then((()=>this.onUploadComplete(n.id,e))).catch((e=>{s.Z.isCancel(e)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.onUploadComplete=(e,t)=>{const i=this.getFile(e);null!=i&&"uploading"===i.status.type&&this.updateFile(i.id,i.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return"File must be ".concat(m(this.maxUploadSizeInBytes,g.Byte)," or smaller.");case"file-invalid-type":return"".concat(t.type," files are not allowed.");case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.addFiles=e=>{this.setState((t=>({files:[...t.files,...e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((i=>({files:i.files.map((i=>i.id===e?t:i))})))},this.onUploadProgress=(e,t)=>{const i=this.getFile(t);if(null==i||"uploading"!==i.status.type)return;const s=Math.round(100*e.loaded/e.total);i.status.progress!==s&&this.updateFile(t,i.setStatus({type:"uploading",cancelToken:i.status.cancelToken,progress:s}))},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();null!=e&&this.props.widgetMgr.setFileUploaderStateValue(this.props.element,e,{fromUi:!0})}))},this.state=this.initialValue}get initialValue(){const e={files:[],newestServerFileId:0},{widgetMgr:t,element:i}=this.props,s=t.getFileUploaderStateValue(i);if(null==s)return e;const{uploadedFileInfo:n}=s;return null==n||0===n.length?e:{files:n.map((e=>{const t=e.name,i=e.size,s=e.fileId,n=e.fileUrls;return new pe.R(t,i,this.nextLocalFileId(),{type:"uploaded",fileId:s,fileUrls:n})}))}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){return((e,t,i)=>{if(e<0)throw Error("Size must be 0 or greater");const s=u.findIndex((e=>e===t)),n=u.findIndex((e=>e===i));if(-1===s||-1===n)throw Error("Unexpected byte unit provided");if(s===n)return e;const l=Math.abs(s-n),a=h**l;return s>n?e/a:e*a})(this.props.element.maxUploadSizeMb,g.Megabyte,g.Byte)}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:i}=this.props;void 0===i.getFileUploaderStateValue(t)&&i.setFileUploaderStateValue(t,e,{fromUi:!1})}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:i,status:s}=e,{fileId:n,fileUrls:l}=s;return new d.jM({fileId:n,fileUrls:l,name:t,size:i})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{files:t}=this.state,{element:i,disabled:s,widgetMgr:n}=this.props,l=i.type;this.formClearHelper.manageFormClearListener(n,i.formId,this.onFormCleared);const a=t.slice().reverse();return(0,O.jsxs)(A,{"data-testid":"stFileUploader",children:[(0,O.jsx)(f.O,{label:i.label,disabled:s,labelVisibility:(0,p.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,O.jsx)(x.dT,{children:(0,O.jsx)(w.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,O.jsx)(_,{onDrop:this.dropHandler,multiple:i.multipleFiles,acceptedExtensions:l,maxSizeBytes:this.maxUploadSizeInBytes,label:i.label,disabled:s}),a.length>0&&(0,O.jsx)(ce,{items:a,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const he=ge},52955:(e,t,i)=>{i.d(t,{K:()=>n});var s=i(50120);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={56977:e=>{function t(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,s=-1,a=0,i=0;i<=e.length;++i){if(i<e.length)n=e.charCodeAt(i);else{if(47===n)break;n=47}if(47===n){if(s===i-1||1===a);else if(s!==i-1&&2===a){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",o=0):o=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),s=i,a=0;continue}}else if(2===r.length||1===r.length){r="",o=0,s=i,a=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(s+1,i):r=e.slice(s+1,i),o=i-s-1;s=i,a=0}else 46===n&&-1!==a?++a:a=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(r=a+"/"+r,o=47===a.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length,a=s-o,i=1;i<n.length&&47===n.charCodeAt(i);++i);for(var l=n.length-i,c=a<l?a:l,d=-1,g=0;g<=c;++g){if(g===c){if(l>c){if(47===n.charCodeAt(i+g))return n.slice(i+g+1);if(0===g)return n.slice(i+g)}else a>c&&(47===e.charCodeAt(o+g)?d=g:0===g&&(d=0));break}var h=e.charCodeAt(o+g);if(h!==n.charCodeAt(i+g))break;47===h&&(d=g)}var p="";for(g=o+d+1;g<=s;++g)g!==s&&47!==e.charCodeAt(g)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(i+d):(i+=d,47===n.charCodeAt(i)&&++i,n.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,s=!0,a=e.length-1;a>=1;--a)if(47===(n=e.charCodeAt(a))){if(!s){o=a;break}}else s=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!==typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,s=-1,a=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var i=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!a){o=r+1;break}}else-1===l&&(a=!1,l=r+1),i>=0&&(c===n.charCodeAt(i)?-1===--i&&(s=r):(i=-1,s=l))}return o===s?s=l:-1===s&&(s=e.length),e.slice(o,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){o=r+1;break}}else-1===s&&(a=!1,s=r+1);return-1===s?"":e.slice(o,s)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,s=!0,a=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47!==l)-1===o&&(s=!1,o=i+1),46===l?-1===n?n=i:1!==a&&(a=1):-1!==n&&(a=-1);else if(!s){r=i+1;break}}return-1===n||-1===o||0===a||1===a&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!==typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}("/",e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),s=47===o;s?(n.root="/",r=1):r=0;for(var a=-1,i=0,l=-1,c=!0,d=e.length-1,g=0;d>=r;--d)if(47!==(o=e.charCodeAt(d)))-1===l&&(c=!1,l=d+1),46===o?-1===a?a=d:1!==g&&(g=1):-1!==a&&(g=-1);else if(!c){i=d+1;break}return-1===a||-1===l||0===g||1===g&&a===l-1&&a===i+1?-1!==l&&(n.base=n.name=0===i&&s?e.slice(1,l):e.slice(i,l)):(0===i&&s?(n.name=e.slice(1,a),n.base=e.slice(1,l)):(n.name=e.slice(i,a),n.base=e.slice(i,l)),n.ext=e.slice(a,l)),i>0?n.dir=e.slice(0,i-1):s&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=n(56977),t=n.n(e);function r(e,n){const r=t().normalize(n),o=t().dirname(r).split("/"),s=[];for(const t of o){s.push(t);const n=s.join("/");if(e.FS.analyzePath(n).exists){if(e.FS.isDir(n))throw new Error(`"${n}" already exists and is not a directory.`)}else try{e.FS.mkdir(n)}catch(a){throw console.error(`Failed to create a directory "${n}"`),a}}}function o(e,t,n,o){r(e,t),e.FS.writeFile(t,n,o)}function s(e){e.forEach((e=>{let t;try{t=new URL(e)}catch(n){return}if("emfs:"===t.protocol||"file:"===t.protocol)throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${e})`)}))}function a(e){e.runPython('\nimport micropip\nmicropip.add_mock_package(\n "pyarrow", "0.0.1",\n modules={\n "pyarrow": """\n__version__ = \'0.0.1\' # TODO: Update when releasing\n\n\nclass Table:\n @classmethod\n def from_pandas(*args, **kwargs):\n raise NotImplementedError("stlite is not supporting this method.")\n"""\n }\n)\n')}var i=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function a(e){try{l(r.next(e))}catch(t){s(t)}}function i(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}l((r=r.apply(e,t||[])).next())}))};let l,c;const d=self,g=new class{constructor(){this.promise=new Promise(((e,t)=>{this.resolveInternal=e,this.rejectInternal=t}))}resolve(e){this.resolveInternal(e)}reject(e){this.rejectInternal(e)}};function h(e){d.postMessage({type:"event:progress",data:{message:e}})}const p="https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js";const u=function(){return i(this,void 0,void 0,(function*(){const{entrypoint:e,files:t,archives:n,requirements:r,wheels:u,mountedSitePackagesSnapshotFilePath:f,pyodideUrl:m=p,streamlitConfig:y}=yield g.promise;if(h("Loading Pyodide."),console.debug("Loading Pyodide"),l=yield function(e,t){return i(this,void 0,void 0,(function*(){const n=e.slice(0,e.lastIndexOf("/")+1);let r;return e.endsWith(".mjs")?r=(yield import(e)).loadPyodide:(importScripts(e),r=self.loadPyodide),r(Object.assign(Object.assign({},t),{indexURL:n}))}))}(m,{stdout:console.log,stderr:console.error}),console.debug("Loaded Pyodide"),h("Mounting files."),yield Promise.all(Object.keys(t).map((e=>i(this,void 0,void 0,(function*(){const n=t[e];let r;"url"in n?(console.debug(`Fetch a file from ${n.url}`),r=yield fetch(n.url).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e)))):r=n.data;const{opts:s}=t[e];console.debug(`Write a file "${e}"`),o(l,e,r,s)}))))),h("Unpacking archives."),yield Promise.all(n.map((e=>i(this,void 0,void 0,(function*(){let t;"url"in e?(console.debug(`Fetch an archive from ${e.url}`),t=yield fetch(e.url).then((e=>e.arrayBuffer()))):t=e.buffer;const{format:n,options:r}=e;console.debug("Unpack an archive",{format:n,options:r}),l.unpackArchive(t,n,r)}))))),!f&&!u)throw new Error("Neither snapshot nor wheel files are provided.");f&&(h("Restoring the snapshot."),yield l.runPythonAsync("import tarfile, shutil, site"),yield l.runPythonAsync("\n site_packages_dirs = site.getsitepackages()\n for site_packages in site_packages_dirs:\n shutil.rmtree(site_packages)\n "),console.debug(`Unarchive ${f}`),yield l.runPythonAsync(`\n with tarfile.open("${f}", "r") as tar_gz_file:\n tar_gz_file.extractall("/")\n `),console.debug("Restored the snapshot"),h("Mocking some packages."),console.debug("Mock pyarrow"),a(l),console.debug("Mocked pyarrow")),s(r),h("Installing packages."),yield l.loadPackage("micropip");const b=l.pyimport("micropip");u?(console.debug("Installing the wheels:",u,"and the requirements:",r),yield b.install.callKwargs([u.stliteServer,u.streamlit,...r],{keep_going:!0}),console.debug("Installed the wheels and the requirements"),h("Mocking some packages."),console.debug("Mock pyarrow"),a(l),console.debug("Mocked pyarrow")):(console.debug("Installing the requirements:",r),yield b.install.callKwargs(r,{keep_going:!0}),console.debug("Installed the requirements")),yield l.runPythonAsync("\n import importlib\n importlib.invalidate_caches()\n "),h("Loading streamlit package."),console.debug("Loading the Streamlit package"),yield l.runPythonAsync("\n import streamlit.runtime\n import streamlit.web\n "),console.debug("Loaded the Streamlit package"),h("Setting up the loggers."),console.debug("Setting the loggers"),yield l.runPythonAsync("\n import logging\n import streamlit.logger\n\n streamlit.logger.get_logger = logging.getLogger\n streamlit.logger.setup_formatter = None\n streamlit.logger.update_formatter = lambda *a, **k: None\n streamlit.logger.set_log_level = lambda *a, **k: None\n ");self.__logCallback__=e=>{e.startsWith("CRITICAL")||e.startsWith("ERROR")?console.error(e):e.startsWith("WARNING")?console.warn(e):e.startsWith("INFO")?console.info(e):e.startsWith("DEBUG")?console.debug(e):console.log(e)},yield l.runPythonAsync('\n from js import __logCallback__\n\n\n class JsHandler(logging.Handler):\n def emit(self, record):\n msg = self.format(record)\n __logCallback__(msg)\n\n\n main_formatter = logging.Formatter("%(levelname)s:%(name)s:%(message)s")\n\n js_handler = JsHandler()\n js_handler.setFormatter(main_formatter)\n\n root_logger = logging.getLogger()\n root_logger.handlers.clear()\n root_logger.addHandler(js_handler)\n root_logger.setLevel(logging.DEBUG)\n\n streamlit_handler = logging.getLogger("streamlit")\n streamlit_handler.setLevel(logging.DEBUG)\n '),console.debug("Set the loggers"),h("Mocking some Streamlit functions for the browser environment."),console.debug("Mocking some Streamlit functions"),yield l.runPythonAsync("\n import streamlit\n\n def is_cacheable_msg(msg):\n return False\n\n streamlit.runtime.runtime.is_cacheable_msg = is_cacheable_msg\n "),console.debug("Mocked some Streamlit functions"),h("Booting up the Streamlit server."),console.debug("Booting up the Streamlit server"),self.__streamlitFlagOptions__=Object.assign(Object.assign({"browser.gatherUsageStats":!1},y),{"runner.fastReruns":!1}),yield l.runPythonAsync(`\n from stlite_server.bootstrap import load_config_options, prepare\n from stlite_server.server import Server\n from js import __streamlitFlagOptions__\n\n flag_options = __streamlitFlagOptions__.to_py()\n load_config_options(flag_options)\n\n main_script_path = "${e}"\n command_line = None\n args = []\n\n prepare(main_script_path, args)\n\n server = Server(main_script_path, command_line)\n server.start()\n `),console.debug("Booted up the Streamlit server"),console.debug("Setting up the HTTP server"),c=l.globals.get("server").copy(),console.debug("Set up the HTTP server"),d.postMessage({type:"event:loaded"})}))}().catch((e=>{throw d.postMessage({type:"event:error",data:{error:e}}),e}));self.onmessage=e=>i(void 0,void 0,void 0,(function*(){const t=e.data;if("initData"===t.type)return void g.resolve(t.data);yield u;const n=e.ports[0];try{switch(t.type){case"websocket:connect":{console.debug("websocket:connect",t.data);const{path:e}=t.data;c.start_websocket(e,((e,t)=>{if(t){const t=e.getBuffer("u8");e.destroy();const n=new Uint8ClampedArray(t.data.buffer,t.data.byteOffset,t.data.byteLength);d.postMessage({type:"websocket:message",data:{payload:new Uint8Array(n)}})}else d.postMessage({type:"websocket:message",data:{payload:e}})})),n.postMessage({type:"reply"});break}case"websocket:send":{console.debug("websocket:send",t.data);const{payload:e}=t.data;c.receive_websocket_from_js(e);break}case"http:request":{console.debug("http:request",t.data);const{request:e}=t.data,r=(e,t,r)=>{const o=t.toJs(),s=r.toJs();console.debug({statusCode:e,headers:o,body:s});const a={type:"http:response",data:{response:{statusCode:e,headers:o,body:s}}};n.postMessage(a)};c.receive_http_from_js(e.method,decodeURIComponent(e.path),e.headers,e.body,r);break}case"file:write":{const{path:e,data:r,opts:s}=t.data;console.debug(`Write a file "${e}"`),o(l,e,r,s),n.postMessage({type:"reply"});break}case"file:rename":{const{oldPath:e,newPath:o}=t.data;console.debug(`Rename "${e}" to ${o}`),function(e,t,n){r(e,n),e.FS.rename(t,n)}(l,e,o),n.postMessage({type:"reply"});break}case"file:unlink":{const{path:e}=t.data;console.debug(`Remove "${e}`),l.FS.unlink(e),n.postMessage({type:"reply"});break}case"install":{const{requirements:e}=t.data,r=l.pyimport("micropip");console.debug("Install the requirements:",e),s(e),yield r.install.callKwargs(e,{keep_going:!0}).then((()=>{if(e.includes("matplotlib"))return l.runPythonAsync("\n from stlite_server.bootstrap import _fix_matplotlib_crash\n _fix_matplotlib_crash()\n ")})).then((()=>{console.debug("Successfully installed"),n.postMessage({type:"reply"})}))}}}catch(a){if(console.error(a),!(a instanceof Error))throw a;const e=new Error(a.message);e.name=a.name,e.stack=a.stack,n.postMessage({type:"reply",error:e})}})),d.postMessage({type:"event:start"})})()})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[790],{70790:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var a,n=r(65850),o=r(5057);function u(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function i(){}function l(e){return!!(e||"").match(/\d/)}function s(e){return null===e||void 0===e}function c(e){return s(e)||function(e){return"number"===typeof e&&isNaN(e)}(e)||"number"===typeof e&&!isFinite(e)}function f(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function v(e,t){void 0===t&&(t=!0);var r="-"===e[0],a=r&&t,n=(e=e.replace("-","")).split(".");return{beforeDecimal:n[0],afterDecimal:n[1]||"",hasNegation:r,addNegation:a}}function d(e,t,r){for(var a="",n=r?"0":"",o=0;o<=t-1;o++)a+=e[o]||n;return a}function g(e,t){return Array(t+1).join(e)}function m(e){var t=e+"",r="-"===t[0]?"-":"";r&&(t=t.substring(1));var a=t.split(/[eE]/g),n=a[0],o=a[1];if(!(o=Number(o)))return r+n;var u=1+o,i=(n=n.replace(".","")).length;return u<0?n="0."+g("0",Math.abs(u))+n:u>=i?n+=g("0",u-i):n=(n.substring(0,u)||"0")+"."+n.substring(u),r+n}function p(e,t,r){if(-1!==["","-"].indexOf(e))return e;var a=(-1!==e.indexOf(".")||r)&&t,n=v(e),o=n.beforeDecimal,u=n.afterDecimal,i=n.hasNegation,l=parseFloat("0."+(u||"0")),s=(u.length<=t?"0."+u:l.toFixed(t)).split(".");return""+(i?"-":"")+o.split("").reverse().reduce((function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),s[0])+(a?".":"")+d(s[1]||"",t,r)}function h(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}!function(e){e.event="event",e.props="prop"}(a||(a={}));var S=function(e){var t,r=void 0;return function(){for(var a=[],n=arguments.length;n--;)a[n]=arguments[n];return t&&a.length===t.length&&a.every((function(e,r){return e===t[r]}))?r:(t=a,r=e.apply(void 0,a))}}((function(e,t){for(var r=0,a=0,n=e.length,o=t.length;e[r]===t[r]&&r<n;)r++;for(;e[n-1-a]===t[o-1-a]&&o-a>r&&n-a>r;)a++;return{from:{start:r,end:n-a},to:{start:r,end:o-a}}}));function b(e){return Math.max(e.selectionStart,e.selectionEnd)}function y(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function V(e){var t=e.currentValue,r=e.formattedValue,a=e.currentValueIndex,n=e.formattedValueIndex;return t[a]===r[n]}function w(e,t,r,a){var n,o,u,i=e.length;if(n=t,o=0,u=i,t=Math.min(Math.max(n,o),u),"left"===a){for(;t>=0&&!r[t];)t--;-1===t&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return-1===t&&(t=i),t}function x(e){for(var t=Array.from({length:e.length+1}).map((function(){return!0})),r=0,a=t.length;r<a;r++)t[r]=Boolean(l(e[r])||l(e[r-1]));return t}function N(e,t,r,a,n,u){void 0===u&&(u=i);var l=function(e){var t=(0,o.useRef)(e);t.current=e;var r=(0,o.useRef)((function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t.current.apply(t,e)}));return r.current}((function(e,t){var r,o;return c(e)?(o="",r=""):"number"===typeof e||t?(o="number"===typeof e?m(e):e,r=a(o)):(o=n(e,void 0),r=a(o)),{formattedValue:r,numAsString:o}})),f=(0,o.useState)((function(){return l(s(e)?t:e,r)})),v=f[0],d=f[1],g=e,p=r;s(e)&&(g=v.numAsString,p=!0);var h=l(g,p);return(0,o.useMemo)((function(){d(h)}),[h.formattedValue]),[v,function(e,t){e.formattedValue!==v.formattedValue&&d({formattedValue:e.formattedValue,numAsString:e.value}),u(e,t)}]}function D(e){return e.replace(/[^0-9]/g,"")}function O(e){return e}function C(e){var t=e.type;void 0===t&&(t="text");var r=e.displayType;void 0===r&&(r="input");var n=e.customInput,s=e.renderText,c=e.getInputRef,f=e.format;void 0===f&&(f=O);var v=e.removeFormatting;void 0===v&&(v=D);var d=e.defaultValue,g=e.valueIsNumericString,m=e.onValueChange,p=e.isAllowed,y=e.onChange;void 0===y&&(y=i);var C=e.onKeyDown;void 0===C&&(C=i);var E=e.onMouseUp;void 0===E&&(E=i);var T=e.onFocus;void 0===T&&(T=i);var I=e.onBlur;void 0===I&&(I=i);var A=e.value,R=e.getCaretBoundary;void 0===R&&(R=x);var j=e.isValidInputCharacter;void 0===j&&(j=l);var B=e.isCharacterSame,F=u(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=N(A,d,Boolean(g),f,v,m),M=k[0],P=M.formattedValue,W=M.numAsString,L=k[1],K=(0,o.useRef)({formattedValue:P,numAsString:W}),U=function(e,t){K.current={formattedValue:e.formattedValue,numAsString:e.value},L(e,t)},_=(0,o.useState)(!1),G=_[0],$=_[1],z=(0,o.useRef)(null),Z=(0,o.useRef)({setCaretTimeout:null,focusTimeout:null});(0,o.useEffect)((function(){return $(!0),function(){clearTimeout(Z.current.setCaretTimeout),clearTimeout(Z.current.focusTimeout)}}),[]);var q=f,H=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},J=function(e,t,r){0===e.selectionStart&&e.selectionEnd===e.value.length||(h(e,t),Z.current.setCaretTimeout=setTimeout((function(){e.value===r&&e.selectionStart!==e.selectionEnd&&h(e,t)}),0))},Q=function(e,t,r){return w(e,t,R(e),r)},X=function(e,t,r){var a=R(t),n=function(e,t,r,a,n,o,u){void 0===u&&(u=V);var i=n.findIndex((function(e){return e})),l=e.slice(0,i);t||r.startsWith(l)||(t=l,r=l+r,a+=l.length);for(var s=r.length,c=e.length,f={},v=new Array(s),d=0;d<s;d++){v[d]=-1;for(var g=0,m=c;g<m;g++)if(u({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:d,formattedValueIndex:g})&&!0!==f[g]){v[d]=g,f[g]=!0;break}}for(var p=a;p<s&&(-1===v[p]||!o(r[p]));)p++;var h=p===s||-1===v[p]?c:v[p];for(p=a-1;p>0&&-1===v[p];)p--;var S=-1===p||-1===v[p]?0:v[p]+1;return S>h?h:a-S<h-a?S:h}(t,P,e,r,a,j,B);return n=w(t,n,a)};(0,o.useEffect)((function(){var e=K.current,t=e.formattedValue,r=e.numAsString;P===t||P===W&&t===r||U(H(P,W),{event:void 0,source:a.props})}),[P,W]);var Y=z.current?b(z.current):void 0;("undefined"!==typeof window?o.useLayoutEffect:o.useEffect)((function(){var e=z.current;if(P!==K.current.formattedValue&&e){var t=X(K.current.formattedValue,P,Y);e.value=P,J(e,t,P)}}),[P]);var ee=function(e,t,r){var a=S(P,e),n=Object.assign(Object.assign({},a),{lastValue:P}),o=v(e,n),u=q(o);if(o=v(u,void 0),p&&!p(H(u,o))){var i=t.target,l=b(i),s=X(e,P,l);return i.value=P,J(i,s,P),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var r=e.input,a=e.setCaretPosition;void 0===a&&(a=!0);var n=e.source,o=e.event,u=e.numAsString,i=e.caretPos;if(r){if(void 0===i&&a){var l=e.inputValue||r.value,s=b(r);r.value=t,i=X(l,t,s)}r.value=t,a&&void 0!==i&&J(r,i,t)}t!==P&&U(H(t,u),{event:o,source:n})}({formattedValue:u,numAsString:o,inputValue:e,event:t,source:r,setCaretPosition:!0,input:t.target}),!0},te=!G||"undefined"===typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",re=Object.assign({inputMode:te},F,{type:t,value:P,onChange:function(e){var t=e.target.value;ee(t,e,a.event)&&y(e)},onKeyDown:function(e){var t,r=e.target,a=e.key,n=r.selectionStart,o=r.selectionEnd,u=r.value;if(void 0===u&&(u=""),"ArrowLeft"===a||"Backspace"===a?t=Math.max(n-1,0):"ArrowRight"===a?t=Math.min(n+1,u.length):"Delete"===a&&(t=n),void 0!==t&&n===o){var i=t;if("ArrowLeft"===a||"ArrowRight"===a)(i=Q(u,t,"ArrowLeft"===a?"left":"right"))!==t&&e.preventDefault();else"Delete"!==a||j(u[t])?"Backspace"!==a||j(u[t])||(i=Q(u,t,"left")):i=Q(u,t,"right");i!==t&&J(r,i,u),e.isUnitTestRun&&J(r,i,u),C(e)}else C(e)},onMouseUp:function(e){var t=e.target,r=t.selectionStart,a=t.selectionEnd,n=t.value;if(void 0===n&&(n=""),r===a){var o=Q(n,r);o!==r&&J(t,o,n)}E(e)},onFocus:function(e){e.persist&&e.persist();var t=e.target;z.current=t,Z.current.focusTimeout=setTimeout((function(){var r=t.selectionStart,a=t.selectionEnd,n=t.value;void 0===n&&(n="");var o=Q(n,r);o===r||0===r&&a===n.length||J(t,o,n),T(e)}),0)},onBlur:function(e){z.current=null,clearTimeout(Z.current.focusTimeout),clearTimeout(Z.current.setCaretTimeout),I(e)}});if("text"===r)return s?o.createElement(o.Fragment,null,s(P,F)||null):o.createElement("span",Object.assign({},F,{ref:c}),P);if(n){var ae=n;return o.createElement(ae,Object.assign({},re,{ref:c}))}return o.createElement("input",Object.assign({},re,{ref:c}))}function E(e,t){var r=t.decimalScale,a=t.fixedDecimalScale,n=t.prefix;void 0===n&&(n="");var o=t.suffix;void 0===o&&(o="");var u=t.allowNegative,i=t.thousandsGroupStyle;if(void 0===i&&(i="thousand"),""===e||"-"===e)return e;var l=T(t),s=l.thousandSeparator,c=l.decimalSeparator,f=0!==r&&-1!==e.indexOf(".")||r&&a,g=v(e,u),m=g.beforeDecimal,p=g.afterDecimal,h=g.addNegation;return void 0!==r&&(p=d(p,r,!!a)),s&&(m=function(e,t,r){var a=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),n=e.search(/[1-9]/);return n=-1===n?e.length:n,e.substring(0,n)+e.substring(n,e.length).replace(a,"$1"+t)}(m,s,i)),n&&(m=n+m),o&&(p+=o),h&&(m="-"+m),e=m+(f&&c||"")+p}function T(e){var t=e.decimalSeparator;void 0===t&&(t=".");var r=e.thousandSeparator,a=e.allowedDecimalSeparators;return!0===r&&(r=","),a||(a=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:a}}function I(e,t,r){var a;void 0===t&&(t=y(e));var n=r.allowNegative,o=r.prefix;void 0===o&&(o="");var u=r.suffix;void 0===u&&(u="");var i=r.decimalScale,s=t.from,c=t.to,d=c.start,g=c.end,m=T(r),p=m.allowedDecimalSeparators,h=m.decimalSeparator,S=e[g]===h;if(l(e)&&(e===o||e===u)&&""===t.lastValue)return e;if(g-d===1&&-1!==p.indexOf(e[d])){var b=0===i?"":h;e=e.substring(0,d)+b+e.substring(d+1,e.length)}var V=function(e,t,r){var a=!1,n=!1;o.startsWith("-")?a=!1:e.startsWith("--")?(a=!1,n=!0):u.startsWith("-")&&e.length===u.length?a=!1:"-"===e[0]&&(a=!0);var i=a?1:0;return n&&(i=2),i&&(e=e.substring(i),t-=i,r-=i),{value:e,start:t,end:r,hasNegation:a}},w=V(e,d,g),x=w.hasNegation;e=(a=w).value,d=a.start,g=a.end;var N=V(t.lastValue,s.start,s.end),D=N.start,O=N.end,C=N.value,E=e.substring(d,g);!(e.length&&C.length&&(D>C.length-u.length||O<o.length))||E&&u.startsWith(E)||(e=C);var I=0;e.startsWith(o)?I+=o.length:d<o.length&&(I=d),g-=I;var A=(e=e.substring(I)).length,R=e.length-u.length;e.endsWith(u)?A=R:(g>R||g>e.length-u.length)&&(A=g),e=e.substring(0,A),e=function(e,t){void 0===e&&(e="");var r=new RegExp("(-)"),a=new RegExp("(-)(.)*(-)"),n=r.test(e),o=a.test(e);return e=e.replace(/-/g,""),n&&!o&&t&&(e="-"+e),e}(x?"-"+e:e,n),e=(e.match(function(e,t){return new RegExp("(^-)|[0-9]|"+f(e),t?"g":void 0)}(h,!0))||[]).join("");var j=e.indexOf(h),B=v(e=e.replace(new RegExp(f(h),"g"),(function(e,t){return t===j?".":""})),n),F=B.beforeDecimal,k=B.afterDecimal,M=B.addNegation;return c.end-c.start<s.end-s.start&&""===F&&S&&!parseFloat(k)&&(e=M?"-":""),e}function A(e){e=function(e){var t=T(e),r=t.thousandSeparator,a=t.decimalSeparator,n=e.prefix;void 0===n&&(n="");var o=e.allowNegative;if(void 0===o&&(o=!0),r===a)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+r+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+a+" (default value for decimalSeparator is .)\n ");return n.startsWith("-")&&o&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+n+"\n allowNegative: "+o+"\n "),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}(e);e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,o=e.onKeyDown;void 0===o&&(o=i);var f=e.onBlur;void 0===f&&(f=i);var v=e.thousandSeparator,d=e.decimalScale,g=e.fixedDecimalScale,b=e.prefix;void 0===b&&(b="");var y=e.defaultValue,V=e.value,w=e.valueIsNumericString,x=e.onValueChange,D=u(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),O=T(e),C=O.decimalSeparator,A=O.allowedDecimalSeparators,R=function(t){return E(t,e)},j=function(t,r){return I(t,r,e)},B=s(V)?y:V,F=null!==w&&void 0!==w?w:function(e,t,r){return""===e||!(null===t||void 0===t?void 0:t.match(/\d/))&&!(null===r||void 0===r?void 0:r.match(/\d/))&&"string"===typeof e&&!isNaN(Number(e))}(B,b,t);s(V)?s(y)||(F=F||"number"===typeof y):F=F||"number"===typeof V;var k=function(e){return c(e)?e:("number"===typeof e&&(e=m(e)),F&&"number"===typeof d?p(e,d,Boolean(g)):e)},M=N(k(V),k(y),Boolean(F),R,j,x),P=M[0],W=P.numAsString,L=P.formattedValue,K=M[1];return Object.assign(Object.assign({},D),{value:L,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===C||l(e)},isCharacterSame:function(e){var t=e.currentValue,r=e.lastValue,a=e.formattedValue,n=e.currentValueIndex,o=e.formattedValueIndex,u=t[n],i=a[o],l=S(r,t).to;return!!(n>=l.start&&n<l.end&&A&&A.includes(u)&&i===C)||u===i},onValueChange:K,format:R,removeFormatting:j,getCaretBoundary:function(t){return function(e,t){var r=t.prefix;void 0===r&&(r="");var a=t.suffix;void 0===a&&(a="");var n=Array.from({length:e.length+1}).map((function(){return!0})),o="-"===e[0];n.fill(!1,0,r.length+(o?1:0));var u=e.length;return n.fill(!1,u-a.length+1,u+1),n}(t,e)},onKeyDown:function(e){var t=e.target,a=e.key,n=t.selectionStart,u=t.selectionEnd,i=t.value;if(void 0===i&&(i=""),n===u){"Backspace"===a&&"-"===i[0]&&n===b.length+1&&r&&h(t,1),d&&g&&("Backspace"===a&&i[n-1]===C?(h(t,n-1),e.preventDefault()):"Delete"===a&&i[n]===C&&e.preventDefault()),(null===A||void 0===A?void 0:A.includes(a))&&i[n]===C&&h(t,n+1);var l=!0===v?",":v;"Backspace"===a&&i[n-1]===l&&h(t,n-1),"Delete"===a&&i[n]===l&&h(t,n+1),o(e)}else o(e)},onBlur:function(t){var r=W;if(r.match(/\d/g)||(r=""),n||(r=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),a=r[0].replace(/^0+/,"")||"0",n=r[1]||"";return(t?"-":"")+a+(n?"."+n:"")}(r)),g&&d&&(r=p(r,d,g)),r!==W){var o=E(r,e);K({formattedValue:o,value:r,floatValue:parseFloat(r)},{event:t,source:a.event})}f(t)}})}function R(e){var t=A(e);return o.createElement(C,Object.assign({},t))}var j=(0,n.d)("div")({name:"NumberOverlayEditorStyle",class:"n1czszh3"});function B(){var e,t,r;const a=null==(r=null==(t=null==(e=Intl.NumberFormat())?void 0:e.formatToParts(1.1))?void 0:t.find((e=>"decimal"===e.type)))?void 0:r.value;return null!=a?a:"."}var F=e=>{const{value:t,onChange:r,disabled:a,highlight:n,validatedSelection:u,fixedDecimals:i,allowNegative:l,thousandSeparator:s,decimalSeparator:c}=e,f=o.useRef();return o.useLayoutEffect((()=>{var e;if(void 0!==u){const t="number"===typeof u?[u,null]:u;null==(e=f.current)||e.setSelectionRange(t[0],t[1])}}),[u]),o.createElement(j,null,o.createElement(R,{autoFocus:!0,getInputRef:f,className:"gdg-input",onFocus:e=>e.target.setSelectionRange(n?0:e.target.value.length,e.target.value.length),disabled:!0===a,decimalScale:i,allowNegative:l,thousandSeparator:null!=s?s:"."===B()?",":".",decimalSeparator:null!=c?c:B(),value:Object.is(t,-0)?"-":null!=t?t:"",onValueChange:r}))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9699],{96260:(e,t,n)=>{n.r(t),n.d(t,{default:()=>kt});var i=n(5057),o=n(66751),a=n(27179),l=n(23046),r=n(30383),s=n(61078),d=n(83221),c=n(52955),u=n(50651),m=n(60913),h=n(50120),g=n(47206),p=n(18932),f=n(93576),b=n(46403),v=n(98790),y=n(38830),w=n(44088),x=n(73401),C=n(31808),T=n(82160),k=n(96601);const E=(0,T.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"0.5rem 0 0.5rem 0.5rem",position:"absolute",top:n?"-2.4rem":"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"}}}}}),""),M=(0,T.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,k.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.lg,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var N=n(96266);function R(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const a=(0,g.u)(),l=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(v.Z,{content:(0,N.jsx)(b.ZP,{source:t,allowHTML:!1,style:{fontSize:a.fontSizes.sm}}),placement:v.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(y.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:w.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(x.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),l&&(0,N.jsx)("span",{children:l})]})})})}const S=e=>{let{onExpand:t,onCollapse:n,isFullScreen:o,locked:a,children:l,target:r}=e;const{libConfig:s}=i.useContext(C.E);return(0,N.jsx)(E,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||o,target:r,children:(0,N.jsxs)(M,{children:[l,t&&!s.disableFullscreenMode&&!o&&(0,N.jsx)(R,{label:"Fullscreen",icon:p.i,onClick:()=>t()}),n&&!s.disableFullscreenMode&&o&&(0,N.jsx)(R,{label:"Close fullscreen",icon:f.m,onClick:()=>n()})]})})};var _=n(26849),O=n.n(_),I=n(40807),D=n.n(I),H=n(61918),A=n.n(H),z=n(59500),V=n(88084),F=n.n(V);n(56719),n(21763);const j=["true","t","yes","y","on","1"],L=["false","f","no","n","off","0"];function W(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function B(e){return e.hasOwnProperty("isError")&&e.isError}function P(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function Y(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function Z(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function q(e){return{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 J(e,t){return(0,h.le)(e)?t||{}:(0,h.le)(t)?e||{}:D()(e,t)}function K(e){if((0,h.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),"string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:X(e))):[X(t)]}catch(t){return[X(e)]}}function X(e){try{try{return O()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function G(e){if((0,h.le)(e))return null;if("boolean"===typeof e)return e;const t=X(e).toLowerCase().trim();return""===t?null:!!j.includes(t)||!L.includes(t)&&void 0}function U(e){if((0,h.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=A().unformat(e.trim());if((0,h.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Q(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,h.le)(t)||""===t?(0===n&&(e=Math.round(e)),A()(e).format((0,h.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):"duration[ns]"===t?F().duration(e/1e6,"milliseconds").humanize():(0,z.sprintf)(t,e)}function $(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function ee(e){if((0,h.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{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=F().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=F().utc(e);if(t.isValid())return t.toDate();const n=F().utc(e,[F().HTML5_FMT.TIME_MS,F().HTML5_FMT.TIME_SECONDS,F().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function te(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const ne=new RegExp(/(\r\n|\n|\r)/gm);function ie(e){return-1!==e.indexOf("\n")?e.replace(ne," "):e}var oe=n(70714),ae=n(87241);function le(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,h.bb)(e)?X(e):null,i=(0,h.bb)(n)?ie(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,h.le)(e)}}catch(n){return W(X(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}le.isEditableType=!1;const re=le;function se(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(l)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},a=i=>{if((0,h.le)(i))return!e.isRequired;let o=X(i),a=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),a=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!a||o)};return{...e,kind:"text",sortMode:"default",validateInput:a,getCell(e,t){if("string"===typeof n)return W(X(e),n);if(t){const t=a(e);if(!1===t)return W(X(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,h.bb)(e)?X(e):null,n=(0,h.bb)(t)?ie(t):"";return{...i,isMissingValue:(0,h.le)(t),data:t,displayData:n}}catch(l){return W("Incompatible value","The value cannot be interpreted as string. Error: ".concat(l))}},getCellValue:e=>void 0===e.data?null:e.data}}se.isEditableType=!0;const de=se;function ce(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function ue(e,t,n,i,a,l,r){var s;const d=J({format:n,step:i,timezone:r},t.columnTypeOptions);let c,u,m;if((0,h.bb)(d.timezone))try{var g;c=(null===(g=ce(F()(),d.timezone))||void 0===g?void 0:g.utcOffset())||void 0}catch(b){}(0,h.bb)(d.min_value)&&(u=ee(d.min_value)||void 0),(0,h.bb)(d.max_value)&&(m=ee(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:a,min:u,max:m}},f=e=>{const n=ee(e);return null===n?!t.isRequired:void 0!==n&&(!((0,h.bb)(u)&&l(n)<l(u))&&!((0,h.bb)(m)&&l(n)>l(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return W(X(e),"Invalid input.");t instanceof Date&&(e=t)}const i=ee(e);let o="",a="",l=c;if(void 0===i)return W(X(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=F().utc(i);if(!e.isValid())return W(X(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=ce(e,d.timezone)}catch(b){return W(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}l=e.utcOffset()}try{a=$(e,d.format||n)}catch(b){return W(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=$(e,n)}return{...p,copyData:o,isMissingValue:(0,h.le)(i),data:{...p.data,date:i,displayDate:a,timezoneOffset:l}}},getCellValue(e){var t;return(0,h.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:l(e.data.date)}}}function me(e){var t,n,i,o;let a="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?a="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(a="YYYY-MM-DD HH:mm:ss.SSS");const l=null===(i=e.arrowType)||void 0===i||null===(i=i.meta)||void 0===i?void 0:i.timezone,r=(0,h.bb)(l)||(0,h.bb)(null===e||void 0===e||null===(o=e.columnTypeOptions)||void 0===o?void 0:o.timezone);return ue("datetime",e,r?a+"Z":a,1,"datetime-local",(e=>r?e.toISOString():e.toISOString().replace("Z","")),l)}function he(e){var t,n;let i="HH:mm:ss";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.SSS"),ue("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function ge(e){return ue("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function pe(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=G(e),void 0===n?W(X(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,h.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}me.isEditableType=!0,he.isEditableType=!0,ge.isEditableType=!0,pe.isEditableType=!0;const fe=pe;function be(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function ve(e){const t=ae.fu.getTypeName(e.arrowType),n=J({step:be(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:"timedelta64[ns]"===t?"duration[ns]":void 0},e.columnTypeOptions),i=(0,h.le)(n.min_value)||n.min_value<0,a=(0,h.bb)(n.step)&&!Number.isNaN(n.step)?te(n.step):void 0,l={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:a},r=t=>{let i=U(t);if((0,h.le)(i))return!e.isRequired;if(Number.isNaN(i))return!1;let o=!1;return(0,h.bb)(n.max_value)&&i>n.max_value&&(i=n.max_value,o=!0),!((0,h.bb)(n.min_value)&&i<n.min_value)&&(!o||i)};return{...e,kind:"number",sortMode:"smart",validateInput:r,getCell(e,t){if(!0===t){const t=r(e);if(!1===t)return W(X(e),"Invalid input.");"number"===typeof t&&(e=t)}let i=U(e),o="";if((0,h.bb)(i)){if(Number.isNaN(i))return W(X(e),"The value cannot be interpreted as a number.");if((0,h.bb)(a)&&(s=i,i=0===(d=a)?Math.trunc(s):Math.trunc(s*10**d)/10**d),Number.isInteger(i)&&!Number.isSafeInteger(i))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=Q(i,n.format,a)}catch(c){return W(X(i),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var s,d;return{...l,data:i,displayData:o,isMissingValue:(0,h.le)(i)}},getCellValue:e=>void 0===e.data?null:e.data}}ve.isEditableType=!0;const ye=ve;function we(e){let t="string";const n=J({options:"bool"===ae.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>X(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,h.bb)(e)&&""!==e&&(n=X(e)),t&&!a.data.allowedValues.includes(n)?W(X(n),"The value is not part of the allowed options."):{...a,isMissingValue:null===n,copyData:n||"",data:{...a.data,value:n}}},getCellValue(e){var n,i,o,a,l,r,s;return(0,h.le)(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!==(a=U(null===(l=e.data)||void 0===l?void 0:l.value))&&void 0!==a?a:null:"boolean"===t?null!==(r=G(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==r?r:null:null===(o=e.data)||void 0===o?void 0:o.value}}}we.isEditableType=!0;const xe=we;function Ce(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.le)(e)?[]:K(e);return{...t,data:n,isMissingValue:(0,h.le)(e),copyData:(0,h.le)(e)?"":X(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,h.le)(e.data)||P(e)?null:e.data}}Ce.isEditableType=!1;const Te=Ce;function ke(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Ee(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===ae.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Me(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,h.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===ae.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,h.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?ae.fu.getTypeName(e.arrowType):null;let a;if("object"===e.kind)a=e.getCell((0,h.bb)(t.content)?ie(ae.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,h.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var l;let n;var r,s;if("time"===i&&(0,h.bb)(null===(l=t.field)||void 0===l||null===(l=l.type)||void 0===l?void 0:l.unit))n=F().unix(ae.fu.convertToSeconds(t.content,null!==(r=null===(s=t.field)||void 0===s||null===(s=s.type)||void 0===s?void 0:s.unit)&&void 0!==r?r:0)).utc().toDate();else n=F().utc(Number(t.content)).toDate();a=e.getCell(n)}else if("decimal"===i){const n=(0,h.le)(t.content)?null:ae.fu.format(t.content,t.contentType,t.field);a=e.getCell(n)}else a=e.getCell(t.content);if(B(a))return a;if(!e.isEditable){if((0,h.bb)(t.displayContent)){var d,c;const e=ie(t.displayContent);a.kind===o.p6.Text||a.kind===o.p6.Number?a={...a,displayData:e}:a.kind===o.p6.Custom&&"date-picker-cell"===(null===(d=a.data)||void 0===d?void 0:d.kind)?a={...a,data:{...a.data,displayDate:e}}:a.kind===o.p6.Custom&&"link-cell"===(null===(c=a.data)||void 0===c?void 0:c.kind)&&(a={...a,data:{...a.data,displayText:e}})}n&&t.cssId&&(a=function(e,t,n){const i={},o=ke(t,"color",n);o&&(i.textDark=o);const a=ke(t,"background-color",n);return a&&(i.bgCell=a),"yellow"===a&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(a,t.cssId,n))}return a}function Re(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}if(!(0,h.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(r){i=void 0}const a={kind:o.p6.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"link-cell",href:"",displayText:""},copyData:""},l=i=>{if((0,h.le)(i))return!e.isRequired;const o=X(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:l,getCell(e,o){if((0,h.le)(e))return{...a,data:{...a.data,href:null},isMissingValue:!0};const s=e;if("string"===typeof n)return W(X(s),n);if(o){if(!1===l(s))return W(X(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,h.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?n[1]:t}catch(r){return t}}(i,s):t.display_text||s),{...a,data:{kind:"link-cell",href:s,displayText:d},copyData:s,cursor:"pointer",isMissingValue:(0,h.le)(s)}},getCellValue(e){var t;return(0,h.le)(null===(t=e.data)||void 0===t?void 0:t.href)?null:e.data.href}}}Re.isEditableType=!0;const Se=Re;function _e(e){const t={kind:o.p6.Image,data:[],displayData:[],allowAdd:!1,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.bb)(e)?[X(e)]:[];return{...t,data:n,isMissingValue:!(0,h.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}_e.isEditableType=!1;const Oe=_e;function Ie(e){const t=be(ae.fu.getTypeName(e.arrowType)),n=J({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=Q(n.max_value,n.format)}catch(r){i=X(n.max_value)}const a=(0,h.le)(n.step)||Number.isNaN(n.step)?void 0:te(n.step),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,h.le)(e))return Y();if((0,h.le)(n.min_value)||(0,h.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return W("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,h.le)(n.step)||Number.isNaN(n.step))return W("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=U(e);if(Number.isNaN(t)||(0,h.le)(t))return W(X(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=Q(t,n.format,a)}catch(r){return W(X(t),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(r):"Failed to format the number. Error: ".concat(r))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...l,isMissingValue:(0,h.le)(e),copyData:String(t),data:{...l.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.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}}}Ie.isEditableType=!1;const De=Ie;function He(e,t,n){const i=J({y_min:0,y_max:1},t.columnTypeOptions),a={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,h.le)(i.y_min)||(0,h.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return W("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,h.le)(e))return Y();const t=K(e),o=[];let l=[];if(0===t.length)return Y();let r=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;for(let n=0;n<t.length;n++){const e=U(t[n]);if(Number.isNaN(e)||(0,h.le)(e))return W(X(t),"The value cannot be interpreted as a numeric array. ".concat(X(e)," is not a number."));e>r&&(r=e),e<s&&(s=e),o.push(e)}return"line"===n&&o.length<=2?Y():(l=o.length>0&&(r>i.y_max||s<i.y_min)?o.map((e=>r-s===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-s)/(r-s))+(i.y_min||0))):o,{...a,copyData:o.join(","),data:{...a.data,values:l,displayValues:o.map((e=>Q(e)))},isMissingValue:(0,h.le)(e)})},getCellValue(e){var t,n;return e.kind===o.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 Ae(e){return He("line_chart",e,"line")}function ze(e){return He("bar_chart",e,"bar")}Ae.isEditableType=!1,ze.isEditableType=!1;const Ve=(0,T.Z)("div",{target:"ex7xuzc0"})({name:"iatp2c",styles:"display:flex;flex-grow:1;align-items:center;min-height:21px;.gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important;padding-bottom:3px;}"}),Fe=e=>{const{uri:t,onChange:n,readonly:i,validatedSelection:a,preview:l}=e;return i?(0,N.jsx)(Ve,{children:(0,N.jsx)("a",{"data-testid":"stLinkCell",className:"gdg-link-area",href:null!==t&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer",children:l})}):(0,N.jsx)(o.t5,{validatedSelection:a,highlight:!0,autoFocus:!0,value:null!==t&&void 0!==t?t:"",onChange:n})};const je={draw:(e,t)=>{const{ctx:n,rect:i,theme:a,hoverX:l=-100}=e,{href:r,displayText:s}=t.data;if((0,h.le)(r))return;const d=s||r,c=a.cellHorizontalPadding,u=i.x+c,m=i.x+l,g="".concat(a.baseFontStyle," ").concat(a.fontFamily);n.font=g;const p=(0,o.aX)(n,g),f=i.y+i.height/2+p;if(m>i.x&&m<i.x+i.width){const e=(0,o.P7)(d,n,g);n.moveTo(u,Math.floor(f+5)+.5),n.lineTo(u+e.width,Math.floor(f+5)+.5),n.strokeStyle=a.linkColor,n.stroke()}return n.fillStyle=a.linkColor,n.fillText(d,u,f),n.closePath(),!0},isMatch:e=>"link-cell"===e.data.kind,kind:o.p6.Custom,measure:(e,t,n)=>{const{href:i,displayText:o}=t.data;return(0,h.le)(i)?0:e.measureText(o||i).width+2*n.cellHorizontalPadding},needsHover:!0,needsHoverPosition:!0,onSelect:e=>{const t=function(e){var t;const n=document.createElement("canvas").getContext("2d",{alpha:!1});if(null===n)return;const{posX:i,bounds:o,cell:a,theme:l}=e,r="".concat(l.baseFontStyle," ").concat(l.fontFamily);n.font=r;const{href:s,displayText:d}=a.data,c=o.x+i,u=n.measureText(null!==(t=d||s)&&void 0!==t?t:"").width,m=o.x+l.cellHorizontalPadding;return c>m&&c<m+u?s:void 0}(e);(0,h.le)(t)||window.open(t,"_blank","noopener,noreferrer")},onDelete:e=>({...e,data:{...e.data,displayText:"",href:""}}),provideEditor:()=>e=>{var t;const{onChange:n,value:i,validatedSelection:o}=e,{href:a,displayText:l}=i.data;return(0,N.jsx)(Fe,{uri:i.data.href,preview:null!==(t=l||a)&&void 0!==t?t:"",validatedSelection:o,readonly:!0===i.readonly,onChange:e=>n({...i,copyData:e.target.value,data:{...i.data,href:e.target.value}})})},onPaste:(e,t)=>e===t.href?void 0:{...t,href:e}},Le=new Map(Object.entries({object:re,text:de,checkbox:fe,selectbox:xe,list:Te,number:ye,link:Se,datetime:me,date:ge,time:he,line_chart:Ae,bar_chart:ze,image:Oe,progress:De})),We=[je],Be="_index",Pe="_pos:",Ye={small:75,medium:200,large:400};function Ze(e){if(!(0,h.le)(e))return"number"===typeof e?e:e in Ye?Ye[e]:void 0}function qe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Be?n=t.get(e.name):t.has("".concat(Pe).concat(e.indexNumber))?n=t.get("".concat(Pe).concat(e.indexNumber)):e.isIndex&&t.has(Be)&&(n=t.get(Be)),n?D()({...e},{title:n.label,width:Ze(n.width),isEditable:(0,h.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Je(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,h.bb)(n)&&(Le.has(n)?i=Le.get(n):(0,oe.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,h.le)(i)&&(i=function(e){let t=e?ae.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?de:["datetime","datetimetz"].includes(t)?me:"time"===t?he:"date"===t?ge:["object","bytes"].includes(t)?re:["bool"].includes(t)?fe:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?ye:"categorical"===t?xe:t.startsWith("list")?Te:re):re}(e.arrowType)),i}const Ke=function(e,t,n){const o=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,oe.H)(t),new Map}}(e.columns)),[e.columns]),a=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let a=0;a<i;a++){const n={...Ee(e,a),indexNumber:a};t.push(n)}for(let a=0;a<o;a++){const n={...Me(e,a),indexNumber:a+i};t.push(n)}return t}(t).map((t=>{let i={...t,...qe(t,o),isStretched:a};const l=Je(i);return(e.editingMode===m.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==m.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===m.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),l(i)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[re({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,o,a,n,e.editingMode,e.columnOrder])}};function Xe(e){return e.isIndex?Be:(0,h.le)(e.name)?"":e.name}const Ge=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const a={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(a[Xe(o)]=o.getCellValue(e))})),n.edited_rows[i]=a})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,a)=>{const l=t.get(n);if(l){const t=l.getCellValue(e);l.isRequired&&l.isEditable&&P(e)&&(o=!0),(0,h.bb)(t)&&(i[Xe(l)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Xe(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],a=o.get(e);if(a){const e=a.getCell(n);var l;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(l=this.editedCells.get(t))||void 0===l||l.set(a.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const t=new Map;Object.keys(e).forEach((n=>{const i=e[n],a=o.get(n);if(a){const e=a.getCell(i);e&&t.set(a.indexNumber,e)}})),this.addedRows.push(t)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(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)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,h.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(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Ue=n(59990);const Qe=function(){const e=(0,g.u)(),t=i.useMemo((()=>({editable:e=>'<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,Ue.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Ue.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,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,Ue.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.lg,headerIcons:t}};const $e=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[a,l]=i;if(a>t.length-1)return W("Column index out of bounds.","This should never happen. Please report this bug.");if(l>n-1)return W("Row index out of bounds.","This should never happen. Please report this bug.");const r=t[a],s=r.indexNumber,d=o.current.getOriginalRowIndex(l);if(r.isEditable||o.current.isAddedRow(d)){const e=o.current.getCell(s,d);if(void 0!==e)return e}try{return Ne(r,e.getCell(d+1,s),e.cssStyles)}catch(c){return(0,oe.H)(c),W("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(c))}}),[t,n,e,o])}};var et=n(33256);const tt=function(e,t,n){const[o,a]=i.useState(),{getCellContent:l,getOriginalIndex:r}=(0,et.fF)({columns:t.map((e=>q(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void a(void 0);t="desc"}a({column:q(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:r,getCellContent:l}};var nt=n(95599);const it=",",ot='"',at='"',lt="\n";function rt(e){return e.map((e=>function(e){if((0,h.le)(e))return"";const t=X(e);if(new RegExp("[".concat([it,ot,lt].join(""),"]")).test(t))return"".concat(ot).concat(t.replace(new RegExp(ot,"g"),at+ot)).concat(ot);return t}(e))).join(it)+lt}const st=function(e,t,n){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),o="".concat(i,"_export.csv"),a=await(0,nt.Kr)({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),l=new TextEncoder,r=await a.createWritable();await r.write(l.encode("\ufeff"));const s=t.map((e=>e.name));await r.write(l.encode(rt(s)));for(let d=0;d<n;d++){const n=[];t.forEach(((t,i,o)=>{n.push(t.getCellValue(e([i,d])))})),await r.write(l.encode(rt(n)))}await r.close()}),[t,n,e])}};const dt=function(e,t,n,o,a,l,r){const s=i.useCallback(((t,i)=>{let[l,s]=t;const d=e[l];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(a(s)),m=o([l,s]),h=d.getCellValue(m),g=d.getCellValue(i);if(!B(m)&&g===h)return;const p=d.getCell(g,!0);B(p)?(0,oe.KE)("Not applying the cell edit since it causes this error:\n ".concat(p.data)):(n.current.setCell(c,u,{...p,lastUpdated:performance.now()}),r())}),[e,n,a,o,r]),d=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i)}),[e,n,t]),c=i.useCallback((()=>{t||(d(),r())}),[d,r,t]),u=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(a(e))));return n.current.deleteRows(e),r(!0),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),s([o,i],n.getCell(null)))}return t.length>0&&(r(),l(t)),!1}return!0}),[e,n,t,l,a,r,s]),m=i.useCallback(((i,s)=>{const[c,u]=i,m=[];for(let g=0;g<s.length;g++){const i=s[g];if(g+u>=n.current.getNumRows()){if(t)break;d()}for(let t=0;t<i.length;t++){const l=i[t],r=g+u,s=t+c;if(s>=e.length)break;const d=e[s];if(d.isEditable){const e=d.getCell(l,!0);if((0,h.bb)(e)&&!B(e)){const t=d.indexNumber,i=n.current.getOriginalRowIndex(a(r)),l=d.getCellValue(o([s,r]));d.getCellValue(e)!==l&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,r]}))}}}m.length>0&&(r(),l(m))}return!1}),[e,n,t,a,o,d,r,l]),g=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:s,onPaste:m,onRowAppended:c,onDelete:u,validateCell:g}};const ct=function(e,t){const[n,o]=i.useState(),a=i.useRef(null),l=i.useCallback((n=>{if(clearTimeout(a.current),a.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],l=n.location[1];let r;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,h.bb)(s))r=s.help;else if("cell"===n.kind){const e=t([i,l]);s.isRequired&&s.isEditable&&P(e)?r="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(r=e.tooltip)}r&&(a.current=setTimeout((()=>{r&&o({content:r,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,a]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:l}};var ut=n(8751);const mt=function(e,t){return{drawCell:i.useCallback((n=>{const{cell:i,theme:a,ctx:l,rect:r}=n,s=t?n.col-1:n.col;if(P(i)&&s<e.length){let t=!1;const i=e[s];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)||((e=>{const{cell:t,theme:n}=e;(0,o.uN)({...e,theme:{...n,textDark:n.textLight,textMedium:n.textLight},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign)})(n),t=!0),i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,a),t}return!1}),[e,t]),customRenderers:[...(0,ut.Bn)().customRenderers,...We]}};const ht=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,a)=>{e.id&&n(new Map(t).set(e.id,a))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},gt=35,pt=2*gt+3;const ft=function(e,t,n,o,a){let l,r=function(e){return Math.max(e*gt+1+2,pt)}(t+1+(e.editingMode===m.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(r,400);e.height&&(s=Math.max(e.height,pt),r=Math.max(e.height,r)),o&&(s=Math.min(s,o),r=Math.min(r,o),e.height||(s=r));let d=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:l||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:l||"100%",height:c.height})}),[l]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(a){const t=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:r})}else u({width:l||"100%",height:s})}),[a]),{minHeight:pt,maxHeight:r,minWidth:52,maxWidth:d,resizableSize:c,setResizableSize:u}},bt=(0,T.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),vt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(bt,{src:n})}):(0,N.jsx)(bt,{src:n})};var yt=n(98399),wt=n(73830),xt=n(37661);const Ct=function(e){let{top:t,left:n,content:o,clearTooltip:a}=e;const[l,r]=i.useState(!0),s=(0,g.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{r(!1),a()}),[a,r]);return(0,N.jsx)(yt.Z,{content:(0,N.jsx)(xt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(b.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:wt.r4.top,accessibilityType:wt.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,k.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:l,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Tt=(0,T.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.lg},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(27235),n(33091);const kt=(0,u.Z)((function(e){let{element:t,data:n,width:u,height:g,disabled:p,widgetMgr:f,isFullScreen:b,expand:v,collapse:y}=e;const w=i.useRef(null),x=i.useRef(null),C=i.useRef(null),T=Qe(),[k,E]=i.useState(!0),[M,_]=i.useState(!1),[O,I]=i.useState(!1),[D,H]=i.useState(!1),A=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]),[V,F]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),j=i.useCallback((()=>{F({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0})}),[]),L=i.useCallback((()=>{F({columns:V.columns,rows:V.rows,current:void 0})}),[V]),W=i.useCallback((e=>{var t;null===(t=x.current)||void 0===t||t.updateCells(e)}),[]);(0,h.le)(t.editingMode)&&(t.editingMode=m.Eh.EditingMode.READ_ONLY);const{READ_ONLY:B,DYNAMIC:P}=m.Eh.EditingMode,Y=n.dimensions,J=Math.max(0,Y.rows-1),K=0===J&&!(t.editingMode===P&&Y.dataColumns>0),X=J>15e4,G=i.useRef(new Ge(J)),[U,Q]=i.useState(G.current.getNumRows());i.useEffect((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]);const $=i.useCallback((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]),{columns:ee}=Ke(t,n,p);i.useEffect((()=>{if(t.editingMode!==B){const e=f.getStringValue(t);e&&(G.current.fromJson(e,ee),Q(G.current.getNumRows()))}}),[]);const{getCellContent:te}=$e(n,ee,U,G),{columns:ne,sortColumn:ie,getOriginalIndex:oe,getCellContent:ae}=tt(J,ee,te),le=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];U!==G.current.getNumRows()&&Q(G.current.getNumRows()),e&&j(),(0,h.Ds)(100,(()=>{const e=G.current.toJson(ne);let i=f.getStringValue(t);void 0===i&&(i=new Ge(0).toJson([])),e!==i&&f.setStringValue(t,e,{fromUi:n})}))()}),[f,t,U,j,ne]),{exportToCsv:re}=st(ae,ne,U),{onCellEdited:se,onPaste:de,onRowAppended:ce,onDelete:ue,validateCell:me}=dt(ne,t.editingMode!==P,G,ae,oe,W,le),{tooltip:he,clearTooltip:ge,onItemHovered:pe}=ct(ne,ae),{drawCell:fe,customRenderers:be}=mt(ne,t.editingMode===P),{columns:ve,onColumnResize:ye}=ht(ne.map((e=>q(e)))),{minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,resizableSize:ke,setResizableSize:Ee}=ft(t,U,u,g,b),Me=i.useCallback((e=>{let[t,n]=e;return{...Z(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(ne.length-1,0)]}}),[ne,T.textLight]);i.useEffect((()=>{const e=new c.K;return e.manageFormClearListener(f,t.formId,$),()=>{e.disconnect()}}),[t.formId,$,f]);const Ne=!K&&t.editingMode===P&&!p,Re=V.rows.length>0,Se=void 0!==V.current,_e=K?0:ne.filter((e=>e.isIndex)).length;return i.useEffect((()=>{if(C.current){var e;const t=null===(e=C.current)||void 0===e||null===(e=e.querySelector(".dvn-stack"))||void 0===e?void 0:e.getBoundingClientRect();t&&(I(t.height>C.current.clientHeight),H(t.width>C.current.clientWidth))}}),[ke,U,ve]),(0,N.jsxs)(Tt,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:z,ref:C,onMouseDown:e=>{if(C.current&&z){const t=C.current.getBoundingClientRect();D&&t.height-7<e.clientY-t.top&&e.stopPropagation(),O&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{k||A||e.currentTarget.contains(e.relatedTarget)||L()},children:[(0,N.jsxs)(S,{isFullScreen:b,locked:Re||Se||A&&k,onExpand:v,onCollapse:y,target:Tt,children:[Ne&&Re&&(0,N.jsx)(R,{label:"Delete row(s)",icon:l.H,onClick:()=>{ue&&(ue(V),ge())}}),Ne&&!Re&&(0,N.jsx)(R,{label:"Add row",icon:r.m,onClick:()=>{ce&&(E(!0),ce(),ge())}}),!X&&!K&&(0,N.jsx)(R,{label:"Download as CSV",icon:s.k,onClick:()=>re()}),!K&&(0,N.jsx)(R,{label:"Search",icon:d.o,onClick:()=>{M?_(!1):(E(!0),_(!0)),ge()}})]}),(0,N.jsx)(a.e,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:ke,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(T.tableBorderRadius)},minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,size:ke,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gt],snapGap:gt/3,onResizeStop:(e,t,n,i)=>{w.current&&Ee({width:w.current.size.width,height:xe-w.current.size.height===3?w.current.size.height+3:w.current.size.height})},children:(0,N.jsx)(o.Nd,{className:"glideDataEditor",ref:x,columns:ve,rows:K?1:U,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:gt,headerHeight:gt,getCellContent:K?Me:ae,onColumnResize:ye,freezeColumns:_e,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:e=>!(e>=ne.length&&(t.useContainerWidth||"100%"===ke.width)),getCellsForSelection:!0,rowMarkers:"none",rangeSelect:A?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:pe,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(_((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:M,onSearchClose:()=>{_(!1),ge()},onHeaderClicked:K||X?void 0:ie,gridSelection:V,onGridSelectionChange:e=>{(k||A)&&(F(e),void 0!==he&&ge())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&k?E(!1):"out-of-bounds"===e.kind||k||E(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1,...z&&{paddingBottom:D?-6:void 0,paddingRight:O?-6:void 0}},drawCell:fe,customRenderers:be,imageEditorOverride:vt,headerIcons:T.headerIcons,validateCell:me,onPaste:!1,...!K&&t.editingMode!==B&&!p&&{fillHandle:!A,onCellEdited:se,onPaste:de,onDelete:ue},...!K&&t.editingMode===P&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"multi",rowSelect:p?"none":"multi",onRowAppended:p?void 0:ce,onHeaderClicked:void 0}})}),he&&he.content&&(0,N.jsx)(Ct,{top:he.top,left:he.left,content:he.content,clearTooltip:ge})]})}),!0)},52955:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|