tweb/public/25.dcbbd29bad085f151e64.chu...

2 lines
7.7 KiB
JavaScript
Raw Normal View History

2022-03-25 16:07:29 +01:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[25],{21:function(e,t,n){"use strict";n.r(t);var a=n(35),o=n(44),c=n(17),i=n(32),s=n(31),r=n(69),l=n(36),d=n(46),u=n(34),p=n(86),h=n(1),f=n(7),g=n(16),m=n(51),b=n(18),v=n(61),y=n(6),L=n(66),E=n(103),_=n(112),O=n(20),j=n(106),w=n(5),k=n(29),S=n(33),x=n(55),T=n(74),C=n(87),N=n(95),P=n(81),I=n(89),M=n(15),A=n(121),D=n(10),B=function(e,t,n,a){return new(n||(n=Promise))((function(o,c){function i(e){try{r(a.next(e))}catch(e){c(e)}}function s(e){try{r(a.throw(e))}catch(e){c(e)}}function r(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}r((a=a.apply(e,t||[])).next())}))};let H,R=null;const U=new r.a("page-sign",!0,()=>{const e=()=>{t=g.default.countriesList.filter(e=>{var t;return!(null===(t=e.pFlags)||void 0===t?void 0:t.hidden)}).sort((e,t)=>(e.name||e.default_name).localeCompare(t.name||t.default_name))};let t;e(),M.default.addEventListener("language_change",()=>{e()});const r=new Map;let b,W;const X=document.createElement("div");X.classList.add("input-wrapper");const q=new l.b({label:"Login.CountrySelectorLabel",name:Object(L.b)()});q.container.classList.add("input-select");const z=q.input,F=document.createElement("div");F.classList.add("select-wrapper","z-depth-3","hide");const J=document.createElement("span");J.classList.add("arrow","arrow-down"),q.container.append(J);const K=document.createElement("ul");F.appendChild(K);new o.b(F);let V=()=>{V=null,t.forEach(e=>{const t=Object(N.c)(e.iso2),n=[];e.country_codes.forEach(a=>{const o=document.createElement("li");let c=s.a.wrapEmojiText(t);if(D.a){const e=document.createElement("span");e.innerHTML=c,o.append(e)}else o.innerHTML=c;const i=Object(g.i18n)(e.default_name);i.dataset.defaultName=e.default_name,o.append(i);const r=document.createElement("span");r.classList.add("phone-code"),r.innerText="+"+a.country_code,o.appendChild(r),n.push(o),K.append(o)}),r.set(e.iso2,n)}),K.addEventListener("mousedown",e=>{if(0!==e.button)return;const t=Object(v.a)(e.target,"LI");Q(t)}),q.container.appendChild(F)};const Q=e=>{const n=e.childNodes[1].dataset.defaultName,a=e.querySelector(".phone-code").innerText,o=a.replace(/\D/g,"");Object(S.a)(z,Object(g.i18n)(n)),Object(P.a)(z,"input"),b=t.find(e=>e.default_name===n),W=b.country_codes.find(e=>e.country_code===o),ee.value=ee.lastValue=a,Z(),setTimeout(()=>{te.focus(),Object(C.a)(te,!0)},0)};let $;V(),z.addEventListener("focus",(function(e){V?V():t.forEach(e=>{r.get(e.iso2).forEach(e=>e.style.display="")}),clearTimeout($),$=void 0,F.classList.remove("hide"),F.offsetWidth,F.classList.add("active"),q.select(),Object(p.b)({container:U.pageEl.parentElement.parentElement,element:z,position:"start",margin:4}),setTimeout(()=>{G||(document.addEventListener("mousedown",Y,{capture:!0}),G=!0)},0)}));let G=!1;const Y=e=>{Object(y.a)(e.target,"input-select")||e.target!==z&&(Z(),document.removeEventListener("mousedown",Y,{capture:!0}),G=!1)},Z=()=>{void 0===$&&(F.classList.remove("active"),$=window.setTimeout(()=>{F.classList.add("hide"),$=void 0},200))};z.addEventListener("keyup",e=>{const n=e.key;if(e.ctrlKey||"Control"===n)return!1;let a=q.value.toLowerCase(),o=[];t.forEach(e=>{const t=[e.name,e.default_name,e.iso2];t.filter(Boolean).forEach(e=>{const n=e.split(" ").filter(e=>/\w/.test(e)).map(e=>e[0]).join("");n.length>1&&t.push(n)});let n=!!t.filter(Boolean).find(e=>-1!==e.toLowerCase().indexOf(a));r.get(e.iso2).forEach(e=>e.style.display=n?"":"none"),n&&o.push(e)}),0===o.length?t.forEach(e=>{r.get(e.iso2).forEach(e=>e.style.display="")}):1===o.length&&"Enter"===n&&Q(r.get(o[0].iso2)[0])}),J.addEventListener("mousedown",(function(e){e.cancelBubble=!0,e.preventDefault(),z.matches(":focus")?z.blur():z.focus()}));const ee=new A.a({onInput:e=>{m.a.loadLottieWorkers();const{country:t,code:n}=e||{};let a=t?t.name||t.default_name:"";a===q.value||b&&t&&n&&(b===t||W.country_code===n.country_code)||(Object(S.a)(z,t?Object(g.i18n)(t.default_name):a),b=t,W=n),t||ee.value.length-1>1?R.style.visibility="":R.style.visibility="hidden"}}),te=ee.input;te.addEventListener("keypr
//# sourceMappingURL=25.dcbbd29bad085f151e64.chunk.js.map