@stlite/desktop 0.66.0 → 0.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +41 -38
  3. package/build/index.html +1 -1
  4. package/build/static/js/1001.b6744dec.chunk.js +1 -0
  5. package/build/static/js/1046.52decb2e.chunk.js +1 -0
  6. package/build/static/js/1189.ab8bacef.chunk.js +1 -0
  7. package/build/static/js/{1261.15eb6eb4.chunk.js → 1261.b566da4d.chunk.js} +1 -1
  8. package/build/static/js/{144.ab9b4469.chunk.js → 144.9ec5bd27.chunk.js} +1 -1
  9. package/build/static/js/1740.23a03bbe.chunk.js +1 -0
  10. package/build/static/js/241.e65eeb7b.chunk.js +1 -0
  11. package/build/static/js/2448.285a20d7.chunk.js +1 -0
  12. package/build/static/js/{2450.d2094d4f.chunk.js → 2450.3fbfa728.chunk.js} +1 -1
  13. package/build/static/js/2664.fcbdd10d.chunk.js +1 -0
  14. package/build/static/js/{2873.3a5dcb34.chunk.js → 2873.b29b2eeb.chunk.js} +1 -1
  15. package/build/static/js/2940.4e6caf5c.chunk.js +1 -0
  16. package/build/static/js/3849.3df70f1e.chunk.js +2 -0
  17. package/build/static/js/4482.a589131e.chunk.js +17 -0
  18. package/build/static/js/{4494.23456267.chunk.js → 4494.6e8d3b6e.chunk.js} +1 -1
  19. package/build/static/js/4724.917b0590.chunk.js +5 -0
  20. package/build/static/js/{4785.4ad0def4.chunk.js → 4785.98dbde84.chunk.js} +1 -1
  21. package/build/static/js/4831.0fbd4ca7.chunk.js +5 -0
  22. package/build/static/js/5299.b77de2fc.chunk.js +9 -0
  23. package/build/static/js/{6134.c33ca2c8.chunk.js → 6134.bdbf7672.chunk.js} +1 -1
  24. package/build/static/js/6463.cd216036.chunk.js +2 -0
  25. package/build/static/js/6463.cd216036.chunk.js.LICENSE.txt +1 -0
  26. package/build/static/js/6944.444c0fa6.chunk.js +1 -0
  27. package/build/static/js/{698.13ad7058.chunk.js → 698.0dd9747b.chunk.js} +1 -1
  28. package/build/static/js/7463.04979eb1.chunk.js +1 -0
  29. package/build/static/js/7579.b7954b39.chunk.js +1 -0
  30. package/build/static/js/7696.05d95d4d.chunk.js +1 -0
  31. package/build/static/js/7809.e90cb7d7.chunk.js +1 -0
  32. package/build/static/js/7866.47855e8c.chunk.js +2 -0
  33. package/build/static/js/8186.e2b282ee.chunk.js +2 -0
  34. package/build/static/js/8801.534f3181.chunk.js +1 -0
  35. package/build/static/js/8853.35db34e3.chunk.js +5 -0
  36. package/build/static/js/9005.980d0bb3.chunk.js +5 -0
  37. package/build/static/js/973.df151fda.chunk.js +1 -0
  38. package/build/static/js/9813.a08c138f.chunk.js +1 -0
  39. package/build/static/js/9846.9ae3ba57.chunk.js +1 -0
  40. package/build/static/js/main.099ed3b9.js +28 -0
  41. package/package.json +5 -5
  42. package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
  43. package/wheels/streamlit-1.39.0-cp312-none-any.whl +0 -0
  44. package/build/static/js/1046.b35a30bb.chunk.js +0 -1
  45. package/build/static/js/1122.826a4d4a.chunk.js +0 -1
  46. package/build/static/js/1189.cfab8e1b.chunk.js +0 -1
  47. package/build/static/js/1740.94292e1e.chunk.js +0 -1
  48. package/build/static/js/188.76c35a12.chunk.js +0 -1
  49. package/build/static/js/2448.7421fffc.chunk.js +0 -1
  50. package/build/static/js/2664.826d28ff.chunk.js +0 -1
  51. package/build/static/js/2940.febd403d.chunk.js +0 -1
  52. package/build/static/js/4482.83141a76.chunk.js +0 -17
  53. package/build/static/js/4724.bece40dd.chunk.js +0 -5
  54. package/build/static/js/4831.c90232de.chunk.js +0 -5
  55. package/build/static/js/5299.e46d6a7b.chunk.js +0 -9
  56. package/build/static/js/6463.d6201add.chunk.js +0 -2
  57. package/build/static/js/6463.d6201add.chunk.js.LICENSE.txt +0 -1
  58. package/build/static/js/6944.41de199c.chunk.js +0 -1
  59. package/build/static/js/7579.7586a966.chunk.js +0 -1
  60. package/build/static/js/7696.d4742d64.chunk.js +0 -1
  61. package/build/static/js/8097.f846eb83.chunk.js +0 -2
  62. package/build/static/js/8186.711bca96.chunk.js +0 -2
  63. package/build/static/js/8801.f029b6c3.chunk.js +0 -1
  64. package/build/static/js/8853.2cc975d3.chunk.js +0 -5
  65. package/build/static/js/9005.b52b87da.chunk.js +0 -5
  66. package/build/static/js/9813.a3f195fe.chunk.js +0 -1
  67. package/build/static/js/9846.309b75be.chunk.js +0 -1
  68. package/build/static/js/989.d6cd1f50.chunk.js +0 -2
  69. package/build/static/js/main.eec824c7.js +0 -28
  70. package/wheels/streamlit-1.38.0-cp312-none-any.whl +0 -0
  71. /package/build/static/css/{188.da3ff442.chunk.css → 7463.da3ff442.chunk.css} +0 -0
  72. /package/build/static/css/{989.1edfa457.chunk.css → 7866.1edfa457.chunk.css} +0 -0
  73. /package/build/static/js/{8097.f846eb83.chunk.js.LICENSE.txt → 3849.3df70f1e.chunk.js.LICENSE.txt} +0 -0
  74. /package/build/static/js/{989.d6cd1f50.chunk.js.LICENSE.txt → 7866.47855e8c.chunk.js.LICENSE.txt} +0 -0
  75. /package/build/static/js/{8186.711bca96.chunk.js.LICENSE.txt → 8186.e2b282ee.chunk.js.LICENSE.txt} +0 -0
  76. /package/build/static/js/{main.eec824c7.js.LICENSE.txt → main.099ed3b9.js.LICENSE.txt} +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4482],{48689:(t,e,n)=>{n.d(e,{K:()=>s});var a=n(5057),r=n(53627);const i=a.createContext(null);var o=n(96266);const s=t=>{var e;let{children:n}=t;const s=null===(e=(0,a.useContext)(i))||void 0===e?void 0:e();return s?(0,r.createPortal)(n,s):(0,o.jsx)(o.Fragment,{children:n})}},49441:(t,e,n)=>{n.d(e,{Z:()=>l});var a=n(5057),r=n(66904),i=n.n(r);const o=(0,n(82160).Z)("div",{target:"ecnfqzf0"})((()=>({"@media print":{display:"none"}})),"");var s=n(96266);const c=t=>{let{className:e,scriptRunId:n,numParticles:a,numParticleTypes:r,ParticleComponent:c}=t;return(0,s.jsx)(o,{className:e,"data-testid":e,children:i()(a).map((t=>{const e=Math.floor(Math.random()*r);return(0,s.jsx)(c,{particleType:e},n+t)}))})},l=(0,a.memo)(c)},48833:(t,e,n)=>{n.r(e),n.d(e,{NUM_FLAKES:()=>f,default:()=>k});var a=n(5057);const r=n.p+"static/media/flake-0.beded754e8024c73d9d2.png",i=n.p+"static/media/flake-1.8077dc154e0bf900aa73.png",o=n.p+"static/media/flake-2.e3f07d06933dd0e84c24.png";var s=n(49441),c=n(48689),l=n(82160),d=n(21371);const m=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.random()*(t-e)+e},p=(0,l.Z)("img",{target:"ekdfb790"})((t=>{let{theme:e}=t;return{position:"fixed",top:"-150px",marginLeft:"-75px",zIndex:e.zIndices.balloons,left:`${m(90,10)}vw`,animationDelay:`${m(4e3)}ms`,height:"150px",width:"150px",pointerEvents:"none",animationDuration:"3000ms",animationName:d.F4`
2
+ from {
3
+ transform:
4
+ translateY(0)
5
+ rotateX(${m(360)}deg)
6
+ rotateY(${m(360)}deg)
7
+ rotateZ(${m(360)}deg);
8
+ }
9
+
10
+ to {
11
+ transform:
12
+ translateY(calc(100vh + ${150}px))
13
+ rotateX(0)
14
+ rotateY(0)
15
+ rotateZ(0);
16
+ }
17
+ `,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var u=n(96266);const f=100,h=[r,i,o],g=h.length,v=t=>{let{particleType:e}=t;return(0,u.jsx)(p,{src:h[e]})},x=function(t){let{scriptRunId:e}=t;return(0,u.jsx)(c.K,{children:(0,u.jsx)(s.Z,{className:"stSnow","data-testid":"stSnow",scriptRunId:e,numParticleTypes:g,numParticles:f,ParticleComponent:v})})},k=(0,a.memo)(x)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4494],{44494:(e,t,s)=>{s.r(t),s.d(t,{default:()=>C});var i=s(5057),r=s(88084),o=s.n(r),a=s(47206),n=s(80865),l=s(9191),d=s(73830),m=s(52955),p=s(38944),h=s(93905),u=s(21034),c=s(98790),g=s(50120),f=s(96266);const b="YYYY/MM/DD";function v(e){return e.map((e=>new Date(e)))}class y extends i.PureComponent{constructor(){super(...arguments),this.formClearHelper=new m.K,this.state={values:this.initialValue,isRange:this.props.element.isRange,isEmpty:!1},this.commitWidgetValue=e=>{const{widgetMgr:t,element:s,fragmentId:i}=this.props;var r;t.setStringArrayValue(s,(r=this.state.values)?r.map((e=>o()(e).format(b))):[],e,i)},this.onFormCleared=()=>{const e=v(this.props.element.default);this.setState({values:e,isEmpty:!e},(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{date:t}=e;if(null===t||void 0===t)return void this.setState({values:[],isEmpty:!0});const s=[];Array.isArray(t)?t.forEach((e=>{e&&s.push(e)})):s.push(t),this.setState({values:s,isEmpty:!s},(()=>{this.state.isEmpty||this.commitWidgetValue({fromUi:!0})}))},this.handleClose=()=>{const{isEmpty:e}=this.state;e&&this.setState(((e,t)=>({values:v(t.element.default),isEmpty:!v(t.element.default)})),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.getMaxDate=()=>{const{element:e}=this.props,t=e.max;return t&&t.length>0?o()(t,b).toDate():void 0}}get initialValue(){const e=this.props.widgetMgr.getStringArrayValue(this.props.element);return v(void 0!==e?e:this.props.element.default||[])}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1;const t=e.map((e=>new Date(e)));this.setState({values:t,isEmpty:!t},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{width:t,element:s,disabled:i,theme:r,widgetMgr:a}=this.props,{values:m,isRange:v}=this.state,{colors:y,fontSizes:C,lineHeights:W,spacing:D}=r,F={width:t},k=o()(s.min,b).toDate(),x=this.getMaxDate(),I=0===s.default.length&&!i,V=s.format.replaceAll(/[a-zA-Z]/g,"9"),S=s.format.replaceAll("Y","y").replaceAll("D","d");return this.formClearHelper.manageFormClearListener(a,s.formId,this.onFormCleared),(0,f.jsxs)("div",{className:"stDateInput","data-testid":"stDateInput",style:F,children:[(0,f.jsx)(p.O,{label:s.label,disabled:i,labelVisibility:(0,g.iF)(null===(e=s.labelVisibility)||void 0===e?void 0:e.value),children:s.help&&(0,f.jsx)(h.dT,{children:(0,f.jsx)(u.Z,{content:s.help,placement:c.u.TOP_RIGHT})})}),(0,f.jsx)(n.Z,{density:l.pw.high,formatString:S,mask:v?`${V} \u2013 ${V}`:V,placeholder:v?`${s.format} \u2013 ${s.format}`:s.format,disabled:i,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:d.r4.bottomLeft,overrides:{Body:{style:{border:`${r.sizes.borderWidth} solid ${y.borderColor}`}}}}},CalendarContainer:{style:{fontSize:C.sm,paddingRight:r.spacing.sm,paddingLeft:r.spacing.sm,paddingBottom:r.spacing.sm,paddingTop:r.spacing.sm}},Week:{style:{fontSize:C.sm}},Day:{style:e=>{let{$pseudoHighlighted:t,$pseudoSelected:s,$selected:i,$isHovered:r}=e;return{fontSize:C.sm,lineHeight:W.base,"::before":{backgroundColor:i||s||t||r?`${y.secondaryBg} !important`:y.transparent},"::after":{borderColor:y.transparent}}}},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.darkGray,transform:"scale(1.41)",width:r.spacing.twoXL,marginRight:"-8px",":hover":{fill:r.colors.bodyText}}}}}},Input:{style:{paddingRight:D.sm,paddingLeft:D.sm,paddingBottom:D.sm,paddingTop:D.sm,lineHeight:W.inputWidget},props:{"data-testid":"stDateInputField"}}}}}},value:m,minDate:k,maxDate:x,range:v,clearable:I})]})}}const C=(0,a.b)(y)},52955:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),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
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4494],{44494:(e,t,s)=>{s.r(t),s.d(t,{default:()=>C});var i=s(5057),r=s(88084),o=s.n(r),a=s(47206),n=s(80865),l=s(9191),d=s(73830),m=s(52955),p=s(38944),h=s(93905),u=s(21034),c=s(98790),g=s(50120),f=s(96266);const b="YYYY/MM/DD";function v(e){return e.map((e=>new Date(e)))}class y extends i.PureComponent{constructor(){super(...arguments),this.formClearHelper=new m.K,this.state={values:this.initialValue,isRange:this.props.element.isRange,isEmpty:!1},this.commitWidgetValue=e=>{const{widgetMgr:t,element:s,fragmentId:i}=this.props;var r;t.setStringArrayValue(s,(r=this.state.values)?r.map((e=>o()(e).format(b))):[],e,i)},this.onFormCleared=()=>{const e=v(this.props.element.default);this.setState({values:e,isEmpty:!e},(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{date:t}=e;if(null===t||void 0===t)return void this.setState({values:[],isEmpty:!0});const s=[];Array.isArray(t)?t.forEach((e=>{e&&s.push(e)})):s.push(t),this.setState({values:s,isEmpty:!s},(()=>{this.state.isEmpty||this.commitWidgetValue({fromUi:!0})}))},this.handleClose=()=>{const{isEmpty:e}=this.state;e&&this.setState(((e,t)=>({values:v(t.element.default),isEmpty:!v(t.element.default)})),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.getMaxDate=()=>{const{element:e}=this.props,t=e.max;return t&&t.length>0?o()(t,b).toDate():void 0}}get initialValue(){const e=this.props.widgetMgr.getStringArrayValue(this.props.element);return v(void 0!==e?e:this.props.element.default||[])}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1;const t=e.map((e=>new Date(e)));this.setState({values:t,isEmpty:!t},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{width:t,element:s,disabled:i,theme:r,widgetMgr:a}=this.props,{values:m,isRange:v}=this.state,{colors:y,fontSizes:C,lineHeights:W,spacing:F}=r,D={width:t},I=o()(s.min,b).toDate(),k=this.getMaxDate(),x=0===s.default.length&&!i,M=s.format.replaceAll(/[a-zA-Z]/g,"9"),V=s.format.replaceAll("Y","y").replaceAll("D","d");return this.formClearHelper.manageFormClearListener(a,s.formId,this.onFormCleared),(0,f.jsxs)("div",{className:"stDateInput","data-testid":"stDateInput",style:D,children:[(0,f.jsx)(p.O,{label:s.label,disabled:i,labelVisibility:(0,g.iF)(null===(e=s.labelVisibility)||void 0===e?void 0:e.value),children:s.help&&(0,f.jsx)(h.dT,{children:(0,f.jsx)(u.Z,{content:s.help,placement:c.u.TOP_RIGHT})})}),(0,f.jsx)(n.Z,{density:l.pw.high,formatString:V,mask:v?`${M} \u2013 ${M}`:M,placeholder:v?`${s.format} \u2013 ${s.format}`:s.format,disabled:i,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:d.r4.bottomLeft,overrides:{Body:{style:{border:`${r.sizes.borderWidth} solid ${y.borderColor}`}}}}},CalendarContainer:{style:{fontSize:C.sm,paddingRight:r.spacing.sm,paddingLeft:r.spacing.sm,paddingBottom:r.spacing.sm,paddingTop:r.spacing.sm}},Week:{style:{fontSize:C.sm}},Day:{style:e=>{let{$pseudoHighlighted:t,$pseudoSelected:s,$selected:i,$isHovered:r}=e;return{fontSize:C.sm,lineHeight:W.base,"::before":{backgroundColor:i||s||t||r?`${y.secondaryBg} !important`:y.transparent},"::after":{borderColor:y.transparent}}}},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.darkGray,transform:"scale(1.41)",width:r.spacing.twoXL,marginRight:"-8px",":hover":{fill:r.colors.bodyText}}}}}},Input:{style:{paddingRight:F.sm,paddingLeft:F.sm,paddingBottom:F.sm,paddingTop:F.sm,lineHeight:W.inputWidget},props:{"data-testid":"stDateInputField"}}}}}},value:m,minDate:I,maxDate:k,range:v,clearable:x})]})}}const C=(0,a.b)(y)},52955:(e,t,s)=>{s.d(t,{K:()=>o,O:()=>a});var i=s(5057),r=s(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,r.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),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}}function a(e){let{element:t,widgetMgr:s,onFormCleared:o}=e;(0,i.useEffect)((()=>{if(!(0,r.bM)(t.formId))return;const e=s.addFormClearedListener(t.formId,o);return()=>{e.disconnect()}}),[t,s,o])}}}]);
@@ -0,0 +1,5 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4724],{94778:(e,t,r)=>{r.d(t,{Z:()=>c});r(5057);var n=r(50120),o=r(93905),i=r(82160);const a=r(21371).F4`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,s=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${a}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(96266);const c=e=>{let{dirty:t,value:r,inForm:i,maxLength:a,className:c,type:u="single",allowEnterToSubmit:d=!0}=e;const p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,l.jsx)(s,{includeDot:p.length>0,shouldBlink:t,children:e},p.length))};if(t&&d){const e=i?"submit form":"apply";if("multiline"===u){f(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===u&&f(`Press Enter to ${e}`)}return a&&("chat"!==u||t)&&f(`${r.length}/${a}`,t&&r.length>=a),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:c,children:p})}},44724:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n=r(5057),o=r(47206),i=r(7896),a=r(63947),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(76866),c=r(73401),u=r(94778),d=r(17966),p=r(82160);const f=(0,p.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.default,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:`${n}px`}}),""),h=(0,p.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"}}),""),y=(0,p.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.default,borderTopLeftRadius:n?t.radii.default:t.radii.none,borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),g=(0,p.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),b=(0,p.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var m=r(96266);const v=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const p=(0,o.u)(),[v,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),k=(0,n.useRef)({minHeight:0,maxHeight:0}),P=()=>{S.current&&S.current.focus(),w&&(i.setStringTriggerValue(r,w,{fromUi:!0},a),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;k.current.minHeight=e,k.current.maxHeight=6.5*e}}),[S]);const{disabled:R,placeholder:$,maxChars:E}=r,I=(0,d.Iy)(p),{minHeight:z,maxHeight:B}=k.current,T=I?p.colors.gray70:p.colors.gray80,H=!!(j>0&&S.current)&&Math.abs(j-z)>1;return(0,m.jsx)(f,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,m.jsxs)(h,{children:[(0,m.jsx)(l.Z,{inputRef:S,value:w,placeholder:$,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),P())},"aria-label":$,disabled:R,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",backgroundColor:p.colors.transparent,borderLeftWidth:p.sizes.borderWidth,borderRightWidth:p.sizes.borderWidth,borderTopWidth:p.sizes.borderWidth,borderBottomWidth:p.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:p.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,backgroundColor:p.colors.transparent,"::placeholder":{color:T},height:H?`${j+1}px`:"auto",maxHeight:B?`${B}px`:"none",paddingRight:"3rem",paddingLeft:p.spacing.sm,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm}}}}),t>p.breakpoints.hideWidgetDetails&&(0,m.jsx)(b,{children:(0,m.jsx)(u.Z,{dirty:v,value:w,maxLength:E,type:"chat",inForm:!1})}),(0,m.jsx)(g,{children:(0,m.jsx)(y,{onClick:P,disabled:!v||R,extended:H,"data-testid":"stChatInputSubmitButton",children:(0,m.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},76866:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(5057),o=r(80099),i=r(97135),a=r(18150),s=r(53381),l=r(4547);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const k=S}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4785],{94785:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var n=r(5057),u=r(82603),s=r(96266);function d(e){let{element:t,width:r,endpoints:d,elementMgr:i}=e;const a=(0,n.useRef)(null),{startTime:o,endTime:c,loop:l,autoplay:m}=t,f=(0,n.useMemo)((()=>{if(!t.id)return!0;const e=i.getElementState(t.id,"preventAutoplay");return e||i.setElementState(t.id,"preventAutoplay",!0),null!==e&&void 0!==e&&e}),[t.id,i]);(0,n.useEffect)((()=>{a.current&&(a.current.currentTime=o)}),[o]),(0,n.useEffect)((()=>{const e=a.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]),(0,n.useEffect)((()=>{const e=a.current;if(!e)return;let t=!1;const r=()=>{c>0&&e.currentTime>=c&&(l?(e.currentTime=o||0,e.play()):t||(t=!0,e.pause()))};return c>0&&e.addEventListener("timeupdate",r),()=>{e&&c>0&&e.removeEventListener("timeupdate",r)}}),[c,l,o]),(0,n.useEffect)((()=>{const e=a.current;if(!e)return;const t=()=>{l&&(e.currentTime=o||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[l,o]);const p=(0,u.O0)(t.url),v=d.buildMediaURL(p);return(0,s.jsx)("audio",{className:"stAudio","data-testid":"stAudio",ref:a,controls:!0,autoPlay:m&&!f,src:v,style:{width:r}})}}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4785],{94785:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var n=r(5057),u=r(13840),s=r(96266);function d(e){let{element:t,width:r,endpoints:d,elementMgr:i}=e;const a=(0,n.useRef)(null),{startTime:o,endTime:c,loop:l,autoplay:m}=t,f=(0,n.useMemo)((()=>{if(!t.id)return!0;const e=i.getElementState(t.id,"preventAutoplay");return e||i.setElementState(t.id,"preventAutoplay",!0),null!==e&&void 0!==e&&e}),[t.id,i]);(0,n.useEffect)((()=>{a.current&&(a.current.currentTime=o)}),[o]),(0,n.useEffect)((()=>{const e=a.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]),(0,n.useEffect)((()=>{const e=a.current;if(!e)return;let t=!1;const r=()=>{c>0&&e.currentTime>=c&&(l?(e.currentTime=o||0,e.play()):t||(t=!0,e.pause()))};return c>0&&e.addEventListener("timeupdate",r),()=>{e&&c>0&&e.removeEventListener("timeupdate",r)}}),[c,l,o]),(0,n.useEffect)((()=>{const e=a.current;if(!e)return;const t=()=>{l&&(e.currentTime=o||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[l,o]);const p=(0,u.O0)(t.url),v=d.buildMediaURL(p);return(0,s.jsx)("audio",{className:"stAudio","data-testid":"stAudio",ref:a,controls:!0,autoPlay:m&&!f,src:v,style:{width:r}})}}}]);
@@ -0,0 +1,5 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4831],{94778:(e,t,r)=>{r.d(t,{Z:()=>d});r(5057);var o=r(50120),l=r(93905),i=r(82160);const n=r(21371).F4`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,a=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:o}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:o.colors.gray,margin:"0 5px"}}:{},...r?{color:o.colors.red,animationName:`${n}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var s=r(96266);const d=e=>{let{dirty:t,value:r,inForm:i,maxLength:n,className:d,type:u="single",allowEnterToSubmit:c=!0}=e;const p=[],m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,s.jsx)(a,{includeDot:p.length>0,shouldBlink:t,children:e},p.length))};if(t&&c){const e=i?"submit form":"apply";if("multiline"===u){m(`Press ${(0,o.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===u&&m(`Press Enter to ${e}`)}return n&&("chat"!==u||t)&&m(`${r.length}/${n}`,t&&r.length>=n),(0,s.jsx)(l.X7,{"data-testid":"InputInstructions",className:d,children:p})}},52955:(e,t,r)=>{r.d(t,{K:()=>i,O:()=>n});var o=r(5057),l=r(50120);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,l.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,l.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),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}}function n(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,o.useEffect)((()=>{if(!(0,l.bM)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},44831:(e,t,r)=>{r.r(t),r.d(t,{default:()=>j});var o=r(5057),l=r(52707),i=r(84332),n=r(47206),a=r(59500),s=r(30124),d=r(72581),u=r.n(d),c=r(50120),p=r(52955),m=r(70714),b=r(60913),g=r(21034),h=r(98790),f=r(73401),v=r(94778),y=r(38944),I=r(93905),w=r(82160);const k=(0,w.Z)("div",{target:"e116k4er3"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}}}),""),x=(0,w.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),C=(0,w.Z)("button",{target:"e116k4er1"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}}}),""),T=(0,w.Z)("div",{target:"e116k4er0"})((e=>{let{theme:t,clearable:r}=e;return{position:"absolute",marginRight:t.spacing.twoXS,left:0,right:64+(r?12:0)+"px"}}),"");var R=r(96266);const F=e=>{let{step:t,dataType:r}=e;return t||(r===b.Y2.DataType.INT?1:.01)},D=e=>{let{value:t,format:r,step:o,dataType:l}=e;if((0,c.le)(t))return null;let i=function(e){return(0,c.le)(e)||""===e?void 0:e}(r);if((0,c.le)(i)&&(0,c.bb)(o)){const e=o.toString();if(l===b.Y2.DataType.FLOAT&&0!==o&&e.includes(".")){i=`%0.${e.split(".")[1].length}f`}}if((0,c.le)(i))return t.toString();try{return(0,a.sprintf)(i,t)}catch(n){return(0,m.KE)(`Error in sprintf(${i}, ${t}): ${n}`),String(t)}},j=(0,n.b)((e=>{var t;let{disabled:r,element:n,widgetMgr:a,width:d,theme:m,fragmentId:w}=e;const{dataType:j,id:N,formId:S,default:L,format:W}=n,E=n.hasMin?n.min:-1/0,M=n.hasMax?n.max:1/0,[B,Z]=o.useState(F(n)),$=(e=>{var t;const r=e.element.dataType===b.Y2.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element);return null!==(t=null!==r&&void 0!==r?r:e.element.default)&&void 0!==t?t:null})({element:n,widgetMgr:a}),[V,U]=o.useState(!1),[z,_]=o.useState($),[A,O]=o.useState(D({value:$,...n,step:B})),[Y,K]=o.useState(!1),P=o.useRef(null),H=o.useRef(new p.K),G=o.useRef(u()("number_input_")),X=((e,t,r)=>!(0,c.le)(e)&&e-t>=r)(z,B,E),q=((e,t,r)=>!(0,c.le)(e)&&e+t<=r)(z,B,M),J=(0,c.$b)({formId:S}),Q=a.allowFormEnterToSubmit(S);o.useEffect((()=>{Z(F({step:n.step,dataType:n.dataType}))}),[n.dataType,n.step]);const ee=o.useCallback((e=>{let{value:t,source:r}=e;if((0,c.bb)(t)&&(E>t||t>M)){var o;null===(o=P.current)||void 0===o||o.reportValidity()}else{var l;const e=null!==(l=null!==t&&void 0!==t?t:L)&&void 0!==l?l:null;switch(j){case b.Y2.DataType.INT:a.setIntValue({id:N,formId:S},e,r,w);break;case b.Y2.DataType.FLOAT:a.setDoubleValue({id:N,formId:S},e,r,w);break;default:throw new Error("Invalid data type")}U(!1),_(e),O(D({value:e,dataType:j,format:W,step:B}))}}),[E,M,P,a,w,B,j,N,S,L,W]),te=()=>{const{value:e}=n;n.setValue=!1,_(null!==e&&void 0!==e?e:null),O(D({value:null!==e&&void 0!==e?e:null,...n,step:B})),ee({value:null!==e&&void 0!==e?e:null,source:{fromUi:!1}})};o.useEffect((()=>{const e=H.current;return n.setValue?te():ee({value:z,source:{fromUi:!1}}),()=>{e.disconnect()}}),[]),n.setValue&&te();const re=(0,c.le)(n.default)&&!r;H.current.manageFormClearListener(a,n.formId,(()=>{var e;_(null!==(e=n.default)&&void 0!==e?e:null),ee({value:z,source:{fromUi:!0}})}));const oe=o.useCallback((()=>{q&&(U(!0),ee({value:(null!==z&&void 0!==z?z:E)+B,source:{fromUi:!0}}))}),[z,E,B,q]),le=o.useCallback((()=>{X&&(U(!0),ee({value:(null!==z&&void 0!==z?z:M)-B,source:{fromUi:!0}}))}),[z,M,B,X]),ie=o.useCallback((e=>{const{key:t}=e;switch(t){case"ArrowUp":e.preventDefault(),oe();break;case"ArrowDown":e.preventDefault(),le()}}),[oe,le]),ne=o.useCallback((e=>{"Enter"===e.key&&(V&&ee({value:z,source:{fromUi:!0}}),Q&&a.submitForm(S,w))}),[V,z,ee,a,S,w,Q]);return(0,R.jsxs)("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:d},children:[(0,R.jsx)(y.O,{label:n.label,disabled:r,labelVisibility:(0,c.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:G.current,children:n.help&&(0,R.jsx)(I.dT,{children:(0,R.jsx)(g.Z,{content:n.help,placement:h.u.TOP_RIGHT})})}),(0,R.jsxs)(k,{className:Y?"focused":"","data-testid":"stNumberInputContainer",children:[(0,R.jsx)(s.Z,{type:"number",inputRef:P,value:null!==A&&void 0!==A?A:"",placeholder:n.placeholder,onBlur:()=>(V&&ee({value:z,source:{fromUi:!0}}),void K(!1)),onFocus:()=>{K(!0)},onChange:e=>(e=>{const{value:t}=e.target;if(""===t)U(!0),_(null),O(null);else{let e;e=n.dataType===b.Y2.DataType.INT?parseInt(t,10):parseFloat(t),U(!0),_(e),O(t)}})(e),onKeyPress:e=>ne(e),onKeyDown:e=>ie(e),clearable:re,clearOnEscape:re,disabled:r,"aria-label":n.label,id:G.current,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:m.colors.darkGray,transform:"scale(1.4)",width:m.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:m.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:B,min:E,max:M},style:{lineHeight:m.lineHeights.inputWidget,paddingRight:m.spacing.sm,paddingLeft:m.spacing.sm,paddingBottom:m.spacing.sm,paddingTop:m.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),d>m.breakpoints.hideNumberInputControls&&(0,R.jsxs)(x,{children:[(0,R.jsx)(C,{"data-testid":"stNumberInputStepDown",onClick:le,disabled:!X||r,tabIndex:-1,children:(0,R.jsx)(f.Z,{content:l.W,size:"xs",color:X?"inherit":"disabled"})}),(0,R.jsx)(C,{"data-testid":"stNumberInputStepUp",onClick:oe,disabled:!q||r,tabIndex:-1,children:(0,R.jsx)(f.Z,{content:i.v,size:"xs",color:q?"inherit":"disabled"})})]})]}),d>m.breakpoints.hideWidgetDetails&&(0,R.jsx)(T,{clearable:re,children:(0,R.jsx)(v.Z,{dirty:V,value:null!==A&&void 0!==A?A:"",inForm:J,allowEnterToSubmit:Q||!J})})]})}))}}]);
@@ -0,0 +1,9 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[5299],{48689:(t,a,e)=>{e.d(a,{K:()=>s});var n=e(5057),i=e(53627);const o=n.createContext(null);var r=e(96266);const s=t=>{var a;let{children:e}=t;const s=null===(a=(0,n.useContext)(o))||void 0===a?void 0:a();return s?(0,i.createPortal)(e,s):(0,r.jsx)(r.Fragment,{children:e})}},62817:(t,a,e)=>{e.r(a),e.d(a,{NUM_BALLOONS:()=>x,default:()=>P});var n=e(5057);const i=e.p+"static/media/balloon-0.0e6e96ece0ea0719d6b6.png",o=e.p+"static/media/balloon-1.a503c271109e9a0fdd2d.png",r=e.p+"static/media/balloon-2.872250f3bf3a8965d655.png",s=e.p+"static/media/balloon-3.e772fafd3bfc55fb439b.png",l=e.p+"static/media/balloon-4.1a74162473d81c9cb9ee.png",c=e.p+"static/media/balloon-5.edb75c74c54165b29856.png";var d=e(49441),m=e(48689),p=e(82160),u=e(21371);const f=u.F4`
2
+ from {
3
+ transform: translateY(calc(100vh + ${300}px));
4
+ }
5
+
6
+ to {
7
+ transform: translateY(0);
8
+ }
9
+ `,b=(0,p.Z)("img",{target:"earwcwy0"})((t=>{let{theme:a}=t;return{position:"fixed",top:"-300px",marginLeft:"-60.5px",zIndex:a.zIndices.balloons,left:60*Math.random()+20+"vw",animationDelay:1e3*Math.random()+"ms",height:"300px",width:"121px",pointerEvents:"none",animationDuration:"750ms",animationName:f,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var h=e(96266);const x=30,g=[i,o,r,s,l,c],v=g.length,y=t=>{let{particleType:a}=t;return(0,h.jsx)(b,{src:g[a]})},C=t=>{let{scriptRunId:a}=t;return(0,h.jsx)(m.K,{children:(0,h.jsx)(d.Z,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:a,numParticleTypes:v,numParticles:x,ParticleComponent:y})})},P=(0,n.memo)(C)},49441:(t,a,e)=>{e.d(a,{Z:()=>c});var n=e(5057),i=e(66904),o=e.n(i);const r=(0,e(82160).Z)("div",{target:"ecnfqzf0"})((()=>({"@media print":{display:"none"}})),"");var s=e(96266);const l=t=>{let{className:a,scriptRunId:e,numParticles:n,numParticleTypes:i,ParticleComponent:l}=t;return(0,s.jsx)(r,{className:a,"data-testid":a,children:o()(n).map((t=>{const a=Math.floor(Math.random()*i);return(0,s.jsx)(l,{particleType:a},e+t)}))})},c=(0,n.memo)(l)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6134],{26134:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(5057),n=r(60913),s=r(94046),i=r(82603),d=r(96266);const o=528;function l(e){let{element:t,width:r,endpoints:l,elementMgr:u}=e;const c=(0,a.useRef)(null),{type:p,url:m,startTime:f,subtitles:h,endTime:v,loop:y,autoplay:E,muted:T}=t,g=(0,i.O0)(m),k=(0,i.KA)(h),L=(0,a.useMemo)((()=>{if(!t.id)return!0;const e=u.getElementState(t.id,"preventAutoplay");return e||u.setElementState(t.id,"preventAutoplay",!0),null!==e&&void 0!==e&&e}),[t.id,u]);(0,a.useEffect)((()=>{c.current&&(c.current.currentTime=f)}),[f]),(0,a.useEffect)((()=>{const e=c.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]),(0,a.useEffect)((()=>{const e=c.current;if(!e)return;let t=!1;const r=()=>{v>0&&e.currentTime>=v&&(y?(e.currentTime=f||0,e.play()):t||(t=!0,e.pause()))};return v>0&&e.addEventListener("timeupdate",r),()=>{e&&v>0&&e.removeEventListener("timeupdate",r)}}),[v,y,f]),(0,a.useEffect)((()=>{const e=c.current;if(!e)return;const t=()=>{y&&(e.currentTime=f||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[y,f]);const w=e=>{const{startTime:r,endTime:a,loop:n,autoplay:s,muted:i}=t,d=new URL(e);if(r&&!isNaN(r)&&d.searchParams.append("start",r.toString()),a&&!isNaN(a)&&d.searchParams.append("end",a.toString()),n){d.searchParams.append("loop","1");const e=d.pathname.split("/").pop();e&&d.searchParams.append("playlist",e)}return s&&d.searchParams.append("autoplay","1"),i&&d.searchParams.append("mute","1"),d.toString()};if(p===n.nk.Type.YOUTUBE_IFRAME){const e=0!==r?.75*r:o;return(0,d.jsx)("iframe",{className:"stVideo","data-testid":"stVideo",title:g,src:w(g),width:r,height:e,style:{colorScheme:"normal"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,d.jsx)("video",{className:"stVideo","data-testid":"stVideo",ref:c,controls:!0,muted:T,autoPlay:E&&!L,src:l.buildMediaURL(g),style:{width:r,height:0===r?o:void 0},crossOrigin:s.td&&k.length>0?"anonymous":void 0,children:k&&k.map(((e,t)=>(0,d.jsx)("track",{kind:"captions",src:l.buildMediaURL(e.url),label:e.label,default:0===t},t)))})}}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6134],{26134:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var a=r(5057),n=r(60913),s=r(94046),i=r(13840),d=r(96266);const o=528;function l(e){let{element:t,width:r,endpoints:l,elementMgr:u}=e;const c=(0,a.useRef)(null),{type:p,url:m,startTime:f,subtitles:h,endTime:v,loop:y,autoplay:E,muted:T}=t,g=(0,i.O0)(m),k=(0,i.KA)(h),L=(0,a.useMemo)((()=>{if(!t.id)return!0;const e=u.getElementState(t.id,"preventAutoplay");return e||u.setElementState(t.id,"preventAutoplay",!0),null!==e&&void 0!==e&&e}),[t.id,u]);(0,a.useEffect)((()=>{c.current&&(c.current.currentTime=f)}),[f]),(0,a.useEffect)((()=>{const e=c.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]),(0,a.useEffect)((()=>{const e=c.current;if(!e)return;let t=!1;const r=()=>{v>0&&e.currentTime>=v&&(y?(e.currentTime=f||0,e.play()):t||(t=!0,e.pause()))};return v>0&&e.addEventListener("timeupdate",r),()=>{e&&v>0&&e.removeEventListener("timeupdate",r)}}),[v,y,f]),(0,a.useEffect)((()=>{const e=c.current;if(!e)return;const t=()=>{y&&(e.currentTime=f||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}}),[y,f]);const w=e=>{const{startTime:r,endTime:a,loop:n,autoplay:s,muted:i}=t,d=new URL(e);if(r&&!isNaN(r)&&d.searchParams.append("start",r.toString()),a&&!isNaN(a)&&d.searchParams.append("end",a.toString()),n){d.searchParams.append("loop","1");const e=d.pathname.split("/").pop();e&&d.searchParams.append("playlist",e)}return s&&d.searchParams.append("autoplay","1"),i&&d.searchParams.append("mute","1"),d.toString()};if(p===n.nk.Type.YOUTUBE_IFRAME){const e=0!==r?.75*r:o;return(0,d.jsx)("iframe",{className:"stVideo","data-testid":"stVideo",title:g,src:w(g),width:r,height:e,style:{colorScheme:"normal"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,d.jsx)("video",{className:"stVideo","data-testid":"stVideo",ref:c,controls:!0,muted:T,autoPlay:E&&!L,src:l.buildMediaURL(g),style:{width:r,height:0===r?o:void 0},crossOrigin:s.td&&k.length>0?"anonymous":void 0,children:k&&k.map(((e,t)=>(0,d.jsx)("track",{kind:"captions",src:l.buildMediaURL(e.url),label:e.label,default:0===t},t)))})}}}]);
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 6463.cd216036.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6463],{76463:(e,t,n)=>{n.d(t,{Z:()=>ie});const{entries:o,setPrototypeOf:r,isFrozen:i,getPrototypeOf:a,getOwnPropertyDescriptor:l}=Object;let{freeze:c,seal:s,create:u}=Object,{apply:m,construct:p}="undefined"!==typeof Reflect&&Reflect;c||(c=function(e){return e}),s||(s=function(e){return e}),m||(m=function(e,t,n){return e.apply(t,n)}),p||(p=function(e,t){return new e(...t)});const f=w(Array.prototype.forEach),d=w(Array.prototype.pop),h=w(Array.prototype.push),g=w(String.prototype.toLowerCase),T=w(String.prototype.toString),y=w(String.prototype.match),E=w(String.prototype.replace),_=w(String.prototype.indexOf),A=w(String.prototype.trim),N=w(Object.prototype.hasOwnProperty),b=w(RegExp.prototype.test),S=(R=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(R,t)});var R;function w(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return m(e,t,o)}}function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;r&&r(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"===typeof r){const e=n(r);e!==r&&(i(t)||(t[o]=e),r=e)}e[r]=!0}return e}function L(e){for(let t=0;t<e.length;t++){N(e,t)||(e[t]=null)}return e}function v(e){const t=u(null);for(const[n,r]of o(e)){N(e,n)&&(Array.isArray(r)?t[n]=L(r):r&&"object"===typeof r&&r.constructor===Object?t[n]=v(r):t[n]=r)}return t}function D(e,t){for(;null!==e;){const n=l(e,t);if(n){if(n.get)return w(n.get);if("function"===typeof n.value)return w(n.value)}e=a(e)}return function(){return null}}const k=c(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=c(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=c(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=c(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=c(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U=c(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=c(["#text"]),F=c(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),H=c(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=c(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),B=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=s(/<%[\w\W]*|[\w\W]*%>/gm),Y=s(/\${[\w\W]*}/gm),j=s(/^data-[\-\w.\u00B7-\uFFFF]/),X=s(/^aria-[\-\w]+$/),q=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=s(/^(?:\w+script|data):/i),K=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=s(/^html$/i),Z=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var J=Object.freeze({__proto__:null,MUSTACHE_EXPR:W,ERB_EXPR:G,TMPLIT_EXPR:Y,DATA_ATTR:j,ARIA_ATTR:X,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:K,DOCTYPE_NAME:V,CUSTOM_ELEMENT:Z});const Q=1,ee=3,te=7,ne=8,oe=9,re=function(){return"undefined"===typeof window?null:window};var ie=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re();const n=t=>e(t);if(n.version="3.1.7",n.removed=[],!t||!t.document||t.document.nodeType!==oe)return n.isSupported=!1,n;let{document:r}=t;const i=r,a=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:s,Node:m,Element:p,NodeFilter:R,NamedNodeMap:w=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:L,DOMParser:W,trustedTypes:G}=t,Y=p.prototype,j=D(Y,"cloneNode"),X=D(Y,"remove"),$=D(Y,"nextSibling"),K=D(Y,"childNodes"),Z=D(Y,"parentNode");if("function"===typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ie,ae="";const{implementation:le,createNodeIterator:ce,createDocumentFragment:se,getElementsByTagName:ue}=r,{importNode:me}=i;let pe={};n.isSupported="function"===typeof o&&"function"===typeof Z&&le&&void 0!==le.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:de,TMPLIT_EXPR:he,DATA_ATTR:ge,ARIA_ATTR:Te,IS_SCRIPT_OR_DATA:ye,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:_e}=J;let{IS_ALLOWED_URI:Ae}=J,Ne=null;const be=C({},[...k,...O,...x,...M,...P]);let Se=null;const Re=C({},[...F,...H,...z,...B]);let we=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Le=null,ve=!0,De=!0,ke=!1,Oe=!0,xe=!1,Ie=!0,Me=!1,Ue=!1,Pe=!1,Fe=!1,He=!1,ze=!1,Be=!0,We=!1,Ge=!0,Ye=!1,je={},Xe=null;const qe=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const Ke=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ze=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,ot=null;const rt=C({},[Je,Qe,et],T);let it=null;const at=["application/xhtml+xml","text/html"];let lt=null,ct=null;const st=r.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"===typeof e||(e={}),e=v(e),it=-1===at.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===it?T:g,Ne=N(e,"ALLOWED_TAGS")?C({},e.ALLOWED_TAGS,lt):be,Se=N(e,"ALLOWED_ATTR")?C({},e.ALLOWED_ATTR,lt):Re,ot=N(e,"ALLOWED_NAMESPACES")?C({},e.ALLOWED_NAMESPACES,T):rt,Ve=N(e,"ADD_URI_SAFE_ATTR")?C(v(Ze),e.ADD_URI_SAFE_ATTR,lt):Ze,$e=N(e,"ADD_DATA_URI_TAGS")?C(v(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,Xe=N(e,"FORBID_CONTENTS")?C({},e.FORBID_CONTENTS,lt):qe,Ce=N(e,"FORBID_TAGS")?C({},e.FORBID_TAGS,lt):{},Le=N(e,"FORBID_ATTR")?C({},e.FORBID_ATTR,lt):{},je=!!N(e,"USE_PROFILES")&&e.USE_PROFILES,ve=!1!==e.ALLOW_ARIA_ATTR,De=!1!==e.ALLOW_DATA_ATTR,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,xe=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,Ge=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,Ae=e.ALLOWED_URI_REGEXP||q,tt=e.NAMESPACE||et,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(De=!1),He&&(Fe=!0),je&&(Ne=C({},P),Se=[],!0===je.html&&(C(Ne,k),C(Se,F)),!0===je.svg&&(C(Ne,O),C(Se,H),C(Se,B)),!0===je.svgFilters&&(C(Ne,x),C(Se,H),C(Se,B)),!0===je.mathMl&&(C(Ne,M),C(Se,z),C(Se,B))),e.ADD_TAGS&&(Ne===be&&(Ne=v(Ne)),C(Ne,e.ADD_TAGS,lt)),e.ADD_ATTR&&(Se===Re&&(Se=v(Se)),C(Se,e.ADD_ATTR,lt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(Xe===qe&&(Xe=v(Xe)),C(Xe,e.FORBID_CONTENTS,lt)),Ge&&(Ne["#text"]=!0),Me&&C(Ne,["html","head","body"]),Ne.table&&(C(Ne,["tbody"]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if("function"!==typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ie=e.TRUSTED_TYPES_POLICY,ae=ie.createHTML("")}else void 0===ie&&(ie=function(e,t){if("object"!==typeof e||"function"!==typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(i){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(G,a)),null!==ie&&"string"===typeof ae&&(ae=ie.createHTML(""));c&&c(e),ct=e}},pt=C({},["mi","mo","mn","ms","mtext"]),ft=C({},["annotation-xml"]),dt=C({},["title","style","font","a","script"]),ht=C({},[...O,...x,...I]),gt=C({},[...M,...U]),Tt=function(e){h(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){X(e)}},yt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(o){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(Fe||He)try{Tt(t)}catch(o){}else try{t.setAttribute(e,"")}catch(o){}},Et=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=y(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===it&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=ie?ie.createHTML(e):e;if(tt===et)try{t=(new W).parseFromString(o,it)}catch(a){}if(!t||!t.documentElement){t=le.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:o}catch(a){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),tt===et?ue.call(t,Me?"html":"body")[0]:Me?t.documentElement:i},_t=function(e){return ce.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},At=function(e){return e instanceof L&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof w)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},Nt=function(e){return"function"===typeof m&&e instanceof m},bt=function(e,t,o){pe[e]&&f(pe[e],(e=>{e.call(n,t,o,ct)}))},St=function(e){let t=null;if(bt("beforeSanitizeElements",e,null),At(e))return Tt(e),!0;const o=lt(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:o,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return Tt(e),!0;if(e.nodeType===te)return Tt(e),!0;if(Ie&&e.nodeType===ne&&b(/<[/\w]/g,e.data))return Tt(e),!0;if(!Ne[o]||Ce[o]){if(!Ce[o]&&wt(o)){if(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,o))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(o))return!1}if(Ge&&!Xe[o]){const t=Z(e)||e.parentNode,n=K(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=j(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,$(e))}}}return Tt(e),!0}return e instanceof p&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=g(e.tagName),o=g(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===o||pt[o]):Boolean(ht[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&ft[o]:Boolean(gt[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!ft[o])&&!(t.namespaceURI===Je&&!pt[o])&&!gt[n]&&(dt[n]||!ht[n]):!("application/xhtml+xml"!==it||!ot[e.namespaceURI]))}(e)?(Tt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&e.nodeType===ee&&(t=e.textContent,f([fe,de,he],(e=>{t=E(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(Tt(e),!0)},Rt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in r||n in st))return!1;if(De&&!Le[t]&&b(ge,t));else if(ve&&b(Te,t));else if(!Se[t]||Le[t]){if(!(wt(e)&&(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&b(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&b(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(Ae,E(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!$e[e]){if(ke&&!b(ye,E(n,Ee,"")));else if(n)return!1}else;return!0},wt=function(e){return"annotation-xml"!==e&&y(e,_e)},Ct=function(e){bt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se};let r=t.length;for(;r--;){const a=t[r],{name:l,namespaceURI:c,value:s}=a,u=lt(l);let m="value"===l?s:A(s);if(o.attrName=u,o.attrValue=m,o.keepAttr=!0,o.forceKeepAttr=void 0,bt("uponSanitizeAttribute",e,o),m=o.attrValue,o.forceKeepAttr)continue;if(yt(l,e),!o.keepAttr)continue;if(!Oe&&b(/\/>/i,m)){yt(l,e);continue}xe&&f([fe,de,he],(e=>{m=E(m,e," ")}));const p=lt(e.nodeName);if(Rt(p,u,m))if(!We||"id"!==u&&"name"!==u||(yt(l,e),m="user-content-"+m),Ie&&b(/((--!?|])>)|<\/(style|title)/i,m))yt(l,e);else{if(ie&&"object"===typeof G&&"function"===typeof G.getAttributeType)if(c);else switch(G.getAttributeType(p,u)){case"TrustedHTML":m=ie.createHTML(m);break;case"TrustedScriptURL":m=ie.createScriptURL(m)}try{c?e.setAttributeNS(c,l,m):e.setAttribute(l,m),At(e)?Tt(e):d(n.removed)}catch(i){}}}bt("afterSanitizeAttributes",e,null)},Lt=function e(t){let n=null;const o=_t(t);for(bt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)bt("uponSanitizeShadowNode",n,null),St(n)||(n.content instanceof l&&e(n.content),Ct(n));bt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,r=null,a=null,c=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!==typeof e&&!Nt(e)){if("function"!==typeof e.toString)throw S("toString is not a function");if("string"!==typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||mt(t),n.removed=[],"string"===typeof e&&(Ye=!1),Ye){if(e.nodeName){const t=lt(e.nodeName);if(!Ne[t]||Ce[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof m)o=Et("\x3c!----\x3e"),r=o.ownerDocument.importNode(e,!0),r.nodeType===Q&&"BODY"===r.nodeName||"HTML"===r.nodeName?o=r:o.appendChild(r);else{if(!Fe&&!xe&&!Me&&-1===e.indexOf("<"))return ie&&ze?ie.createHTML(e):e;if(o=Et(e),!o)return Fe?null:ze?ae:""}o&&Pe&&Tt(o.firstChild);const s=_t(Ye?e:o);for(;a=s.nextNode();)St(a)||(a.content instanceof l&&Lt(a.content),Ct(a));if(Ye)return e;if(Fe){if(He)for(c=se.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(Se.shadowroot||Se.shadowrootmode)&&(c=me.call(i,c,!0)),c}let u=Me?o.outerHTML:o.innerHTML;return Me&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&b(V,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),xe&&f([fe,de,he],(e=>{u=E(u,e," ")})),ie&&ze?ie.createHTML(u):u},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},n.clearConfig=function(){ct=null,Ue=!1},n.isValidAttribute=function(e,t,n){ct||mt({});const o=lt(e),r=lt(t);return Rt(o,r,n)},n.addHook=function(e,t){"function"===typeof t&&(pe[e]=pe[e]||[],h(pe[e],t))},n.removeHook=function(e){if(pe[e])return d(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}()}}]);
@@ -0,0 +1 @@
1
+ /*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6944],{76944:(e,t,r)=>{r.r(t),r.d(t,{default:()=>V});var n=r(5057),o=r(47206),i=Object.freeze({radio:"radio",checkbox:"checkbox"}),l=(Object.freeze({change:"change"}),"default"),a=r(80099),c=r(74338),u=(0,r(53381).zo)("div",(function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=1===r?void 0:t!==l?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}}));function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function m(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=S(e);if(t){var o=S(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,r)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}u.displayName="StyledRoot",u.displayName="StyledRoot";var E=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(d,e);var t,r,o,s=m(d);function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return O(v(e=s.call.apply(s,[this].concat(r))),"childRefs",{}),e}return t=d,r=[{key:"render",value:function(){var e=this,t=this.props,r=t.overrides,o=void 0===r?{}:r,s=t.mode,d=void 0===s?i.checkbox:s,h=t.children,b=t.selected,y=t.disabled,m=t.onClick,v=t.kind,S=t.shape,O=t.size,E=g((0,a.jb)(o.Root,u),2),w=E[0],C=E[1],j=this.props["aria-label"]||this.props.ariaLabel,L=d===i.radio,k=n.Children.count(h);return n.createElement(c.R.Consumer,null,(function(t){return n.createElement(w,f({"aria-label":j||t.buttongroup.ariaLabel,"data-baseweb":"button-group",role:L?"radiogroup":"group",$shape:S,$length:h.length},C),n.Children.map(h,(function(t,r){if(!n.isValidElement(t))return null;var o=t.props.isSelected?t.props.isSelected:function(e,t){return!(!Array.isArray(e)&&"number"!==typeof e)&&(Array.isArray(e)?e.includes(t):e===t)}(b,r);return L&&(e.childRefs[r]=n.createRef()),n.cloneElement(t,{disabled:y||t.props.disabled,isSelected:o,ref:L?e.childRefs[r]:void 0,tabIndex:!L||o||L&&(!b||-1===b)&&0===r?0:-1,onKeyDown:function(t){if(L){var r=Number(b)?Number(b):0;if("ArrowUp"===t.key||"ArrowLeft"===t.key){t.preventDefault&&t.preventDefault();var n=r-1<0?k-1:r-1;m&&m(t,n),e.childRefs[n].current&&e.childRefs[n].current.focus()}if("ArrowDown"===t.key||"ArrowRight"===t.key){t.preventDefault&&t.preventDefault();var o=r+1>k-1?0:r+1;m&&m(t,o),e.childRefs[o].current&&e.childRefs[o].current.focus()}}},kind:v,onClick:function(e){y||(t.props.onClick&&t.props.onClick(e),m&&m(e,r))},shape:S,size:O,overrides:p({BaseButton:{style:function(e){var t=e.$theme;return 1===h.length?{}:S!==l?{marginLeft:t.sizing.scale100,marginRight:t.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":o,role:L?"radio":"checkbox"}}},t.props.overrides)})})))}))}}],r&&b(t.prototype,r),o&&b(t,o),Object.defineProperty(t,"prototype",{writable:!1}),d}(n.Component);O(E,"defaultProps",{disabled:!1,onClick:function(){},shape:l,size:"default",kind:"secondary"});var w=r(9847),C=r(44088),j=r(38830),L=r(44005),k=r(60913),M=r(38944),R=r(93905),P=r(21034),I=r(98790),x=r(50120),D=r(63285),A=r(96266);function _(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function F(e,t,r,o,i,l){const a=function(e,t,r,n){return r.indexOf(n)>-1||t===k.hE.ClickMode.SINGLE_SELECT&&e===k.hE.SelectionVisualization.ALL_UP_TO_SELECTED&&r.length>0&&n<r[0]}(r,o,i,t);let c=e.content,u=e.contentIcon;return a&&(c=e.selectedContent?e.selectedContent:c,u=e.selectedContentIcon?e.selectedContentIcon:u),(0,n.forwardRef)((function(t,r){var n,o;const{element:i,kind:s,size:f}=function(e,t,r){const n=r===k.hE.Style.PILLS?C.nW.PILLS:r===k.hE.Style.BORDERLESS?C.nW.BORDERLESS_ICON:C.nW.SEGMENT,o=r===k.hE.Style.BORDERLESS?C.V5.XSMALL:C.V5.MEDIUM,i=r===k.hE.Style.BORDERLESS?"lg":"base";return{element:(0,A.jsxs)(A.Fragment,{children:[t&&(0,A.jsx)(L.p,{size:i,iconValue:t}),e&&(0,A.jsx)(w.ZP,{source:e,allowHTML:!1})]}),kind:n,size:o}}(null!==(n=c)&&void 0!==n?n:"",null!==(o=u)&&void 0!==o?o:void 0,l),d=function(e,t){return e&&(t=`${t}Active`),t}(!(!a||e.selectedContent||e.selectedContentIcon),s);return(0,A.jsx)(j.ZP,{...t,size:f,kind:d,children:i})}))}function T(e,t){return e.getIntArrayValue(t)}function W(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function z(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function U(e){var t;const{disabled:r,element:l,fragmentId:a,widgetMgr:c}=e,{clickMode:u,options:s,selectionVisualization:f,style:d,label:p,labelVisibility:g,help:h}=l,b=(0,o.u)(),[y,m]=(0,D.w)({getStateFromWidgetMgr:T,getDefaultStateFromProto:W,getCurrStateFromProto:z,updateWidgetMgrState:_,element:l,widgetMgr:c,fragmentId:a});let v;u===k.hE.ClickMode.SINGLE_SELECT?v=i.radio:u===k.hE.ClickMode.MULTI_SELECT&&(v=i.checkbox);const S=(0,n.useMemo)((()=>s.map(((e,t)=>{const r=F(e,t,f,u,y,d);return(0,A.jsx)(r,{},`${e.content}-${t}`)}))),[u,s,f,d,y]),O=d===k.hE.Style.BORDERLESS?b.spacing.threeXS:b.spacing.twoXS;return(0,A.jsxs)("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[(0,A.jsx)(M.O,{label:p,disabled:r,labelVisibility:(0,x.iF)(null!==(t=null===g||void 0===g?void 0:g.value)&&void 0!==t?t:k.kM.LabelVisibilityOptions.COLLAPSED),children:h&&(0,A.jsx)(R.Hp,{children:(0,A.jsx)(P.Z,{content:h,placement:I.u.TOP})})}),(0,A.jsx)(E,{disabled:r,mode:v,onClick:(e,t)=>{const r=function(e,t,r){return e==k.hE.ClickMode.MULTI_SELECT?function(e,t){return t.includes(e)?t.filter((t=>t!==e)):[...t,e]}(t,null!==r&&void 0!==r?r:[]):null!==r&&void 0!==r&&r.includes(t)?[]:[t]}(u,t,y);m({value:r,fromUi:!0})},selected:u===k.hE.ClickMode.MULTI_SELECT?y:(w=y,0===w.length?-1:w[0]),overrides:{Root:{style:{flexWrap:"wrap",gap:O}}},children:S})]});var w}const V=(0,n.memo)(U)},52955:(e,t,r)=>{r.d(t,{K:()=>i,O:()=>l});var n=r(5057),o=r(50120);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),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}}function l(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,n.useEffect)((()=>{if(!(0,o.bM)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},63285:(e,t,r)=>{r.d(t,{P:()=>l,w:()=>a});var n=r(5057),o=r(52955),i=r(50120);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:l,element:a,widgetMgr:c,fragmentId:u}=e;const[s,f]=(0,n.useState)((()=>{var e;return null!==(e=t(c,a))&&void 0!==e?e:r(c,a)})),[d,p]=(0,n.useState)({value:s,fromUi:!1});(0,n.useEffect)((()=>{(0,i.le)(d)||(p(null),f(d.value),l(a,c,d,u))}),[d,l,a,c,u]);const g=(0,n.useCallback)((()=>{p({value:r(c,a),fromUi:!0})}),[p,a,r,c]);return(0,o.O)({widgetMgr:c,element:a,onFormCleared:g}),[s,p]}function a(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:o,updateWidgetMgrState:i,element:a,widgetMgr:c,fragmentId:u}=e;const s=(0,n.useCallback)(((e,t)=>r(t)),[r]),[f,d]=l({getStateFromWidgetMgr:t,getDefaultState:s,updateWidgetMgrState:i,element:a,widgetMgr:c,fragmentId:u});return(0,n.useEffect)((()=>{a.setValue&&(a.setValue=!1,d({value:o(a),fromUi:!1}))}),[a,o,d]),[f,d]}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[698],{69212:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(5057),r=s(47206),o=s(16449),a=s(80099),n=s(17966),l=s(31808),d=s(96266);let c=function(e){return e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl",e}({});const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(l.E),f=!(0,n.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(o.Z,{value:t,overrides:(0,a.aO)(S,u)})}},30698:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i=s(5057),r=s(30967),o=s(69178),a=s(50482),n=s.n(a),l=s(60913),d=s(73401),c=s(98790),h=s(21034),u=s(38944),g=s(93905),p=s(52955),m=s(70714),f=s(50120),S=s(61914),C=s(69212),R=s(82160),b=s(59990),x=function(e){return e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e}(x||{});function w(e,t){switch(e){case x.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case x.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case x.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}const I=(0,R.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),F=(0,R.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,R.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,R.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:s}}),""),y=(0,R.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,R.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),j=(0,R.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),L=(0,R.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),T=(0,R.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,b.DZ)(t.colors.primary,.5)}`},...w(x.MEDIUM,t)}}),"");var U=s(96266);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(T,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(L,{children:(0,U.jsx)(C.Z,{value:r,size:C.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(96457),z=s(38830),$=s(44088),Z=s(44176);let D=function(e){return e.USER="user",e.ENVIRONMENT="environment",e}({});const O=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(j,{"data-testid":"stCameraInputSwitchButton",children:(0,U.jsx)(c.Z,{content:"Switch camera",placement:c.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:$.nW.MINIMAL,onClick:t,children:(0,U.jsx)(d.Z,{content:k.Z,size:"twoXL",color:Z.Z.white})})})})};var X=s(85585),B=s(47206),W=s(11226),_=s(74947),A=s.n(_),V=s(11103);let G=function(e){return e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e}({});const N=e=>{let{width:t}=e;return(0,U.jsxs)(F,{width:t,children:[(0,U.jsx)(d.Z,{size:"threeXL",color:Z.Z.gray60,content:X.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:V.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},H=e=>{let{handleCapture:t,width:s,disabled:r,clearPhotoInProgress:o,setClearPhotoInProgress:a,facingMode:n,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,i.useState)(d||G.PENDING),u=(0,i.useRef)(null),[g,p]=(0,i.useState)(s),m=(0,i.useCallback)((0,f.Ds)(1e3,p),[]);(0,i.useEffect)((()=>{m(s)}),[s,m]);const S=(0,B.u)();return(0,U.jsxs)(I,{width:g,"data-testid":"stCameraInputWebcamComponent",children:[c===G.SUCCESS||r||o?W.tq&&(0,U.jsx)(O,{switchFacingMode:l}):(0,U.jsx)(N,{width:g}),(0,U.jsx)(F,{"data-testid":"stCameraInputWebcamStyledBox",hidden:c!==G.SUCCESS&&!r&&!o,width:g,children:!r&&(0,U.jsx)(A(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:`${S.radii.default} ${S.radii.default} 0 0`},onUserMediaError:()=>{h(G.ERROR)},onUserMedia:()=>{h(G.SUCCESS),a(!1)},videoConstraints:{width:{ideal:g},facingMode:n}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==G.SUCCESS||r||o,children:"Take Photo"})]})};class K extends i.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new p.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===D.USER?D.ENVIRONMENT:D.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s=`camera-input-${(new Date).toISOString().replace(/:/g,"_")}.jpg`,fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,m.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);n()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if((0,f.le)(e))return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);(0,f.le)(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.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((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);(0,f.le)(s)||"uploading"!==s.status.type||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if((0,f.le)(s)||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=o.Z.CancelToken.source(),i=new S.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{o.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:D.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if((0,f.le)(i))return e;const{uploadedFileInfo:r}=i;return(0,f.le)(r)||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new S.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:D.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new l.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new l.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(I,{className:"stCameraInput","data-testid":"stCameraInput",width:o,children:[(0,U.jsx)(u.O,{label:t.label,disabled:i,labelVisibility:(0,f.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(g.dT,{children:(0,U.jsx)(h.Z,{content:t.help,placement:c.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(d.Z,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)(H,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},61914:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},52955:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),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
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[698],{69212:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(5057),r=s(47206),o=s(16449),a=s(80099),n=s(17966),l=s(31808),d=s(96266);let c=function(e){return e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl",e}({});const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(l.E),f=!(0,n.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(o.Z,{value:t,overrides:(0,a.aO)(S,u)})}},30698:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i=s(5057),r=s(30967),o=s(69178),a=s(50482),n=s.n(a),l=s(60913),d=s(73401),c=s(98790),h=s(21034),u=s(38944),g=s(93905),p=s(52955),m=s(70714),f=s(50120),S=s(61914),C=s(69212),R=s(82160),b=s(59990),w=function(e){return e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e}(w||{});function x(e,t){switch(e){case w.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case w.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case w.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}const I=(0,R.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),F=(0,R.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,R.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,R.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:s}}),""),E=(0,R.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),y=(0,R.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),L=(0,R.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,R.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),T=(0,R.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,b.DZ)(t.colors.primary,.5)}`},...x(w.MEDIUM,t)}}),"");var U=s(96266);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(T,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(C.Z,{value:r,size:C.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(96457),z=s(38830),$=s(44088),Z=s(44176);let O=function(e){return e.USER="user",e.ENVIRONMENT="environment",e}({});const D=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(L,{"data-testid":"stCameraInputSwitchButton",children:(0,U.jsx)(c.Z,{content:"Switch camera",placement:c.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:$.nW.MINIMAL,onClick:t,children:(0,U.jsx)(d.Z,{content:k.Z,size:"twoXL",color:Z.Z.white})})})})};var X=s(85585),B=s(47206),W=s(11226),_=s(74947),A=s.n(_),V=s(11103);let G=function(e){return e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e}({});const N=e=>{let{width:t}=e;return(0,U.jsxs)(F,{width:t,children:[(0,U.jsx)(d.Z,{size:"threeXL",color:Z.Z.gray60,content:X.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(E,{href:V.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},H=e=>{let{handleCapture:t,width:s,disabled:r,clearPhotoInProgress:o,setClearPhotoInProgress:a,facingMode:n,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,i.useState)(d||G.PENDING),u=(0,i.useRef)(null),[g,p]=(0,i.useState)(s),m=(0,i.useCallback)((0,f.Ds)(1e3,p),[]);(0,i.useEffect)((()=>{m(s)}),[s,m]);const S=(0,B.u)();return(0,U.jsxs)(I,{width:g,"data-testid":"stCameraInputWebcamComponent",children:[c===G.SUCCESS||r||o?W.tq&&(0,U.jsx)(D,{switchFacingMode:l}):(0,U.jsx)(N,{width:g}),(0,U.jsx)(F,{"data-testid":"stCameraInputWebcamStyledBox",hidden:c!==G.SUCCESS&&!r&&!o,width:g,children:!r&&(0,U.jsx)(A(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:`${S.radii.default} ${S.radii.default} 0 0`},onUserMediaError:()=>{h(G.ERROR)},onUserMedia:()=>{h(G.SUCCESS),a(!1)},videoConstraints:{width:{ideal:g},facingMode:n}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==G.SUCCESS||r||o,children:"Take Photo"})]})};class K extends i.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new p.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s=`camera-input-${(new Date).toISOString().replace(/:/g,"_")}.jpg`,fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,m.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);n()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if((0,f.le)(e))return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);(0,f.le)(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.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((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);(0,f.le)(s)||"uploading"!==s.status.type||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if((0,f.le)(s)||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=o.Z.CancelToken.source(),i=new S.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{o.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if((0,f.le)(i))return e;const{uploadedFileInfo:r}=i;return(0,f.le)(r)||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new S.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new l.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new l.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(I,{className:"stCameraInput","data-testid":"stCameraInput",width:o,children:[(0,U.jsx)(u.O,{label:t.label,disabled:i,labelVisibility:(0,f.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(g.dT,{children:(0,U.jsx)(h.Z,{content:t.help,placement:c.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(y,{children:[(0,U.jsx)(d.Z,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)(H,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},61914:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},52955:(e,t,s)=>{s.d(t,{K:()=>o,O:()=>a});var i=s(5057),r=s(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,r.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),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}}function a(e){let{element:t,widgetMgr:s,onFormCleared:o}=e;(0,i.useEffect)((()=>{if(!(0,r.bM)(t.formId))return;const e=s.addFormClearedListener(t.formId,o);return()=>{e.disconnect()}}),[t,s,o])}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7463],{34879:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Tt});var i=n(5057),o=n(43128),l=n(6095),r=n(27179),a=n(99430),s=n(23046),d=n(30383),u=n(61078),c=n(83221),m=n(52955),f=n(10266),g=n(60913),h=n(50120),p=n(75813),b=n(31808),v=n(40807),y=n.n(v),w=n(26849),x=n.n(w),C=n(88084),M=n.n(C),E=(n(56719),n(27055)),S=n.n(E),k=n(61918),R=n.n(k),T=n(59500),N=n(55490);const _=["true","t","yes","y","on","1"],I=["false","f","no","n","off","0"];function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=`\u26a0\ufe0f ${e}`,{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?`\n\n${t}\n`:""),displayData:e,isError:!0}}function D(e){return e.hasOwnProperty("isError")&&e.isError}function A(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function F(){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 V(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function $(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function H(e,t){return(0,h.le)(e)?t||{}:(0,h.le)(t)?e||{}:y()(e,t)}function L(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:z(e))):[z(t)]}catch(t){return[z(e)]}}function z(e){try{try{return x()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return`[${typeof e}]`}}function W(e){if((0,h.le)(e))return null;if("boolean"===typeof e)return e;const t=z(e).toLowerCase().trim();return""===t?null:!!_.includes(t)||!I.includes(t)&&void 0}function j(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=R().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 B(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,h.le)(t)||""===t?(0===n&&(e=Math.round(e)),R()(e).format((0,h.bb)(n)?`0,0.${"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?M().duration(e/1e6,"milliseconds").humanize():t.startsWith("period[")?N.fu.formatPeriodType(BigInt(e),t):(0,T.sprintf)(t,e)}function Y(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 P(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=M().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=M().utc(e);if(t.isValid())return t.toDate();const n=M().utc(e,[M().HTML5_FMT.TIME_MS,M().HTML5_FMT.TIME_SECONDS,M().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function U(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 Z=new RegExp(/(\r\n|\n|\r)/gm);function J(e){return-1!==e.indexOf("\n")?e.replace(Z," "):e}var q=n(47206),G=n(70714);function K(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)?z(e):null,i=(0,h.bb)(n)?J(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,h.le)(e)}}catch(n){return O(z(e),`The value cannot be interpreted as a string. Error: ${n}`)}},getCellValue:e=>void 0===e.data?null:e.data}}K.isEditableType=!1;const X=K;function Q(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n=`Invalid validate regex: ${t.validate}.\nError: ${r}`}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},l=i=>{if((0,h.le)(i))return!e.isRequired;let o=z(i),l=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),l=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!l||o)};return{...e,kind:"text",sortMode:"default",validateInput:l,getCell(e,t){if("string"===typeof n)return O(z(e),n);if(t){const t=l(e);if(!1===t)return O(z(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,h.bb)(e)?z(e):null,n=(0,h.bb)(t)?J(t):"";return{...i,isMissingValue:(0,h.le)(t),data:t,displayData:n}}catch(r){return O("Incompatible value",`The value cannot be interpreted as string. Error: ${r}`)}},getCellValue:e=>void 0===e.data?null:e.data}}Q.isEditableType=!0;const ee=Q;function te(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function ne(e,t,n,i,l,r,a){var s;const d=H({format:n,step:i,timezone:a},t.columnTypeOptions);let u,c,m;if((0,h.bb)(d.timezone))try{var f;u=(null===(f=te(S()(),d.timezone))||void 0===f?void 0:f.utcOffset())||void 0}catch(b){}(0,h.bb)(d.min_value)&&(c=P(d.min_value)||void 0),(0,h.bb)(d.max_value)&&(m=P(d.max_value)||void 0);const g={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:l,min:c,max:m}},p=e=>{const n=P(e);return null===n?!t.isRequired:void 0!==n&&(!((0,h.bb)(c)&&r(n)<r(c))&&!((0,h.bb)(m)&&r(n)>r(m)))};return{...t,kind:e,sortMode:"default",validateInput:p,getCell(e,t){if(!0===t){const t=p(e);if(!1===t)return O(z(e),"Invalid input.");t instanceof Date&&(e=t)}const i=P(e);let o="",l="",r=u;if(void 0===i)return O(z(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=S().utc(i);if(!e.isValid())return O(z(i),`This should never happen. Please report this bug. \nError: ${e.toString()}`);if(d.timezone){try{e=te(e,d.timezone)}catch(b){return O(e.toISOString(),`Failed to adjust to the provided timezone: ${d.timezone}. \nError: ${b}`)}r=e.utcOffset()}try{l=Y(e,d.format||n)}catch(b){return O(e.toISOString(),`Failed to format the date for rendering with: ${d.format}. \nError: ${b}`)}o=Y(e,n)}return{...g,copyData:o,isMissingValue:(0,h.le)(i),data:{...g.data,date:i,displayDate:l,timezoneOffset:r}}},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:r(e.data.date)}}}function ie(e){var t,n,i,o,l;let r="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(r="YYYY-MM-DD HH:mm:ss.SSS");const a=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,h.bb)(a)||(0,h.bb)(null===e||void 0===e||null===(l=e.columnTypeOptions)||void 0===l?void 0:l.timezone);return ne("datetime",e,s?r+"Z":r,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function oe(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"),ne("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function le(e){return ne("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function re(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=W(e),void 0===n?O(z(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}}ie.isEditableType=!0,oe.isEditableType=!0,le.isEditableType=!0,re.isEditableType=!0;const ae=re;function se(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function de(e){const t=N.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=H({step:se(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),l=(0,h.le)(i.min_value)||i.min_value<0,r=(0,h.bb)(i.step)&&!Number.isNaN(i.step)?U(i.step):void 0,a={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:l,fixedDecimals:r,thousandSeparator:""},s=t=>{let n=j(t);if((0,h.le)(n))return!e.isRequired;if(Number.isNaN(n))return!1;let o=!1;return(0,h.bb)(i.max_value)&&n>i.max_value&&(n=i.max_value,o=!0),!((0,h.bb)(i.min_value)&&n<i.min_value)&&(!o||n)};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(e,t){if(!0===t){const t=s(e);if(!1===t)return O(z(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=j(e),o="";if((0,h.bb)(n)){if(Number.isNaN(n))return O(z(e),"The value cannot be interpreted as a number.");if((0,h.bb)(r)&&(l=n,n=0===(d=r)?Math.trunc(l):Math.trunc(l*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return O(z(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=B(n,i.format,r)}catch(u){return O(z(n),(0,h.bb)(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${u}`:`Failed to format the number. Error: ${u}`)}}var l,d;return{...a,data:n,displayData:o,isMissingValue:(0,h.le)(n),copyData:(0,h.le)(n)?"":z(n)}},getCellValue:e=>void 0===e.data?null:e.data}}de.isEditableType=!0;const ue=de;function ce(e){let t="string";const n=H({options:"bool"===N.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 l={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>z(e)))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,h.bb)(e)&&""!==e&&(n=z(e)),t&&!l.data.allowedValues.includes(n)?O(z(n),"The value is not part of the allowed options."):{...l,isMissingValue:null===n,copyData:n||"",data:{...l.data,value:n}}},getCellValue(e){var n,i,o,l,r,a,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!==(l=j(null===(r=e.data)||void 0===r?void 0:r.value))&&void 0!==l?l:null:"boolean"===t?null!==(a=W(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==a?a:null:null===(o=e.data)||void 0===o?void 0:o.value}}}ce.isEditableType=!0;const me=ce;function fe(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)?[]:L(e);return{...t,data:n,isMissingValue:(0,h.le)(e),copyData:(0,h.le)(e)?"":z(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,h.le)(e.data)||A(e)?null:e.data}}fe.isEditableType=!1;const ge=fe;function he(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function pe(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===N.fu.getTypeName(n)&&(o=!1),{id:`index-${t}`,name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function be(e,t){const n=e.columns.map((e=>e[t])),i=n.length>0?n[n.length-1]:"",o=n.length>1?n.filter((e=>""!==e)).slice(0,-1).join(" / "):void 0;let l,r=e.types.data[t];if((0,h.le)(r)&&(r={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===N.fu.getTypeName(r)){const n=e.getCategoricalOptions(t);(0,h.bb)(n)&&(l={options:n})}return{id:`column-${i}-${t}`,name:i,title:i,isEditable:!0,arrowType:r,columnTypeOptions:l,isIndex:!1,isHidden:!1,group:o}}function ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?N.fu.getTypeName(e.arrowType):null;let l;if("object"===e.kind)l=e.getCell((0,h.bb)(t.content)?J(N.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 r,a;let n;var s,d,u;if("time"===i&&(0,h.bb)(null===(r=t.field)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.unit))n=M().unix(N.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(u=d.type)||void 0===u?void 0:u.unit)&&void 0!==s?s:0)).utc().toDate();else n=M().utc(Number(t.content)).toDate();l=e.getCell(n)}else if("decimal"===i){const n=(0,h.le)(t.content)?null:N.fu.format(t.content,t.contentType,t.field);l=e.getCell(n)}else l=e.getCell(t.content);if(D(l))return l;if(!e.isEditable){if((0,h.bb)(t.displayContent)){var c,m,f,g;const n=J(t.displayContent);l.kind===o.p6.Text||l.kind===o.p6.Number&&(0,h.le)(null===(c=e.columnTypeOptions)||void 0===c?void 0:c.format)||l.kind===o.p6.Uri&&(0,h.le)(null===(m=e.columnTypeOptions)||void 0===m?void 0:m.display_text)?l={...l,displayData:n}:l.kind===o.p6.Custom&&"date-picker-cell"===(null===(f=l.data)||void 0===f?void 0:f.kind)&&(0,h.le)(null===(g=e.columnTypeOptions)||void 0===g?void 0:g.format)&&(l={...l,data:{...l.data,displayDate:n}})}n&&t.cssId&&(l=function(e,t,n){const i={},o=he(t,"color",n);o&&(i.textDark=o);const l=he(t,"background-color",n);return l&&(i.bgCell=l),"yellow"===l&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(l,t.cssId,n))}return l}function ye(e,t,n){const i=H({y_min:0,y_max:1},t.columnTypeOptions),l={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 O("Invalid min/max y-axis configuration",`The y_min (${i.y_min}) and y_max (${i.y_max}) configuration options must be valid numbers.`);if((0,h.le)(e))return F();const t=L(e),n=[];let o=[];if(0===t.length)return F();let r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=j(t[i]);if(Number.isNaN(e)||(0,h.le)(e))return O(z(t),`The value cannot be interpreted as a numeric array. ${z(e)} is not a number.`);e>r&&(r=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(r>i.y_max||a<i.y_min)?n.map((e=>r-a===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(r-a))+(i.y_min||0))):n,{...l,copyData:n.join(","),data:{...l.data,values:o,displayValues:n.map((e=>B(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 we(e){return ye("line_chart",e,"line")}function xe(e){return ye("bar_chart",e,"bar")}function Ce(e){return ye("area_chart",e,"area")}function Me(e){const t={kind:o.p6.Image,data:[],displayData:[],readonly:!0,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)?[z(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]}}we.isEditableType=!1,xe.isEditableType=!1,Ce.isEditableType=!1,Me.isEditableType=!1;const Ee=Me;function Se(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.\nError: ${a}`}if(!(0,h.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(a){i=void 0}const l={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},r=i=>{if((0,h.le)(i))return!e.isRequired;const o=z(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:r,getCell(e,o){if((0,h.le)(e))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return O(z(s),n);if(o){if(!1===r(s))return O(z(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]?decodeURI(n[1]):t}catch(a){return t}}(i,s):t.display_text||s),{...l,data:s,displayData:d,isMissingValue:(0,h.le)(s),onClickUri:e=>{window.open(s.startsWith("www.")?`https://${s}`:s,"_blank","noopener,noreferrer"),e.preventDefault()},copyData:s}},getCellValue:e=>(0,h.le)(e.data)?null:e.data}}Se.isEditableType=!0;const ke=Se;function Re(e){const t=se(N.fu.getTypeName(e.arrowType)),n=H({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=B(n.max_value,n.format)}catch(a){i=z(n.max_value)}const l=(0,h.le)(n.step)||Number.isNaN(n.step)?void 0:U(n.step),r={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 F();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 O("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if((0,h.le)(n.step)||Number.isNaN(n.step))return O("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const t=j(e);if(Number.isNaN(t)||(0,h.le)(t))return O(z(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return O(z(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=B(t,n.format,l)}catch(a){return O(z(t),(0,h.bb)(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${a}`:`Failed to format the number. Error: ${a}`)}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...r,isMissingValue:(0,h.le)(e),copyData:String(t),data:{...r.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}}}Re.isEditableType=!1;const Te=Re,Ne=new Map(Object.entries({object:X,text:ee,checkbox:ae,selectbox:me,list:ge,number:ue,link:ke,datetime:ie,date:le,time:oe,line_chart:we,bar_chart:xe,area_chart:Ce,image:Ee,progress:Te})),_e=[],Ie="_index",Oe="_pos:",De={small:75,medium:200,large:400};function Ae(e){if(!(0,h.le)(e))return"number"===typeof e?e:e in De?De[e]:void 0}function Fe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Ie?n=t.get(e.name):t.has(`${Oe}${e.indexNumber}`)?n=t.get(`${Oe}${e.indexNumber}`):e.isIndex&&t.has(Ie)&&(n=t.get(Ie)),n?y()({...e},{title:n.label,width:Ae(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 Ve(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,h.bb)(n)&&(Ne.has(n)?i=Ne.get(n):(0,G.KE)(`Unknown column type configured in column configuration: ${n}`)),(0,h.le)(i)&&(i=function(e){let t=e?N.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty","large_string[pyarrow]"].includes(t)?ee:["datetime","datetimetz"].includes(t)?ie:"time"===t?oe:"date"===t?le:["object","bytes"].includes(t)?X:["bool"].includes(t)?ae:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?ue:"categorical"===t?me:t.startsWith("list")?ge:X):X}(e.arrowType)),i}const $e=function(e,t,n){const o=(0,q.u)(),l=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,G.H)(t),new Map}}(e.columns)),[e.columns]),r=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 l=0;l<i;l++){const n={...pe(e,l),indexNumber:l};t.push(n)}for(let l=0;l<o;l++){const n={...be(e,l),indexNumber:l+i};t.push(n)}return t}(t).map((t=>{let i={...t,...Fe(t,l),isStretched:r};const a=Ve(i);return(e.editingMode===g.Eh.EditingMode.READ_ONLY||n||!1===a.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==g.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===g.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),a(i,o)})).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:[X({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,l,r,n,e.editingMode,e.columnOrder,o])}};function He(e){return e.isIndex?Ie:(0,h.le)(e.name)?"":e.name}const Le=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 l={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(l[He(o)]=o.getCellValue(e))})),n.edited_rows[i]=l})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,l)=>{const r=t.get(n);if(r){const t=r.getCellValue(e);r.isRequired&&r.isEditable&&A(e)&&(o=!0),(0,h.bb)(t)&&(i[He(r)]=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(He(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],l=o.get(e);if(l){const e=l.getCell(n);var r;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(r=this.editedCells.get(t))||void 0===r||r.set(l.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const n=new Map;t.forEach((e=>{n.set(e.indexNumber,e.getCell(null))})),Object.keys(e).forEach((t=>{const i=e[t],l=o.get(t);if(l){const e=l.getCell(i);e&&n.set(l.indexNumber,e)}})),this.addedRows.push(n)})),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 ze=n(59990);const We=function(){const e=(0,q.u)(),t=i.useMemo((()=>({editable:e=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${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{theme:i.useMemo((()=>({accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,ze.DZ)(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,ze.DZ)(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,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:`${e.fontSizes.sm}`,baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,ze.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})),[e]),tableBorderRadius:e.radii.default,headerIcons:t}};const je=function(e,t,n,o){const l=e.columns.length;return{getCellContent:i.useCallback((i=>{let[r,a]=i;if(r>t.length-1)return O("Column index out of bounds.","This should never happen. Please report this bug.");if(a>n-1)return O("Row index out of bounds.","This should never happen. Please report this bug.");const s=t[r],d=s.indexNumber,u=o.current.getOriginalRowIndex(a),c=o.current.isAddedRow(u);if(s.isEditable||c){const e=o.current.getCell(d,u);if((0,h.bb)(e))return e;if(c)return O("Error during cell creation.",`This should never happen. Please report this bug. No cell found for an added row: col=${d}; row=${u}`)}try{return ve(s,e.getCell(u+l,d),e.cssStyles)}catch(m){return O("Error during cell creation.",`This should never happen. Please report this bug. \nError: ${m}`)}}),[t,n,e,o,l])}};var Be=n(71325);const Ye=function(e,t,n){const[o,l]=i.useState(),{getCellContent:r,getOriginalIndex:a}=(0,Be.fF)({columns:t.map((e=>$(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 ${e.title}`:`\u2193 ${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 l(void 0);t="desc"}l({column:$(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:r}};var Pe=n(50482),Ue=n.n(Pe);const Ze=function(e,t,n,l,r){const[a,s]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),d=!t&&!n&&(e.selectionMode.includes(g.Eh.SelectionMode.MULTI_ROW)||e.selectionMode.includes(g.Eh.SelectionMode.SINGLE_ROW)),u=d&&e.selectionMode.includes(g.Eh.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(g.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(g.Eh.SelectionMode.MULTI_COLUMN)),m=c&&e.selectionMode.includes(g.Eh.SelectionMode.MULTI_COLUMN),f=a.rows.length>0,h=a.columns.length>0,p=void 0!==a.current,b=i.useCallback((e=>{const t=!Ue()(e.rows.toArray(),a.rows.toArray()),n=!Ue()(e.columns.toArray(),a.columns.toArray()),i=!Ue()(e.current,a.current);let o=d&&t||c&&n,u=e;if((d||c)&&void 0!==e.current&&i&&(u={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(u={...u,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(u={...u,rows:a.rows},o=!0),n&&u.columns.length>=0){let e=u.columns;l.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<u.columns.length&&(u={...u,columns:e})}s(u),o&&r(u)}),[a,d,c,r,l]),v=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={columns:t?a.columns:o.EV.empty(),rows:e?a.rows:o.EV.empty(),current:void 0};s(n),(!e&&d||!t&&c)&&r(n)}),[a,d,c,r]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:u,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:m,isRowSelected:f,isColumnSelected:h,isCellSelected:p,clearSelection:v,processSelectionChange:b}},Je=",",qe='"',Ge='"',Ke="\n",Xe="\ufeff",Qe=new RegExp(`[${[Je,qe,Ke].join("")}]`);function et(e){return e.map((e=>function(e){if((0,h.le)(e))return"";const t=z(e);if(Qe.test(t))return`${qe}${t.replace(new RegExp(qe,"g"),Ge+qe)}${qe}`;return t}(e))).join(Je)+Ke}async function tt(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(Xe));const l=n.map((e=>e.name));await e.write(o.encode(et(l)));for(let r=0;r<i;r++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,r])))})),await e.write(o.encode(et(i)))}await e.close()}const nt=function(e,t,o,l){return{exportToCsv:i.useCallback((async()=>{const i=`${(new Date).toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const l=await n.e(5599).then(n.bind(n,95599)),r=await l.showSaveFilePicker({suggestedName:i,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await r.createWritable();await tt(a,e,t,o)}catch(r){if(r instanceof Error&&"AbortError"===r.name)return;try{(0,G.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",r);let n="";const a=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await tt(a.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),u=document.createElement("a");l?u.setAttribute("target","_blank"):u.setAttribute("target","_self"),u.style.display="none",u.href=d,u.download=i,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)}catch(r){(0,G.H)("Failed to export data as CSV",r)}}}),[t,o,e,l])}};const it=function(e,t,n,o,l,r,a,s,d){const u=i.useCallback(((t,i)=>{let[r,a]=t;const d=e[r];if(!d.isEditable)return;const u=d.indexNumber,c=n.current.getOriginalRowIndex(l(a)),m=o([r,a]),f=d.getCellValue(m),g=d.getCellValue(i);if(!D(m)&&g===f)return;const h=d.getCell(g,!0);D(h)?(0,G.KE)(`Not applying the cell edit since it causes this error:\n ${h.data}`):(n.current.setCell(u,c,{...h,lastUpdated:performance.now()}),s())}),[e,n,l,o,s]),c=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),a()}),[e,n,t,a]),m=i.useCallback((()=>{t||(c(),s())}),[c,s,t]),f=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(l(e))));return n.current.deleteRows(e),a(),d(),s(),!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]}),u([o,i],n.getCell(null)))}return t.length>0&&(s(),r(t)),!1}return!0}),[e,n,t,r,l,s,u,d,a]),g=i.useCallback(((i,a)=>{const[d,u]=i,m=[];for(let f=0;f<a.length;f++){const i=a[f];if(f+u>=n.current.getNumRows()){if(t)break;c()}for(let t=0;t<i.length;t++){const r=i[t],a=f+u,s=t+d;if(s>=e.length)break;const c=e[s];if(c.isEditable){const e=c.getCell(r,!0);if((0,h.bb)(e)&&!D(e)){const t=c.indexNumber,i=n.current.getOriginalRowIndex(l(a)),r=c.getCellValue(o([s,a]));c.getCellValue(e)!==r&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),r(m))}return!1}),[e,n,t,l,o,c,s,r]),p=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:u,onPaste:g,onRowAppended:m,onDelete:f,validateCell:p}};const ot=function(e,t){const[n,o]=i.useState(),l=i.useRef(null),r=i.useCallback((n=>{if(clearTimeout(l.current),l.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],r=n.location[1];let a;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,h.bb)(s))a=s.help;else if("cell"===n.kind){const e=t([i,r]);s.isRequired&&s.isEditable&&A(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(l.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,l]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:r}};var lt=n(40047),rt=n(35185),at=n(60353),st=n(74625),dt=n(23213);const ut=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:l,rect:r}=t,a=t.col;if(A(i)&&a<e.length){const i=e[a];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)?n():(e=>{const{cell:t,theme:n,ctx:i}=e;(0,lt.L6)({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign),i.fillStyle=n.textDark})(t),void(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,o))}n()}),[e]),customRenderers:i.useMemo((()=>[rt.Z,at.Z,st.Z,dt.ZP,..._e]),[])}};const ct=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,l)=>{e.id&&n(new Map(t).set(e.id,l))}),[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}},mt=2,ft=35,gt=50+mt,ht=2*ft+mt;const pt=function(e,t,n,o,l,r){let a=function(e){return Math.max(e*ft+mt,ht)}(t+(n?2:1)+(e.editingMode===g.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,ht),a=Math.max(e.height,a)),l&&(s=Math.min(s,l),a=Math.min(a,l),e.height||(s=a));const d=Math.max(o,gt);let u,c=d;e.useContainerWidth?u=d:e.width&&(u=Math.min(Math.max(e.width,gt),d),c=Math.min(Math.max(e.width,c),d));const[m,f]=i.useState({width:u||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===m.width&&f({width:d,height:m.height})}),[d]),i.useLayoutEffect((()=>{f({width:m.width,height:s})}),[t]),i.useLayoutEffect((()=>{f({width:u||"100%",height:m.height})}),[u]),i.useLayoutEffect((()=>{f({width:m.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(r){const t=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;f({width:t?c:"100%",height:a})}else f({width:u||"100%",height:s})}),[r]),{minHeight:ht,maxHeight:a,minWidth:gt,maxWidth:c,resizableSize:m,setResizableSize:f}};var bt=n(82160),vt=n(96266);const yt=(0,bt.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),wt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,vt.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,vt.jsx)(yt,{src:n})}):(0,vt.jsx)(yt,{src:n})};var xt=n(98399),Ct=n(73830),Mt=n(9847),Et=n(37661),St=n(17966);const kt=function(e){let{top:t,left:n,content:o,clearTooltip:l}=e;const[r,a]=i.useState(!0),s=(0,q.u)(),{colors:d,fontSizes:u,radii:c}=s,m=i.useCallback((()=>{a(!1),l()}),[l,a]);return(0,vt.jsx)(xt.Z,{content:(0,vt.jsx)(Et.Uo,{"data-testid":"stDataFrameTooltipContent",children:(0,vt.jsx)(Mt.ZP,{style:{fontSize:u.sm},source:o,allowHTML:!1})}),placement:Ct.r4.top,accessibilityType:Ct.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,St.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:u.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:(0,vt.jsx)("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Rt=(0,bt.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.default},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(27235),n(33091);const Tt=(0,f.Z)((function(e){let{element:t,data:n,width:f,height:v,disabled:y,widgetMgr:w,isFullScreen:x,disableFullscreenMode:C,expand:M,collapse:E,fragmentId:S}=e;const k=i.useRef(null),R=i.useRef(null),T=i.useRef(null),{theme:N,headerIcons:_,tableBorderRadius:I}=We(),{libConfig:{enforceDownloadInNewTab:O=!1}}=i.useContext(b.E),[D,A]=i.useState(!0),[F,H]=i.useState(!1),[L,z]=i.useState(!1),[W,j]=i.useState(!1),B=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),Y=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]);(0,h.le)(t.editingMode)&&(t.editingMode=g.Eh.EditingMode.READ_ONLY);const{READ_ONLY:P,DYNAMIC:U}=g.Eh.EditingMode,Z=n.dimensions,J=Math.max(0,Z.dataRows),q=0===J&&!(t.editingMode===U&&Z.dataColumns>0),G=J>15e4,K=i.useRef(new Le(J)),[X,Q]=i.useState(K.current.getNumRows());i.useEffect((()=>{K.current=new Le(J),Q(K.current.getNumRows())}),[J]);const ee=i.useCallback((()=>{K.current=new Le(J),Q(K.current.getNumRows())}),[J]),{columns:te}=$e(t,n,y);i.useEffect((()=>{if(t.editingMode===P)return;const e=w.getStringValue({id:t.id,formId:t.formId});e&&(K.current.fromJson(e,te),Q(K.current.getNumRows()))}),[]);const{getCellContent:ne}=je(n,te,X,K),{columns:ie,sortColumn:oe,getOriginalIndex:le,getCellContent:re}=Ye(J,te,ne),ae=i.useCallback((0,h.Ds)(150,(e=>{const n={selection:{rows:[],columns:[]}};n.selection.rows=e.rows.toArray().map((e=>le(e))),n.selection.columns=e.columns.toArray().map((e=>He(ie[e])));const i=JSON.stringify(n),o=w.getStringValue({id:t.id,formId:t.formId});void 0!==o&&o===i||w.setStringValue({id:t.id,formId:t.formId},i,{fromUi:!0},S)})),[t.id,t.formId,w,S,le,He]),{gridSelection:se,isRowSelectionActivated:de,isMultiRowSelectionActivated:ue,isColumnSelectionActivated:ce,isMultiColumnSelectionActivated:me,isRowSelected:fe,isColumnSelected:ge,isCellSelected:he,clearSelection:pe,processSelectionChange:be}=Ze(t,q,y,ie,ae);i.useEffect((()=>{pe(!0,!0)}),[x]);const ve=i.useCallback((e=>{var t;null===(t=R.current)||void 0===t||t.updateCells(e)}),[]);i.useEffect((()=>{if(!de&&!ce)return;const e=w.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,l,r;const t=ie.map((e=>He(e))),a=JSON.parse(e);let s=o.EV.empty(),d=o.EV.empty();if(null===(n=a.selection)||void 0===n||null===(i=n.rows)||void 0===i||i.forEach((e=>{s=s.add(e)})),null===(l=a.selection)||void 0===l||null===(r=l.columns)||void 0===r||r.forEach((e=>{d=d.add(t.indexOf(e))})),s.length>0||d.length>0){be({rows:s,columns:d,current:void 0})}}}),[]);const ye=i.useCallback((()=>{X!==K.current.getNumRows()&&Q(K.current.getNumRows())}),[X]),we=i.useCallback((0,h.Ds)(150,(()=>{const e=K.current.toJson(ie);let n=w.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Le(0).toJson([])),e!==n&&w.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},S)})),[t.id,t.formId,w,S,ie,K.current]),{exportToCsv:xe}=nt(re,ie,X,O),{onCellEdited:Ce,onPaste:Me,onRowAppended:Ee,onDelete:Se,validateCell:ke}=it(ie,t.editingMode!==U,K,re,le,ve,ye,we,pe),{tooltip:Re,clearTooltip:Te,onItemHovered:Ne}=ot(ie,re),{drawCell:_e,customRenderers:Ie}=ut(ie),Oe=i.useMemo((()=>ie.map((e=>$(e)))),[ie]),{columns:De,onColumnResize:Ae}=ct(Oe),Fe=n.columns.length>1,{minHeight:Ve,maxHeight:ze,minWidth:Be,maxWidth:Pe,resizableSize:Ue,setResizableSize:Je}=pt(t,X,Fe,f,v,x),qe=i.useCallback((e=>{let[t,n]=e;return{...V(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:N.textLight},span:[0,Math.max(ie.length-1,0)]}}),[ie,N.textLight]);i.useEffect((()=>{if(!t.formId)return;const e=new m.K;return e.manageFormClearListener(w,t.formId,(()=>{ee(),pe()})),()=>{e.disconnect()}}),[t.formId,ee,pe,w]);const Ge=!q&&t.editingMode===U&&!y,Ke=q?0:ie.filter((e=>e.isIndex)).length;return i.useEffect((()=>{setTimeout((()=>{if(T.current&&R.current){var e,t;const n=null===(e=T.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(z(n.height>T.current.clientHeight),j(n.width>T.current.clientWidth))}}),1)}),[Ue,X,De]),(0,vt.jsxs)(Rt,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:Y,ref:T,onMouseDown:e=>{if(T.current&&Y){const t=T.current.getBoundingClientRect();W&&t.height-7<e.clientY-t.top&&e.stopPropagation(),L&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{D||B||e.currentTarget.contains(e.relatedTarget)||pe(!0,!0)},children:[(0,vt.jsxs)(p.Z,{isFullScreen:x,disableFullscreenMode:C,locked:fe&&!de||he||B&&D,onExpand:M,onCollapse:E,target:Rt,children:[(de&&fe||ce&&ge)&&(0,vt.jsx)(p.J,{label:"Clear selection",icon:a.x,onClick:()=>{pe(),Te()}}),Ge&&fe&&(0,vt.jsx)(p.J,{label:"Delete row(s)",icon:s.H,onClick:()=>{Se&&(Se(se),Te())}}),Ge&&!fe&&(0,vt.jsx)(p.J,{label:"Add row",icon:d.m,onClick:()=>{Ee&&(A(!0),Ee(),Te())}}),!G&&!q&&(0,vt.jsx)(p.J,{label:"Download as CSV",icon:u.k,onClick:()=>xe()}),!q&&(0,vt.jsx)(p.J,{label:"Search",icon:c.o,onClick:()=>{F?H(!1):(A(!0),H(!0)),Te()}})]}),(0,vt.jsx)(r.e,{"data-testid":"stDataFrameResizable",ref:k,defaultSize:Ue,style:{border:`1px solid ${N.borderColor}`,borderRadius:`${I}`},minHeight:Ve,maxHeight:ze,minWidth:Be,maxWidth:Pe,size:Ue,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,ft],snapGap:ft/3,onResizeStop:(e,t,n,i)=>{k.current&&Je({width:k.current.size.width,height:ze-k.current.size.height===mt?k.current.size.height+mt:k.current.size.height})},children:(0,vt.jsx)(l.F,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:R,columns:De,rows:q?1:X,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:ft,headerHeight:ft,getCellContent:q?qe:re,onColumnResize:B?void 0:Ae,resizeIndicator:"header",freezeColumns:Ke,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:B?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ne,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(H((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:F,onSearchClose:()=>{H(!1),Te()},onHeaderClicked:(e,t)=>{q||G||ce||(de&&fe&&pe(),oe(e))},gridSelection:se,onGridSelectionChange:e=>{(D||B)&&(be(e),void 0!==Re&&Te())},theme:N,onMouseMove:e=>{"out-of-bounds"===e.kind&&D?A(!1):"out-of-bounds"===e.kind||D||A(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...Y&&{paddingBottom:W?-6:void 0,paddingRight:L?-6:void 0}},drawCell:_e,customRenderers:Ie,imageEditorOverride:wt,headerIcons:_,validateCell:ke,onPaste:!1,...de&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:N.bgHeader,bgCellMedium:N.bgHeader}},rowSelectionMode:ue?"multi":"auto",rowSelect:y?"none":ue?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...ce&&{columnSelect:y?"none":me?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!q&&t.editingMode!==P&&!y&&{fillHandle:!B,onCellEdited:Ce,onPaste:Me,onDelete:Se},...!q&&t.editingMode===U&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:N.bgHeader,bgCellMedium:N.bgHeader}},rowSelectionMode:"multi",rowSelect:y?"none":"multi",onRowAppended:y?void 0:Ee,onHeaderClicked:void 0}})}),Re&&Re.content&&(0,vt.jsx)(kt,{top:Re.top,left:Re.left,content:Re.content,clearTooltip:Te})]})}),!0)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7579],{97579:(e,t,r)=>{r.r(t),r.d(t,{default:()=>C});var o=r(5057),s=r(7742),n=r.n(s),i=r(17966),l=r(9847),a=r(31808),d=r(82160),c=r(69194),h=r(70765);const u=(0,d.Z)(h.Q,{shouldForwardProp:c.Z,target:"e1se5lgy2"})((e=>{let{theme:t,usingCustomTheme:r}=e;return{fontSize:t.fontSizes.sm,width:"1.375rem",height:"1.375rem",borderWidth:"3px",radius:t.radii.md,justifyContents:"center",padding:t.spacing.none,margin:t.spacing.none,borderColor:t.colors.borderColor,borderTopColor:r?t.colors.primary:t.colors.blue70,flexGrow:0,flexShrink:0}}),""),g=(0,d.Z)("div",{target:"e1se5lgy1"})((e=>{let{theme:t,width:r,cache:o}=e;return{width:r,...o?{paddingBottom:"1rem",background:`linear-gradient(to bottom, ${t.colors.bgColor} 0%, ${t.colors.bgColor} 80%, transparent 100%)`}:null}}),""),m=(0,d.Z)("div",{target:"e1se5lgy0"})((e=>{let{theme:t}=e;return{display:"flex",gap:t.spacing.sm,alignItems:"center",width:"100%"}}),"");var p=r(96266);const C=function(e){let{width:t,element:r}=e;const{activeTheme:s}=o.useContext(a.E),d=!(0,i.MJ)(s),{cache:c}=r;return(0,p.jsx)(g,{className:n()({stSpinner:!0,stCacheSpinner:c}),"data-testid":"stSpinner",width:t,cache:c,children:(0,p.jsxs)(m,{children:[(0,p.jsx)(u,{usingCustomTheme:d}),(0,p.jsx)(l.ZP,{source:r.text,allowHTML:!1})]})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7696],{52955:(e,t,i)=>{i.d(t,{K:()=>r,O:()=>o});var s=i(5057),n=i(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.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}}function o(e){let{element:t,widgetMgr:i,onFormCleared:r}=e;(0,s.useEffect)((()=>{if(!(0,n.bM)(t.formId))return;const e=i.addFormClearedListener(t.formId,r);return()=>{e.disconnect()}}),[t,i,r])}},87696:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(5057),n=i(8708),r=i.n(n),o=i(55790),a=i(47206),l=i(59500),d=i(88084),h=i.n(d),m=i(52955),u=i(60913),c=i(50120),g=i(38944),p=i(93905),f=i(21034),b=i(98790),v=i(82160),T=i(59990);const y=(0,v.Z)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:i.sizes.sliderThumb,width:i.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,T.DZ)(i.colors.primary,.5)}`}}}),""),R=(0,v.Z)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),C=(0,v.Z)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),V=(0,v.Z)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var w=i(96266);class x extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new m.K,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{const{widgetMgr:t,element:i,fragmentId:s}=this.props;t.setDoubleArrayValue(i,this.state.value,e,s)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{const{$value:i,$thumbIndex:n}=e,o=n||0;this.thumbRef[o]=t,this.thumbValueRef[o]||=s.createRef();const a=i?this.formatValue(i[n]):"",l=r()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),d={};return(this.props.element.options.length>0||this.isDateTimeType())&&(d["aria-valuetext"]=a),(0,w.jsx)(y,{...l,disabled:!0===e.$disabled,ref:this.thumbRef[o],"aria-valuetext":a,"aria-label":this.props.element.label,children:(0,w.jsx)(R,{"data-testid":"stSliderThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[o],children:a})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,w.jsxs)(C,{"data-testid":"stSliderTickBar",children:[(0,w.jsx)(V,{disabled:e,"data-testid":"stSliderTickBarMin",children:this.formatValue(s)}),(0,w.jsx)(V,{disabled:e,"data-testid":"stSliderTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,c.Ds)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],n=i.length>1?i[1]:i[0];return s>n&&(s=n),s<e&&(s=e),s>t&&(s=t),n<e&&(n=e),n>t&&(n=t),i.length>1?[s,n]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===u.iR.DataType.DATETIME||e===u.iR.DataType.DATE||e===u.iR.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?h().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.left+n.width/2,a=o-r.width/2<s.left,l=o+r.width/2>s.right;i.style.left=a?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const n=this.sliderRef.current,r=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,o=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,a=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(n,r,a),this.alignValueOnThumb(n,o,l),n&&r&&o&&a&&l){const e=n.getBoundingClientRect(),t=r.getBoundingClientRect(),i=o.getBoundingClientRect(),s=a.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?a.style.right=d.width+16-(i.right-t.right)+"px":l.style.left=s.width+16-(i.left-t.left)+"px"}}}render(){var e;const{disabled:t,element:i,theme:s,width:n,widgetMgr:r}=this.props,{colors:a,fonts:l,fontSizes:d,spacing:h}=s,m={width:n};return this.formClearHelper.manageFormClearListener(r,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,w.jsxs)("div",{ref:this.sliderRef,className:"stSlider","data-testid":"stSlider",style:m,children:[(0,w.jsx)(g.O,{label:i.label,disabled:t,labelVisibility:(0,c.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,w.jsx)(p.dT,{children:(0,w.jsx)(f.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,w.jsx)(o.Z,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:h.none,paddingLeft:h.none,paddingRight:h.none,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:"4px",...t?{background:a.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,a.b)(x)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7809],{17809:(e,t,o)=>{o.r(t),o.d(t,{default:()=>xe});var i=o(5057),n=o(59663),r=o(87333),l=o(98899),a=o(31324),s=o(719),c=o(47206),d=o(99430),h=o(17966),u=o(75813),g=o(10266),m=o(60913);var p=o(56129),b=o.n(p),f=o(69178),y=o(64327),v=o(24589),w=o(31808),S=o(87672),x=o(96266);const j=e=>{let{error:t,width:o,deltaType:i}=e;return t instanceof C?(0,x.jsx)(S.Z,{width:o,name:"No Mapbox token provided",message:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("p",{children:["To use ",(0,x.jsxs)("code",{children:["st.",i]})," or ",(0,x.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,x.jsxs)("p",{children:["To get a token, create an account at"," ",(0,x.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,x.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,x.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,x.jsxs)("p",{children:["See"," ",(0,x.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof k?(0,x.jsx)(S.Z,{width:o,name:"Error fetching Streamlit Mapbox token",message:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{children:"This app requires an internet connection."}),(0,x.jsx)("p",{children:"Please check your connection and try again."}),(0,x.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,x.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,x.jsx)(S.Z,{width:o,name:"Error fetching Streamlit Mapbox token",message:t.message})};class C extends Error{}class k extends Error{}const F="https://data.streamlit.io/tokens.json",M="mapbox",Z=e=>t=>{class o extends i.PureComponent{constructor(o){super(o),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await f.Z.get(F),{[M]:t}=e.data;if(!t)throw new Error(`Missing token ${M}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,y.b)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new k(`${t.message} (${F})`)}},this.render=()=>{const{mapboxToken:o,mapboxTokenError:i,isFetching:n}=this.state,{width:r}=this.props;return i?(0,x.jsx)(j,{width:r,error:i,deltaType:e}):n?(0,x.jsx)(v.O,{element:m.Od.create({style:m.Od.SkeletonStyle.ELEMENT})}):(0,x.jsx)(t,{...this.props,mapboxToken:o,width:r})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return o.displayName=`withMapboxToken(${t.displayName||t.name})`,o.contextType=w.E,b()(o,t)};var T=o(82160);const N=(0,T.Z)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:o}=e;return{position:"relative",height:o,width:t}}),""),E=(0,T.Z)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:1,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:"hidden",background:t.colors.bgColor},"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"&.mapboxgl-ctrl-icon:hover":{backgroundColor:(0,h.Iy)(t)?"":t.colors.darkenedBgMix25},"& span":{filter:(0,h.Iy)(t)?"":"invert(100%)"}}}}),"");var O=o(41656),I=o(50482),V=o.n(I),P=o(59990);var $=o(63285),A=o(12136),W=o(34971),J=o(57440),U=o(5156),z=o(72212),D=o(80552),L=o(27373);const _={classes:{...z,...o(65815),...L,...o(50256),CartoLayer:A.Z},functions:{colorBins:W.Z,colorCategories:J.Z,colorContinuous:U.Z}},B=new D.Z({configuration:_});var G=o(95043),q=o(52301),R=o(23855),X=o(68909),H=o(12897),K=o(27087),Q=o(68171),Y=o(34768),ee=o(79886),te=o(45215),oe=o(33371),ie=o(66425),ne=o(38692),re=o(48856),le=o(87667),ae=o(42025),se=o(10979),ce=o(72899),de=o(46430),he=o(98534);const ue={[ie.Z.layerName]:["getFillColor"],[ne.Z.layerName]:["getFillColor"],[re.ZP.layerName]:["getFillColor"],[le.Z.layerName]:["getFillColor"],[ae.Z.layerName]:["getFillColor"],[se.Z.layerName]:["getFillColor"],[ce.Z.layerName]:["getColor"],[G.Z.layerName]:["getTargetColor","getSourceColor"],[q.Z.layerName]:["getFillColor"],[R.Z.layerName]:["getFillColor"],[X.Z.layerName]:["getColor"],[H.Z.layerName]:["getColor"],[K.Z.layerName]:["getColor"],[Q.Z.layerName]:["getColor"],[Y.Z.layerName]:["getFillColor"],[ee.Z.layerName]:["getFillColor","getColor","getLineColor"],[te.Z.layerName]:["getFillColor"],[oe.Z.layerName]:["getColor"],[de.Z.layerName]:["getColor"],[he.Z.layerName]:["getColor"]},ge=e=>{let{isSelected:t,object:o,objectInfo:i,opacity:n,originalFillFunction:r}=e;const l=(e=>{let{object:t,objectInfo:o,originalFillFunction:i}=e;const n="function"===typeof i?i(t,o):i;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if("string"===typeof n&&n.startsWith("@@=")){const e=B.convert({originalColor:n}).originalColor(t);return[e[0]||0,e[1]||0,e[2]||0,e[3]||255]}return null})({object:o,objectInfo:i,originalFillFunction:r});if(!l)return null;let a=0;return a=t?Math.max("number"===typeof l[3]?l[3]:n,n):Math.min("number"===typeof l[3]?l[3]:n,n),[l[0]||0,l[1]||0,l[2]||0,a]},me={selection:{indices:{},objects:{}}},pe=(e,t)=>{const o=t.match(/{(.*?)}/g);return o&&o.forEach((o=>{const i=o.substring(1,o.length-1);e.object.hasOwnProperty(i)?t=t.replace(o,e.object[i]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(i)&&(t=t.replace(o,e.object.properties[i]))})),t};function be(e,t){if(!t.id)return me;const o=e.getElementState(t.id,"selection");return null!==o&&void 0!==o?o:me}function fe(e,t){if(!t.id)return me;const o=e.getStringValue(t),i=o?O.Z.parse(o):null;return null!==i&&void 0!==i?i:me}function ye(e,t,o,i){e.id&&t.setStringValue(e,JSON.stringify(o.value),{fromUi:o.fromUi},i)}const ve=e=>{var t;const{element:o,fragmentId:n,height:r,isFullScreen:l,isLightTheme:a,theme:s,widgetMgr:c,width:d}=e,{selectionMode:h,tooltip:u,useContainerWidth:g}=o,m=null!==l&&void 0!==l&&l,[p,b]=(0,$.P)({element:o,getDefaultState:be,getStateFromWidgetMgr:fe,updateWidgetMgrState:ye,widgetMgr:c,fragmentId:n}),[f,y]=(0,i.useState)({bearing:0,pitch:0,zoom:11}),{height:v,width:w}=(e=>{let{container:t,element:o,heightFallback:n="auto",isFullScreen:r,shouldUseContainerWidth:l,widthFallback:a="auto"}=e;return{width:(0,i.useMemo)((()=>l||r?"100%":o.width||t.width||a),[t.width,o.width,r,l,a]),height:(0,i.useMemo)((()=>r&&t.height?t.height:o.height||t.height||n),[r,o.height,t.height,n])}})({element:o,isFullScreen:m,shouldUseContainerWidth:g,container:{height:r,width:d},heightFallback:(null===(t=f.initialViewState)||void 0===t?void 0:t.height)||500}),[S,x]=(0,i.useState)({}),j=h[0],C=void 0!==j,k=C&&Object.keys(p.selection.indices).length>0,F=(0,i.useMemo)((()=>Object.freeze(O.Z.parse(o.json))),[m,a,o.json]),M=(0,i.useMemo)((()=>{const e={...F};if(e.mapStyle||(e.mapStyle=`mapbox://styles/mapbox/${a?"light":"dark"}-v9`),m?Object.assign(e.initialViewState,{width:w,height:v}):(e.initialViewState.height||(e.initialViewState.height=500),g&&(e.initialViewState.width=w)),e.layers){const t=Object.values(p.selection.indices).some((e=>null===e||void 0===e?void 0:e.length)),o=e.layers.some((e=>Object.hasOwn(e,"pickable")));e.layers=e.layers.map((e=>{var i,n;if(!e||Array.isArray(e)||!C)return e;o||(e.pickable=!0);const r=`${e.id||null}`,l=(null===p||void 0===p||null===(i=p.selection)||void 0===i||null===(n=i.indices)||void 0===n?void 0:n[r])||[],a=ue[e["@@type"]];if(!a)return e;const c={...e};return a.forEach((o=>{var i;c.updateTriggers={[o]:[...(null===(i=c.updateTriggers)||void 0===i?void 0:i[o])||[],l,t]};const n=!t,r=e[o];if(n||!r)return c;const a=Math.floor(102),d=(0,P.dF)(s.colors.primary),h=[d[0],d[1],d[2],255],u=(0,P.dF)(s.colors.gray20),g=[u[0],u[1],u[2],a];c[o]=(e,t)=>(e=>{let{isSelected:t,object:o,objectInfo:i,originalFillFunction:n,selectedColor:r,selectedOpacity:l=255,unselectedColor:a,unselectedOpacity:s=Math.floor(102)}=e;return t?ge({opacity:l,isSelected:!0,object:o,objectInfo:i,originalFillFunction:n})||r:ge({opacity:s,isSelected:!1,object:o,objectInfo:i,originalFillFunction:n})||a})({isSelected:l.includes(t.index),object:e,objectInfo:t,originalFillFunction:r,selectedColor:h,unselectedColor:g,selectedOpacity:255,unselectedOpacity:a})})),c}))}return null===e||void 0===e||delete e.views,B.convert(e)}),[p.selection.indices,v,m,a,C,F,g,s.colors.gray20,s.colors.primary,w]);(0,i.useEffect)((()=>{if(!V()(M.initialViewState,S)){const e=Object.keys(M.initialViewState).reduce(((e,t)=>M.initialViewState[t]===S[t]?e:{...e,[t]:M.initialViewState[t]}),{});y({...f,...e}),x(M.initialViewState)}}),[M.initialViewState,S,f]);const Z=(0,i.useCallback)((e=>{if(!e||!e.object||!u)return null;const t=O.Z.parse(u);return t.html?t.html=pe(e,t.html):t.text=pe(e,t.text),t}),[u]),T=(0,i.useCallback)((e=>{let{viewState:t}=e;y(t)}),[y]);return{createTooltip:Z,data:p,deck:M,hasActiveSelection:k,height:v,isSelectionModeActivated:C,onViewStateChange:T,selectionMode:j,setSelection:b,viewState:f,width:w}};o(20512);(0,s.fh)([l.w,a.E]);const we=me.selection,Se=[],xe=Z("st.pydeck_chart")((0,g.Z)((e=>{const{collapse:t,disabled:o,disableFullscreenMode:l,element:a,expand:s,fragmentId:g,height:p,isFullScreen:b,mapboxToken:f,widgetMgr:y,width:v}=e,{mapboxToken:w}=a,S=(0,c.u)(),{createTooltip:j,data:C,deck:k,hasActiveSelection:F,height:M,isSelectionModeActivated:Z,onViewStateChange:T,selectionMode:O,setSelection:I,viewState:V,width:P}=ve({element:a,fragmentId:g,height:p,isFullScreen:b,isLightTheme:(0,h.Iy)(S),theme:S,widgetMgr:y,width:v}),[$,A]=(0,i.useState)(!1);(0,i.useEffect)((()=>{A(!0)}),[]);const W=(0,i.useCallback)((e=>{var t;if(void 0===O)return;const{index:o,object:i}=e,n=`${(null===(t=e.layer)||void 0===t?void 0:t.id)||null}`,r=C,l=-1===o,a=(()=>{if(l)return we;switch(O){case m.oJ.SelectionMode.SINGLE_OBJECT:var e;return(null===(e=r.selection.indices[n])||void 0===e?void 0:e[0])===o?we:{indices:{[`${n}`]:[o]},objects:{[`${n}`]:[i]}};case m.oJ.SelectionMode.MULTI_OBJECT:{const e=new Map(((null===r||void 0===r||null===(t=r.selection)||void 0===t||null===(a=t.indices)||void 0===a?void 0:a[n])||[]).map(((e,t)=>{var o,i,l;return[e,null===(o=r.selection)||void 0===o||null===(i=o.objects)||void 0===i||null===(l=i[n])||void 0===l?void 0:l[t]]})));if(e.has(o)?e.delete(o):e.set(o,i),0===e.size){const{[n]:e,...t}=r.selection.indices,{[n]:o,...i}=r.selection.objects;return{indices:t,objects:i}}return{indices:{...r.selection.indices,[`${n}`]:Array.from(e.keys())},objects:{...r.selection.objects,[`${n}`]:Array.from(e.values())}}}default:throw(e=>{throw new Error(`Reached a branch with non-exhaustive item: ${e}`)})(O),new Error("Invalid selection mode")}var t,a})();JSON.stringify(a)!==JSON.stringify(r.selection)&&I({fromUi:!0,value:{selection:a}})}),[O,C,I]),J=(0,i.useCallback)((()=>{I({value:{selection:we},fromUi:!0})}),[I]);return(0,x.jsxs)(N,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:P,height:M,children:[(0,x.jsx)(u.Z,{isFullScreen:b,disableFullscreenMode:l,onExpand:s,onCollapse:t,target:N,locked:!(!F||o)||void 0,children:F&&!o&&(0,x.jsx)(u.J,{label:"Clear selection",onClick:J,icon:d.x})}),(0,x.jsxs)(n.Z,{viewState:V,onViewStateChange:T,height:M,width:P,layers:$?k.layers:Se,getTooltip:j,ContextProvider:r.X$.Provider,controller:!0,onClick:Z&&!o?W:void 0,children:[(0,x.jsx)(r.Z3,{height:M,width:P,mapStyle:k.mapStyle&&("string"===typeof k.mapStyle?k.mapStyle:k.mapStyle[0]),mapboxApiAccessToken:w||f}),(0,x.jsx)(E,{children:(0,x.jsx)(r.Pv,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})}),!0))},63285:(e,t,o)=>{o.d(t,{P:()=>l,w:()=>a});var i=o(5057),n=o(52955),r=o(50120);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:o,updateWidgetMgrState:l,element:a,widgetMgr:s,fragmentId:c}=e;const[d,h]=(0,i.useState)((()=>{var e;return null!==(e=t(s,a))&&void 0!==e?e:o(s,a)})),[u,g]=(0,i.useState)({value:d,fromUi:!1});(0,i.useEffect)((()=>{(0,r.le)(u)||(g(null),h(u.value),l(a,s,u,c))}),[u,l,a,s,c]);const m=(0,i.useCallback)((()=>{g({value:o(s,a),fromUi:!0})}),[g,a,o,s]);return(0,n.O)({widgetMgr:s,element:a,onFormCleared:m}),[d,g]}function a(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:o,getCurrStateFromProto:n,updateWidgetMgrState:r,element:a,widgetMgr:s,fragmentId:c}=e;const d=(0,i.useCallback)(((e,t)=>o(t)),[o]),[h,u]=l({getStateFromWidgetMgr:t,getDefaultState:d,updateWidgetMgrState:r,element:a,widgetMgr:s,fragmentId:c});return(0,i.useEffect)((()=>{a.setValue&&(a.setValue=!1,u({value:n(a),fromUi:!1}))}),[a,n,u]),[h,u]}}}]);