1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2894],{72894:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var i=s(74848),a=s(96540),o=s(74368),n=s(86715),r=s(98047),p=s(67265),l=s(98126),h=s(27116),c=s(47819),d=s(10059),u=s(97461),m=s(92849),_=s.n(m);let g={toggleChangeProfileNamePopup:r.$d,clickHouseShoot:l.Y3,pushStackAddItem:p.nD};class k extends a.Component{componentDidMount(){let{clickHouseData:e}=this.props.systemInformation,{prevName:t}=this.props,{authData:s}=this.props.registration;this.setState({name:t||""});let i={...e,action_id:"popupview",screen_attributes_ab_tag:s&&s.tags?s.tags:"",event_version:"1.0",screen_type:"settings",screen_attributes_id:"settings",block_type:"popup",block_attributes_id:"account_name",event_time:new Date().getTime()};this.props.clickHouseShoot(this.apiUrl,this.apiKey,i)}render(){let{name:e,errorName:t,errorNameMessage:s,blockInfo:a,loading:o}=this.state,{deviceData:n}=this.props.systemInformation,r="desktop_web"===n?u.GO.REGULAR:u.GO.MEDIUM;return(0,i.jsx)("div",{className:_()["start-popup"],onMouseDown:this.handleClickOutside,onKeyDown:this.handleKeyDown,children:(0,i.jsxs)("div",{className:_()["start-popup__wrapper"],ref:e=>{this.popupWrapper=e},children:[(0,i.jsx)("div",{className:_()["start-popup__close"],onClick:()=>this.closeHandler("click","button","cross"),children:(0,i.jsx)("img",{src:"/static/images/popups/cross-white.svg"})}),(0,i.jsxs)("div",{className:_()["start-popup__content"],children:[(0,i.jsx)("div",{className:_()["start-popup__title"],children:"ÐÑедÑÑавÑÑеÑÑ, пожалÑйÑÑа"}),(0,i.jsx)(d.A,{value:e,label:"ÐаÑе имÑ",error:t,errorText:s,onChange:this.setNameHandler,onValidate:this.checkValidate,onFocus:this.handleFocus,onBlur:this.handleBlur,type:"textName",blockInfo:a,updatedType:"account_name",needActionResult:!0,id:"name",testid:"popup_info_name",darkTheme:!0})]}),(0,i.jsx)(u.$n,{size:r,onClick:this.handleSubmitClick,"data-testid":"popup_info_save",title:"СоÑ
ÑаниÑÑ",isLoading:o,fullWidth:!0})]})})}constructor(...e){super(...e),this.state={name:"",errorName:!1,errorNameMessage:"",blockInfo:{block_type:"popup",block_attributes_id:"account_name",screen_type:"settings",screen_attributes_id:"settings"},loading:!1},this.apiUrl=this.props.systemInformation.API_URL||h.H$,this.apiKey=this.props.systemInformation.API_KEY||h.Lq,this.sendEvents=(e,t,s,i,a)=>{let{clickHouseData:o}=this.props.systemInformation,{authData:n}=this.props.registration,r={...o,action_id:e,action_result:a||"",screen_attributes_ab_tag:n&&n.tags?n.tags:"",event_version:"1.0",screen_type:"settings",screen_attributes_id:"settings",block_type:"popup",block_attributes_id:"account_name",element_type:t||"",element_attributes_id:s||"",element_attributes_text:i||"",event_time:new Date().getTime()};this.props.clickHouseShoot(this.apiUrl,this.apiKey,r)},this.setNameHandler=e=>{let{value:t}=e.target;/^[a-zA-Zа-ÑÐ-Я ÑÐ]*$/.test(t)?t.trim().length>50?this.setState({name:t,errorName:!0,errorNameMessage:"ÐÐ¼Ñ ÑлиÑком длинное. ÐакÑимÑм 50 Ñимволов"}):this.setState({name:t,errorName:!1,errorNameMessage:""}):this.setState({name:t,errorName:!0,errorNameMessage:"ÐÐ¼Ñ Ð¼Ð¾Ð¶Ð½Ð¾ напиÑаÑÑ ÐºÐ¸ÑиллиÑей или лаÑиниÑей"})},this.checkValidate=(e,t)=>{},this.handleSubmitClick=()=>{let{name:e,errorName:t}=this.state,{prevName:s}=this.props;if(e===s){this.props.toggleChangeProfileNamePopup(!1);return}if(this.sendEvents("click","button","save"),!t){var i;this.setState({loading:!0});let t={name:(null==e?void 0:null===(i=e.trim())||void 0===i?void 0:i.length)?e.trim():null};fetch("".concat(this.apiUrl).concat(c.PI.profileInfoName).concat(this.apiKey),{credentials:"include",method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>{e.status<400&&e.json().then(e=>{e.success&&this.props.setProfileName(e.data),this.props.toggleChangeProfileNamePopup(!1),this.props.pushStackAddItem({text:"ÐÐ·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑоÑ
ÑаненÑ"})}),this.setState({loading:!1})})}},this.closeHandler=(e,t,s)=>{this.sendEvents(e,t,s),this.props.toggleChangeProfileNamePopup(!1)},this.handleKeyDown=e=>
1{27===e.keyCode&&this.closeHandler(),13===e.keyCode&&this.handleSubmitClick()},this.handleClickOutside=e=>{this.popupWrapper&&!this.popupWrapper.contains(e.target)&&this.closeHandler()}}}let b=(0,n.withRouter)((0,o.Ng)(e=>({toggle:e.toggle,profile:e.profile,systemInformation:e.systemInformation,registration:e.registration}),g)(k))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.