TelegramPWA/dist/7074.5ab982542c4f2180b00d.js
Alexander Zinchuk 236dfc0cd2 [Build]
2023-06-21 18:35:31 +02:00

2 lines
3.4 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7074],{99364:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(57710),r=n(83716),i=n(863),s=n(46752),l=n(3858),c=n(59107),u=n(28183),d=n(42797),p=n(231);const m=(0,o.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:m,hint:h,placeholder:f="Password",submitLabel:b="Next",description:Z,shouldShowSubmit:g,shouldResetValue:w,shouldDisablePasswordManager:v=!1,noRipple:y=!1,clearError:P,onChangePasswordVisibility:C,onInputChange:E,onSubmit:N}=e;const k=(0,o.sO)(null),I=(0,c.Z)(),{isMobile:x}=(0,d.ZP)(),[D,L]=(0,o.eJ)(""),[M,J]=(0,o.eJ)(!1),S=x?550:400;return(0,o.d4)((()=>{w&&L("")}),[w]),(0,u.Z)((()=>{i.$b||k.current.focus()}),S),(0,o.d4)((()=>{m&&(0,a.WM)((()=>{k.current.focus(),k.current.select()}))}),[m]),o.ZP.createElement("form",{action:"",onSubmit:N?function(e){e.preventDefault(),t||M&&N(D)}:l.Z,autoComplete:"off"},o.ZP.createElement("div",{className:(0,s.Z)("input-group password-input",D&&"touched",m&&"error"),dir:I.isRtl?"rtl":void 0},v&&o.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),o.ZP.createElement("input",{ref:k,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:D||"",autoComplete:v?"one-time-code":"current-password",onChange:function(e){m&&P();const{target:t}=e;L(t.value),J(t.value.length>=r.loe),E&&E(t.value)},maxLength:256,dir:"auto"}),o.ZP.createElement("label",null,m||h||f),o.ZP.createElement("div",{className:"div-button toggle-password",onClick:function(){C(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},o.ZP.createElement("i",{className:(0,s.Z)("icon",n?"icon-eye":"icon-eye-closed")}))),Z&&o.ZP.createElement("p",{className:"description"},Z),N&&(M||g)&&o.ZP.createElement(p.Z,{type:"submit",ripple:!y,isLoading:t,disabled:!M},b))}))},66735:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(83716),r=n(71394),i=n(59107),s=n(231),l=n(13103),c=n(34288);const u={type:"blob",quality:1,format:"jpeg",circle:!1,size:{width:1024,height:1024}};let d,p,m;const h=(0,o.X$)((e=>{let{file:t,onChange:h,onClose:f}=e;const[b,Z]=(0,o.eJ)(!1);(0,o.d4)((()=>{t&&(b?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:n,offsetHeight:o}=t;m=new d(t,{enableZoom:!0,boundary:{width:n,height:o},viewport:{width:n-16,height:o-16,type:"circle"}});const a=await(0,r.YJ)(e);await m.bind({url:a})}catch(e){a.eMD&&console.error(e)}}(t):async function(){return p||(p=n.e(3472).then(n.bind(n,23472)),d=(await p).default),p}().then((()=>Z(!0))))}),[t,b]);const g=(0,i.Z)(),w=(0,o.I4)((async()=>{if(!m)return;const e=await m.result(u),t="string"==typeof e?e:(0,r.hl)(e,"avatar.jpg");h(t)}),[h]);return o.ZP.createElement(l.Z,{isOpen:Boolean(t),onClose:f,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},b?o.ZP.createElement("div",{id:"avatar-crop"}):o.ZP.createElement(c.Z,null),o.ZP.createElement(s.Z,{className:"confirm-button",round:!0,color:"primary",onClick:w,ariaLabel:g("CropImage")},o.ZP.createElement("i",{className:"icon icon-check"})))}))},28183:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(60748);const a=function(e,t){const n=(0,o.sO)(e);(0,o.bt)((()=>{n.current=e}),[e]),(0,o.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n.current()),t);return()=>clearTimeout(e)}),[t])}},3858:(e,t,n)=>{n.d(t,{Z:()=>o});const o=e=>{e.stopPropagation(),e.preventDefault()}}}]);
//# sourceMappingURL=7074.5ab982542c4f2180b00d.js.map