tweb/public/14.ff7f481451a1c540b82d.chunk.js
Eduard Kuzmenko e793a329d0 Build
2021-07-17 19:40:58 +03:00

2 lines
27 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(this.webpackJsonp=this.webpackJsonp||[]).push([[14,7,21,29],{18:function(e,t,n){"use strict";n.r(t);var i=n(35),s=n(42),a=n(105),o=n(14),r=n(27),l=n(28),c=n(60),u=n(36),d=n(45),h=n(31),p=n(0),f=n(71),m=n(15),g=n(4),b=n(53),v=n(12),y=n(46),L=n(16),S=n(54),E=n(3),w=n(56),k=n(87),O=n(80),T=n(20),x=n(82),j=n(2),A=n(29),_=n(33),N=n(48),C=n(59),P=function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function r(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};let D,F=null;const H=new c.a("page-sign",!0,()=>{b.a.test&&(a.b.push({name:"Test Country",phoneCode:"999 66",code:"TC",emoji:"🤔",pattern:"999 66 XXX XX"}),console.log("Added test country to list!"));const e=a.b.filter(e=>e.emoji).sort((e,t)=>e.name.localeCompare(t.name));let t=null;const c=document.createElement("div");c.classList.add("input-wrapper");const L=new u.b({label:"Login.CountrySelectorLabel",name:Object(w.b)(),plainText:!0});L.container.classList.add("input-select");const R=L.input;R.autocomplete=Object(w.b)();const M=document.createElement("div");M.classList.add("select-wrapper","z-depth-3","hide");const I=document.createElement("span");I.classList.add("arrow","arrow-down"),L.container.append(I);const V=document.createElement("ul");M.appendChild(V);new s.b(M);let B=()=>{B=null,e.forEach(e=>{const t=e.emoji,n=[];e.phoneCode.split(" and ").forEach(i=>{const s=document.createElement("li");let a=l.a.wrapEmojiText(t);if(l.a.emojiSupported){const e=document.createElement("span");e.innerHTML=a,s.append(e)}else s.innerHTML=a;s.append(e.name);const o=document.createElement("span");o.classList.add("phone-code"),o.innerText="+"+i,s.appendChild(o),n.push(s),V.append(s)}),e.li=n}),V.addEventListener("mousedown",e=>{if(0!==e.button)return;let t=e.target;"LI"!==t.tagName&&(t=Object(S.a)(t,"LI")),U(t)}),L.container.appendChild(M)};const U=n=>{const i=n.childNodes[1].textContent,s=n.querySelector(".phone-code").innerText;R.value=i,t=e.find(e=>e.name===i),X.value=G=s,Q(),setTimeout(()=>X.focus(),0)};let q;B(),R.addEventListener("focus",(function(t){B?B():e.forEach(e=>{e.li.forEach(e=>e.style.display="")}),clearTimeout(q),q=void 0,M.classList.remove("hide"),M.offsetWidth,M.classList.add("active"),L.select(),Object(f.b)(H.pageEl.parentElement.parentElement,R,"start",4),setTimeout(()=>{$||(document.addEventListener("mousedown",W,{capture:!0}),$=!0)},0)}));let $=!1;const W=e=>{Object(E.a)(e.target,"input-select")||e.target!==R&&(Q(),document.removeEventListener("mousedown",W,{capture:!0}),$=!1)},Q=()=>{void 0===q&&(M.classList.remove("active"),q=window.setTimeout(()=>{M.classList.add("hide"),q=void 0},200))};R.addEventListener("keyup",(function(t){if(t.ctrlKey||"Control"===t.key)return!1;let n=this.value.toLowerCase(),i=[];e.forEach(e=>{let t=-1!==e.name.toLowerCase().indexOf(n);e.li.forEach(e=>e.style.display=t?"":"none"),t&&i.push(e)}),0===i.length?e.forEach(e=>{e.li.forEach(e=>e.style.display="")}):1===i.length&&"Enter"===t.key&&U(i[0].li[0])})),I.addEventListener("mousedown",(function(e){e.cancelBubble=!0,e.preventDefault(),R.matches(":focus")?R.blur():R.focus()}));let K=!1,G="";const z=new u.b({label:"Login.PhoneLabel",plainText:!0,name:"phone"});let X=z.input;X.type="tel",X.autocomplete="rr55RandomRR55",X.addEventListener("input",(function(e){this.classList.remove("error"),y.b.loadLottieWorkers();const n=this.value;let s,a;if(Math.abs(n.length-G.length)>1&&!K&&p.isAppleMobile&&(this.value=G+n),K=!1,z.setLabel(),"+"===this.value.replace(/\++/,"+"))this.value="+";else{const e=Object(i.c)(this.value);s=e.formatted,a=e.country,this.value=G=s?"+"+s:""}let o=a?a.name:"";o===R.value||t&&a&&t.phoneCode===a.phoneCode||(R.value=o,t=a),a||this.value.length-1>1?F.style.visibility="":F.style.visibility="hidden"})),X.addEventListener("paste",e=>{K=!0}),X.addEventListener("keypress",(function(e){return F.style.visibility||"Enter"!==e.key?!/\D/.test(e.key)||e.metaKey||e.ctrlKey||"Backspace"===e.key||"+"===e.key&&e.shiftKey?void 0:(e.preventDefault(),!1):Y()}));const J=new d.a({text:"Login.KeepSigned",name:"keepSession",withRipple:!0,checked:!0});J.input.addEventListener("change",()=>{const e=J.checked;o.default.pushToState("keepSigned",e),k.a.toggleStorage(e),O.a.toggleStorage(e),r.a.toggleStorage(e),C.a.toggleStorage(e)}),o.default.getState().then(e=>{o.default.storage.isAvailable()?J.checked=e.keepSigned:(J.checked=!1,J.label.classList.add("checkbox-disabled"))}),F=Object(h.a)("btn-primary btn-color-primary",{text:"Login.Next"}),F.style.visibility="hidden";const Y=e=>{e&&Object(j.a)(e);const t=Object(N.a)([F,D],!0);Object(_.a)(F,Object(v.i18n)("PleaseWait")),Object(i.f)(F);let s=X.value;r.a.invokeApi("auth.sendCode",{phone_number:s,api_id:g.a.id,api_hash:g.a.hash,settings:{_:"codeSettings"}}).then(e=>{n.e(23).then(n.bind(null,21)).then(t=>t.default.mount(Object.assign(e,{phone_number:s})))}).catch(e=>{switch(t(),e.type){case"PHONE_NUMBER_INVALID":z.setError(),Object(_.a)(z.label,Object(v.i18n)("Login.PhoneLabelInvalid")),X.classList.add("error"),Object(_.a)(F,Object(v.i18n)("Login.Next"));break;default:console.error("auth.sendCode error:",e),F.innerText=e.type}})};Object(A.b)(F,Y),D=Object(h.a)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Login.QR.Login"});D.addEventListener("click",()=>{T.default.mount()}),c.append(L.container,z.container,J.label,F,D);const Z=document.createElement("h4");Object(v._i18n)(Z,"Login.Title");const ee=document.createElement("div");ee.classList.add("subtitle"),Object(v._i18n)(ee,"Login.StartText"),H.pageEl.querySelector(".container").append(Z,ee,c);m.isTouchSupported||setTimeout(()=>{X.focus()},0),Object(x.a)(c),r.a.invokeApi("help.getNearestDc").then(e=>{const t=new Set([1,2,3,4,5]),n=[e.this_dc];let i;return e.nearest_dc!==e.this_dc&&(i=r.a.getNetworker(e.nearest_dc).then(()=>{n.push(e.nearest_dc)})),(i||Promise.resolve()).then(()=>{n.forEach(e=>{t.delete(e)});const e=[...t],i=()=>P(void 0,void 0,void 0,(function*(){const t=e.shift();if(!t)return;const n=`dc${t}_auth_key`;if(yield C.a.get(n))return i();setTimeout(()=>{r.a.getNetworker(t).finally(i)},3e3)}));i()}),e}).then(n=>{let i=e.find(e=>e.code===n.country);i&&(R.value.length||X.value.length||(R.value=i.name,t=i,X.value=G="+"+i.phoneCode.split(" and ").shift()))})},()=>{F&&(Object(_.a)(F,Object(v.i18n)("Login.Next")),Object(L.ripple)(F,void 0,void 0,!0),F.removeAttribute("disabled")),D&&D.removeAttribute("disabled"),o.default.pushToState("authState",{_:"authStateSignIn"})});t.default=H},20:function(e,t,n){"use strict";n.r(t);var i=n(27),s=n(60),a=n(55),o=n(70),r=n(32),l=n(4),c=n(31),u=n(12),d=n(14),h=n(13),p=n(35),f=n(82),m=function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function r(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};let g;const b=new s.a("page-signQR",!0,()=>g,()=>{g||(g=m(void 0,void 0,void 0,(function*(){const e=b.pageEl.querySelector(".auth-image");let t=Object(p.f)(e,!0);const s=document.createElement("div");s.classList.add("input-wrapper");const d=Object(c.a)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Login.QR.Cancel"});s.append(d),Object(f.a)(s);const v=e.parentElement,y=document.createElement("h4");Object(u._i18n)(y,"Login.QR.Title");const L=document.createElement("ol");L.classList.add("qr-description"),["Login.QR.Help1","Login.QR.Help2","Login.QR.Help3"].forEach(e=>{const t=document.createElement("li");t.append(Object(u.i18n)(e)),L.append(t)}),v.append(y,L,s),d.addEventListener("click",()=>{Promise.all([n.e(7),n.e(29)]).then(n.bind(null,18)).then(e=>e.default.mount()),E=!0});const S=(yield Promise.all([n.e(11).then(n.t.bind(null,117,7))]))[0].default;let E=!1;h.default.addEventListener("user_auth",()=>{E=!0,g=null},{once:!0});let w,k={ignoreErrors:!0};const O=s=>m(void 0,void 0,void 0,(function*(){try{let c=yield i.a.invokeApi("auth.exportLoginToken",{api_id:l.a.id,api_hash:l.a.hash,except_ids:[]},{ignoreErrors:!0});if("auth.loginTokenMigrateTo"===c._&&(k.dcId||(k.dcId=c.dc_id,i.a.setBaseDcId(c.dc_id)),c=yield i.a.invokeApi("auth.importLoginToken",{token:c.token},k)),"auth.loginTokenSuccess"===c._){const e=c.authorization;return i.a.setUserAuth(e.user.id),n.e(5).then(n.bind(null,17)).then(e=>e.default.mount()),!0}if(!w||!Object(o.b)(w,c.token)){w=c.token;let n="tg://login?token="+Object(o.d)(c.token).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"");const i=window.getComputedStyle(document.documentElement),s=i.getPropertyValue("--surface-color").trim(),a=i.getPropertyValue("--primary-text-color").trim(),l=i.getPropertyValue("--primary-color").trim(),u=yield fetch("assets/img/logo_padded.svg").then(e=>e.text()).then(e=>{e=e.replace(/(fill:).+?(;)/,`$1${l}$2`);const t=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return new Promise(e=>{const n=new FileReader;n.onload=t=>{e(t.target.result)},n.readAsDataURL(t)})}),d=new S({width:240*window.devicePixelRatio,height:240*window.devicePixelRatio,data:n,image:u,dotsOptions:{color:a,type:"rounded"},cornersSquareOptions:{type:"extra-rounded"},imageOptions:{imageSize:1,margin:0},backgroundOptions:{color:s},qrOptions:{errorCorrectionLevel:"L"}});let h;d.append(e),e.lastChild.classList.add("qr-canvas"),h=d._drawingPromise?d._drawingPromise:Promise.race([Object(r.e)(1e3),new Promise(e=>{d._canvas._image.addEventListener("load",()=>{window.requestAnimationFrame(()=>e())},{once:!0})})]),yield h.then(()=>{if(t){t.style.animation="hide-icon .4s forwards";const n=e.children[1];n.style.display="none",n.style.animation="grow-icon .4s forwards",setTimeout(()=>{n.style.display=""},150),setTimeout(()=>{n.style.animation=""},500),t=void 0}else Array.from(e.children).slice(0,-1).forEach(e=>{e.remove()})})}if(s){let e=Date.now()/1e3,t=c.expires-e-a.a.serverTimeOffset;yield Object(r.e)(t>3?3e3:1e3*t|0)}}catch(e){switch(e.type){case"SESSION_PASSWORD_NEEDED":console.warn("pageSignQR: SESSION_PASSWORD_NEEDED"),e.handled=!0,Promise.all([n.e(4),n.e(16)]).then(n.bind(null,19)).then(e=>e.default.mount()),E=!0,g=null;break;default:console.error("pageSignQR: default error:",e),E=!0}return!0}return!1}));return()=>m(void 0,void 0,void 0,(function*(){for(E=!1;!E&&!(yield O(!0)););}))}))),g.then(e=>{e()}),d.default.pushToState("authState",{_:"authStateSignQr"})});t.default=b},33:function(e,t,n){"use strict";function i(e,t){if("string"==typeof t)return void(e.innerHTML=t);const n=e.firstChild;n?e.lastChild===n?n.replaceWith(t):(e.textContent="",e.append(t)):e.append(t)}n.d(t,"a",(function(){return i}))},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n(66),s=n(44),a=n(67),o=n(32),r=n(12),l=n(28);let c=()=>{document.addEventListener("paste",e=>{if(!Object(i.a)(e.target,'contenteditable="true"'))return;e.preventDefault();let t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=l.b.parseEntities(t);n=n.filter(e=>"messageEntityEmoji"===e._||"messageEntityLinebreak"===e._),t=l.b.wrapRichText(t,{entities:n,noLinks:!0,wrappingDraft:!0}),window.document.execCommand("insertHTML",!1,t)}),c=null};var u;!function(e){e[e.Neutral=0]="Neutral",e[e.Valid=1]="Valid",e[e.Error=2]="Error"}(u||(u={}));t.b=class{constructor(e={}){this.options=e,this.container=document.createElement("div"),this.container.classList.add("input-field"),e.maxLength&&(e.showLengthOn=Math.round(e.maxLength/3));const{placeholder:t,maxLength:n,showLengthOn:i,name:l,plainText:u}=e;let d,h,p=e.label||e.labelText;if(u)this.container.innerHTML=`\n <input type="text" ${l?`name="${l}"`:""} autocomplete="off" ${p?'required=""':""} class="input-field-input">\n `,d=this.container.firstElementChild;else{c&&c(),this.container.innerHTML='\n <div contenteditable="true" class="input-field-input"></div>\n ',d=this.container.firstElementChild;const t=new MutationObserver(()=>{h&&h()});d.addEventListener("input",()=>{Object(a.a)(d)&&(d.innerHTML=""),this.inputFake&&(this.inputFake.innerHTML=d.innerHTML,this.onFakeInput())}),t.observe(d,{characterData:!0,childList:!0,subtree:!0}),e.animate&&(d.classList.add("scrollable","scrollable-y"),this.wasInputFakeClientHeight=0,this.showScrollDebounced=Object(o.a)(()=>this.input.classList.remove("no-scrollbar"),150,!1,!0),this.inputFake=document.createElement("div"),this.inputFake.setAttribute("contenteditable","true"),this.inputFake.className=d.className+" input-field-input-fake")}if(d.setAttribute("dir","auto"),t&&(Object(r._i18n)(d,t,void 0,"placeholder"),this.inputFake&&Object(r._i18n)(this.inputFake,t,void 0,"placeholder")),p||t){const e=document.createElement("div");e.classList.add("input-field-border"),this.container.append(e)}if(p&&(this.label=document.createElement("label"),this.setLabel(),this.container.append(this.label)),n){const e=this.container.lastElementChild;let t=!1;h=()=>{const a=d.classList.contains("error"),o=u?d.value.length:[...Object(s.a)(d,!1).value].length,r=n-o,l=r<0;d.classList.toggle("error",l),l||r<=i?(this.setLabel(),e.append(` (${n-o})`),t||(t=!0)):(a&&!l||t)&&(this.setLabel(),t=!1)},d.addEventListener("input",h)}this.input=d}select(){this.input.value&&this.input.select()}setLabel(){this.label.textContent="",this.options.labelText?this.label.innerHTML=this.options.labelText:this.label.append(Object(r.i18n)(this.options.label,this.options.labelOptions))}onFakeInput(){const{scrollHeight:e,clientHeight:t}=this.inputFake;this.wasInputFakeClientHeight&&this.wasInputFakeClientHeight!==t&&(this.input.classList.add("no-scrollbar"),this.showScrollDebounced()),this.wasInputFakeClientHeight=t,this.input.style.height=e?e+"px":""}get value(){return this.options.plainText?this.input.value:Object(s.a)(this.input,!1).value}set value(e){this.setValueSilently(e,!1);const t=new Event("input",{bubbles:!0,cancelable:!0});this.input.dispatchEvent(t)}setValueSilently(e,t=!0){this.options.plainText?this.input.value=e:(this.input.innerHTML=e,this.inputFake&&(this.inputFake.innerHTML=e,t&&this.onFakeInput()))}isValid(){return!this.input.classList.contains("error")&&this.value!==this.originalValue}setOriginalValue(e="",t=!1){this.originalValue=e,this.options.plainText||(e=l.b.wrapDraftText(e)),t?this.setValueSilently(e,!1):this.value=e}setState(e,t){t&&(this.label.textContent="",this.label.append(Object(r.i18n)(t,this.options.labelOptions))),this.input.classList.toggle("error",!!(e&u.Error)),this.input.classList.toggle("valid",!!(e&u.Valid))}setError(e){this.setState(u.Error,e)}}},42:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return u}));var i=n(15),s=n(41),a=n(71),o=n(72),r=n(2);class l{constructor(e,t="",n=document.createElement("div")){this.el=e,this.container=n,this.onScrollMeasure=0,this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation=!1,this.container.classList.add("scrollable"),this.log=Object(s.b)("SCROLL"+(t?"-"+t:""),s.a.Error),e&&(Array.from(e.children).forEach(e=>this.container.append(e)),e.append(this.container))}setListeners(){window.addEventListener("resize",this.onScroll,{passive:!0}),this.container.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}),Object(o.a)(()=>{this.isHeavyAnimationInProgress=!0,this.onScrollMeasure&&(this.needCheckAfterAnimation=!0,window.cancelAnimationFrame(this.onScrollMeasure))},()=>{this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation&&(this.onScroll(),this.needCheckAfterAnimation=!1)})}append(e){this.container.append(e)}scrollIntoViewNew(e,t,n,i,s,o,r){return Object(a.b)(this.container,e,t,n,i,s,o,r)}}class c extends l{constructor(e,t="",n=300,i){super(e,t),this.onScrollOffset=n,this.onAdditionalScroll=null,this.onScrolledTop=null,this.onScrolledBottom=null,this.lastScrollTop=0,this.lastScrollDirection=0,this.loadedAll={top:!0,bottom:!1},this.onScroll=()=>{if(this.isHeavyAnimationInProgress)return this.onScrollMeasure&&window.cancelAnimationFrame(this.onScrollMeasure),void(this.needCheckAfterAnimation=!0);(this.onScrolledTop||this.onScrolledBottom||this.splitUp||this.onAdditionalScroll)&&(this.onScrollMeasure&&window.cancelAnimationFrame(this.onScrollMeasure),this.onScrollMeasure=window.requestAnimationFrame(()=>{this.onScrollMeasure=0;const e=this.container.scrollTop;this.lastScrollDirection=this.lastScrollTop===e?0:this.lastScrollTop<e?1:-1,this.lastScrollTop=e,this.onAdditionalScroll&&0!==this.lastScrollDirection&&this.onAdditionalScroll(),this.checkForTriggers&&this.checkForTriggers()}))},this.checkForTriggers=()=>{if(!this.onScrolledTop&&!this.onScrolledBottom)return;if(this.isHeavyAnimationInProgress)return void this.onScroll();const e=this.container.scrollHeight;if(!e)return;const t=e-this.container.clientHeight,n=this.lastScrollTop;this.onScrolledTop&&n<=this.onScrollOffset&&this.lastScrollDirection<=0&&this.onScrolledTop(),this.onScrolledBottom&&t-n<=this.onScrollOffset&&this.lastScrollDirection>=0&&this.onScrolledBottom()},this.container.classList.add("scrollable-y"),this.setListeners()}setVirtualContainer(e){this.splitUp=e,this.log("setVirtualContainer:",e,this)}prepend(...e){(this.splitUp||this.padding||this.container).prepend(...e)}append(...e){(this.splitUp||this.padding||this.container).append(...e)}getDistanceToEnd(){return this.scrollHeight-Math.round(this.scrollTop+this.container.offsetHeight)}get isScrolledDown(){return this.getDistanceToEnd()<=1}set scrollTop(e){this.container.scrollTop=e}get scrollTop(){return this.container.scrollTop}get scrollHeight(){return this.container.scrollHeight}}class u extends l{constructor(e,t="",n=300,s=15,a=document.createElement("div")){if(super(e,t,a),this.onScrollOffset=n,this.splitCount=s,this.container=a,this.container.classList.add("scrollable-x"),!i.isTouchSupported){const e=e=>{!e.deltaX&&this.container.scrollWidth>this.container.clientWidth&&(this.container.scrollLeft+=e.deltaY/4,Object(r.a)(e))};this.container.addEventListener("wheel",e,{passive:!1})}}}},44:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(26),s=n(28),a=n(63);function o(e,t=!0){const n=[],i=[],o=t?[]:void 0;Object(a.a)(e,n,i,void 0,void 0,o),i.length&&n.push(i.join(""));let r=n.join("\n");return r=r.replace(/\u00A0/g," "),o&&s.b.combineSameEntities(o),{value:r,entities:o}}i.a.getRichValue=o},45:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(14),s=n(30),a=n(16),o=n(12);class r{constructor(e={}){const t=this.label=document.createElement("label");t.classList.add("checkbox-field"),e.restriction&&t.classList.add("checkbox-field-restriction"),e.round&&t.classList.add("checkbox-field-round"),e.disabled&&this.toggleDisability(!0);const n=this.input=document.createElement("input");let r;if(n.type="checkbox",e.name&&(n.id="input-"+e.name),e.checked&&(n.checked=!0),e.stateKey&&i.default.getState().then(t=>{const a=Object(s.d)(t,e.stateKey);let o;o=e.stateValues?1===e.stateValues.indexOf(a):a,this.setValueSilently(o),n.addEventListener("change",()=>{let t;t=e.stateValues?e.stateValues[n.checked?1:0]:n.checked,i.default.setByKey(e.stateKey,t)})}),e.text?(r=this.span=document.createElement("span"),r.classList.add("checkbox-caption"),Object(o._i18n)(r,e.text,e.textArgs)):t.classList.add("checkbox-without-caption"),t.append(n),e.toggle){t.classList.add("checkbox-field-toggle");const e=document.createElement("div");e.classList.add("checkbox-toggle"),t.append(e)}else{const e=document.createElement("div");e.classList.add("checkbox-box");const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.classList.add("checkbox-box-check"),n.setAttributeNS(null,"viewBox","0 0 24 24");const i=document.createElementNS("http://www.w3.org/2000/svg","use");i.setAttributeNS(null,"href","#check"),i.setAttributeNS(null,"x","-1"),n.append(i);const s=document.createElement("div");s.classList.add("checkbox-box-background");const a=document.createElement("div");a.classList.add("checkbox-box-border"),e.append(a,s,n),t.append(e)}r&&t.append(r),e.withRipple?(t.classList.add("checkbox-ripple","hover-effect"),Object(a.ripple)(t,void 0,void 0,!0)):e.withHover&&t.classList.add("hover-effect")}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e);const t=new Event("change",{bubbles:!0,cancelable:!0});this.input.dispatchEvent(t)}setValueSilently(e){this.input.checked=e}toggleDisability(e){return this.label.classList.toggle("checkbox-disabled",e),()=>this.toggleDisability(!e)}}},48:function(e,t,n){"use strict";function i(e,t){return t?e.forEach(e=>e.setAttribute("disabled","true")):e.forEach(e=>e.removeAttribute("disabled")),()=>i(e,!t)}n.d(t,"a",(function(){return i}))},54:function(e,t,n){"use strict";function i(e,t){return e.closest(t)}n.d(t,"a",(function(){return i}))},55:function(e,t,n){"use strict";var i=n(26),s=n(59),a=n(27);const o=new class{constructor(){this.serverTimeOffset=0,s.a.get("server_time_offset").then(e=>{e&&(this.serverTimeOffset=e)}),a.a.addTaskListener("applyServerTimeOffset",e=>{this.serverTimeOffset=e.payload})}};i.a&&(i.a.serverTimeManager=o),t.a=o},63:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s}));const i={bold:{match:'[style*="font-weight"], b',entityName:"messageEntityBold"},underline:{match:'[style*="underline"], u',entityName:"messageEntityUnderline"},italic:{match:'[style*="italic"], i',entityName:"messageEntityItalic"},monospace:{match:'[style*="monospace"], [face="monospace"]',entityName:"messageEntityPre"},strikethrough:{match:'[style*="line-through"], strike',entityName:"messageEntityStrike"},link:{match:"A:not(.follow)",entityName:"messageEntityTextUrl"},mentionName:{match:"A.follow",entityName:"messageEntityMentionName"}};function s(e,t,n,a,o,r,l={offset:0}){if(3===e.nodeType){const t=e.nodeValue;if(a===e?n.push(t.substr(0,o)+""+t.substr(o)):n.push(t),r&&t.trim()&&e.parentNode){const n=e.parentElement;for(const e in i){const s=i[e],a=n.closest(s.match+", [contenteditable]");a&&null===a.getAttribute("contenteditable")&&("messageEntityTextUrl"===s.entityName?r.push({_:s.entityName,url:n.href,offset:l.offset,length:t.length}):"messageEntityMentionName"===s.entityName?r.push({_:s.entityName,offset:l.offset,length:t.length,user_id:+n.dataset.follow}):r.push({_:s.entityName,offset:l.offset,length:t.length}))}}return void(l.offset+=t.length)}if(1!==e.nodeType)return;const c=a===e,u="DIV"===e.tagName||"P"===e.tagName;if(u&&n.length||"BR"===e.tagName)t.push(n.join("")),n.splice(0,n.length);else if("IMG"===e.tagName){const t=e.alt;t&&(n.push(t),l.offset+=t.length)}c&&!o&&n.push("");let d=e.firstChild;for(;d;)s(d,t,n,a,o,r,l),d=d.nextSibling;c&&o&&n.push(""),u&&n.length&&(t.push(n.join("")),n.splice(0,n.length))}},66:function(e,t,n){"use strict";function i(e,t){return e.closest(`[${t}]`)}n.d(t,"a",(function(){return i}))},67:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(44);function s(e){return e.hasAttribute("contenteditable")||"INPUT"!==e.tagName?!Object(i.a)(e,!1).value.trim():!e.value.trim()}},70:function(e,t,n){"use strict";function i(e){const t=new Array(e.length);for(let n=0;n<e.length;++n)t[n]=(e[n]<16?"0":"")+(e[n]||0).toString(16);return t.join("")}function s(e){const t=e.length,n=new Uint8Array(Math.ceil(t/2));let i=0;t%2&&(n[i++]=parseInt(e.charAt(0),16));for(let s=i;s<t;s+=2)n[i++]=parseInt(e.substr(s,2),16);return n}function a(e){let t,n="";for(let i=e.length,s=0,a=0;a<i;++a)t=a%3,s|=e[a]<<(16>>>t&24),2!==t&&i-a!=1||(n+=String.fromCharCode(o(s>>>18&63),o(s>>>12&63),o(s>>>6&63),o(63&s)),s=0);return n.replace(/A(?=A$|$)/g,"=")}function o(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65}function r(e,t){const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;++i)if(e[i]!==t[i])return!1;return!0}function l(...e){const t=e.reduce((e,t)=>e+(t.byteLength||t.length),0),n=new Uint8Array(t);let i=0;return e.forEach(e=>{n.set(e instanceof ArrayBuffer?new Uint8Array(e):e,i),i+=e.byteLength||e.length}),n}n.d(t,"e",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return l}))},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n(53),s=n(64),a=function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function r(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};var o=new class{constructor(){this.blobSupported=!0;try{Object(s.a)([],"")}catch(e){this.blobSupported=!1}}isAvailable(){return this.blobSupported}write(e,t){return t instanceof Blob?Object(s.d)(t).then(t=>e.write(t)):e.write(t)}getFakeFileWriter(e,t){const n=[];return{write:e=>a(this,void 0,void 0,(function*(){if(!this.blobSupported)throw!1;n.push(e)})),truncate:()=>{n.length=0},finalize:(i=!0)=>{const a=Object(s.a)(n,e);return i&&t&&t(a),a}}}},r=function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function r(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};class l{constructor(e){this.dbName=e,this.useStorage=!0,i.a.test&&(this.dbName+="_test"),l.STORAGES.length&&(this.useStorage=l.STORAGES[0].useStorage),this.openDatabase(),l.STORAGES.push(this)}openDatabase(){var e;return null!==(e=this.openDbPromise)&&void 0!==e?e:this.openDbPromise=caches.open(this.dbName)}delete(e){return this.timeoutOperation(t=>t.delete("/"+e))}deleteAll(){return caches.delete(this.dbName)}get(e){return this.timeoutOperation(t=>t.match("/"+e))}save(e,t){return this.timeoutOperation(n=>n.put("/"+e,t))}getFile(e,t="blob"){return this.get(e).then(e=>{if(!e)throw"NO_ENTRY_FOUND";return e[t]()})}saveFile(e,t){t instanceof Blob||(t=Object(s.a)(t));const n=new Response(t,{headers:{"Content-Length":""+t.size}});return this.save(e,n).then(()=>t)}timeoutOperation(e){return this.useStorage?new Promise((t,n)=>r(this,void 0,void 0,(function*(){let i=!1;const s=setTimeout(()=>{n(),i=!0},15e3);try{const n=yield this.openDatabase();if(!n)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const s=yield e(n);if(i)return;t(s)}catch(e){n(e)}clearTimeout(s)}))):Promise.reject("STORAGE_OFFLINE")}getFileWriter(e,t){const n=o.getFakeFileWriter(t,t=>this.saveFile(e,t).catch(()=>t));return Promise.resolve(n)}static toggleStorage(e){return Promise.all(this.STORAGES.map(t=>{if(t.useStorage=e,!e)return t.deleteAll()}))}}l.STORAGES=[]},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n(2),s=n(29),a=n(6),o=n(12),r=n(27),l=n(13),c=n(31),u=n(35);let d,h=!1,p=0;function f(e){h||(d||(d=r.a.getConfig().then(e=>e.suggested_lang_code!==o.default.lastRequestedLangCode?Promise.all([e,o.default.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),o.default.getCacheLangPack()]):[]))).then(([t,n])=>{if(!t)return;const r=[];n.forEach(e=>{const t=o.default.strings.get(e.key);t&&(r.push(t),o.default.strings.set(e.key,e))});const d=Object(c.a)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Login.ContinueOnLanguage"});Object(a.a)().then(()=>{window.requestAnimationFrame(()=>{e.append(d)})}),l.default.addEventListener("language_change",()=>{d.remove()},{once:!0}),r.forEach(e=>{o.default.strings.set(e.key,e)}),Object(s.b)(d,e=>{Object(i.a)(e),d.disabled=!0,Object(u.f)(d),o.default.getLangPack(t.suggested_lang_code)})})}l.default.addEventListener("language_change",()=>{++p<2||(console.log("language_change"),h=!0)})}}]);
//# sourceMappingURL=14.ff7f481451a1c540b82d.chunk.js.map