File: C:/Users/fred/anaconda3/Lib/site-packages/streamlit/static/static/js/3599.565b1eba.chunk.js
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3599],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:s,type:a="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&p("Press Enter to ".concat(t))}return n&&("chat"!==a||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},83599:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>g});var n=r(66845),o=r(118),i=r(25621),s=r(70479),a=r.n(s),l=r(87814),u=r(79986),c=r(98478),d=r(86659),p=r(8879),h=r(68411),f=r(50641),m=r(48266),y=r(40864);class b extends n.PureComponent{get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=t=>{const{widgetMgr:e,element:r,fragmentId:n}=this.props;e.setStringValue(r,this.state.value,t,n),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||this.setState({dirty:!0,value:e})},this.isEnterKeyPressed=t=>{var e;const{keyCode:r,key:n}=t;return("Enter"===n||13===r||10===r)&&!(!0===(null===(e=t.nativeEvent)||void 0===e?void 0:e.isComposing))},this.onKeyDown=t=>{const{metaKey:e,ctrlKey:r}=t,{dirty:n}=this.state;if(this.isEnterKeyPressed(t)&&(r||e)&&n){t.preventDefault(),this.commitWidgetValue({fromUi:!0});const{formId:e}=this.props.element;(0,f.$b)({formId:e})&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId)}},this.id=a()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var t;const{element:e,disabled:r,width:n,widgetMgr:i,theme:s}=this.props,{value:a,dirty:l}=this.state,b={width:n},{height:g,placeholder:v}=e;return this.formClearHelper.manageFormClearListener(i,e.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:b,children:[(0,y.jsx)(c.O,{label:e.label,disabled:r,labelVisibility:(0,f.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,y.jsx)(d.dT,{children:(0,y.jsx)(p.Z,{content:e.help,placement:h.u.TOP_RIGHT})})}),(0,y.jsx)(o.Z,{value:null!==a&&void 0!==a?a:"",placeholder:v,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":e.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:s.lineHeights.inputWidget,height:g?"".concat(g,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:s.spacing.lg,paddingLeft:s.spacing.lg,paddingBottom:s.spacing.lg,paddingTop:s.spacing.lg}},Root:{props:{"data-testid":"stTextInput-RootElement"},style:{borderLeftWidth:s.sizes.borderWidth,borderRightWidth:s.sizes.borderWidth,borderTopWidth:s.sizes.borderWidth,borderBottomWidth:s.sizes.borderWidth}}}}),n>m.A.hideWidgetDetails&&(0,y.jsx)(u.Z,{dirty:l,value:null!==a&&void 0!==a?a:"",maxLength:e.maxChars,type:"multiline",inForm:(0,f.$b)({formId:e.formId})})]})}}const g=(0,i.b)(b)},118:(t,e,r)=>{"use strict";r.d(e,{Z:()=>F});var n=r(66845),o=r(80318),i=r(9656),s=r(38254),a=r(80745),l=r(98479);function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=(0,a.zo)("div",(function(t){return c(c({},(0,l.d5)(c(c({$positive:!1},t),{},{$hasIconTrailing:!1}))),{},{width:t.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var h=(0,a.zo)("div",(function(t){return(0,l.hB)(c({$positive:!1},t))}));h.displayName="StyledTextareaContainer",h.displayName="StyledTextareaContainer";var f=(0,a.zo)("textarea",(function(t){return c(c({},(0,l.Hx)(t)),{},{resize:t.$resize||"none"})}));function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},y.apply(this,arguments)}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return g(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,e)}(t,e)||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 g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function w(t){var e=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(t){return!1}}();return function(){var r,n=x(t);if(e){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===m(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return j(t)}(this,r)}}function j(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}f.displayName="StyledTextarea",f.displayName="StyledTextarea";var C=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(u,t);var e,r,a,l=w(u);function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return P(j(t=l.call.apply(l,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),P(j(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),P(j(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=u,(r=[{key:"render",value:function(){var t=this.props.overrides,e=void 0===t?{}:t,r=b((0,o.jb)(e.Root,p),2),a=r[0],l=r[1],u=(0,o.aO)({Input:{component:f},InputContainer:{component:h}},e);return n.createElement(a,y({"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,y({},this.props,{type:s.iB.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(e.prototype,r),a&&v(e,a),Object.defineProperty(e,"prototype",{writable:!1}),u}(n.Component);P(C,"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:s.NO.default});const F=C},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);