tweb/public/4.3e09949378470770bf73.chun...

2 lines
16 KiB
JavaScript
Raw Normal View History

2022-04-16 19:15:57 +02:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[4],{117:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var s=n(14);function i(e,t=!1){if(!s.a||t&&document.activeElement===e)if(e.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();n.selectNodeContents(e),n.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(e),o.collapse(!1),o.select()}}},118:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var s=n(7);const i=new Map;let o=0;const c=(e,t,n="")=>{n=t.country_code+n,o=Math.max(o,n.length),i.set(n,{country:e,code:t})};function a(e){e=e||"",i.size||s.c.countriesList.forEach(e=>{e.country_codes.forEach(t=>{t.prefixes?t.prefixes.forEach(n=>{c(e,t,n)}):c(e,t)})});let t,n=e.replace(/\D/g,""),a=n.slice(0,o);for(let e=a.length-1;e>=0&&(t=i.get(a.slice(0,e+1)),!t);--e);if(!t)return{formatted:n,country:void 0,code:void 0,leftPattern:""};const r=t.country,l=t.code.patterns||[],d=n.slice(t.code.country_code.length);let h="",u=0,p="";for(let e=l.length-1;e>=0;--e){h=l[e];const t=h.replace(/ /g,"");let n=0;for(let e=0,s=Math.min(d.length,t.length);e<s;++e){if(d[e]!==t[e]&&"X"!==t[e]){n=0;break}++n}n>u&&(u=n,p=h)}h=p||h,h=h.replace(/\d/g,"X"),h=t.code.country_code+" "+h,h.split("").forEach((e,t)=>{" "===e&&" "!==n[t]&&n.length>t&&(n=n.slice(0,t)+" "+n.slice(t))});let m=h&&h.length>n.length?h.slice(n.length):"";return m&&(m=m.replace(/X/g,"")),{formatted:n,country:r,code:t.code,leftPattern:m}}},151:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var s=n(117),i=n(118),o=n(2),c=n(64);class a extends c.b{constructor(e={}){super(Object.assign({label:"Contacts.PhoneNumber.Placeholder",name:"phone"},e)),this.pasted=!1,this.lastValue="",this.container.classList.add("input-field-phone");let t=this.input;if(t instanceof HTMLInputElement)t.type="tel",t.autocomplete="rr55RandomRR55";else{t.inputMode="decimal";const e=window.devicePixelRatio;if(e>1){let n;o.b?n=-.16*e:o.a&&(n=0),t.style.setProperty("--letter-spacing",n+"px")}const n=this.setValueSilently.bind(this);this.setValueSilently=e=>{n(e),Object(s.a)(this.input,!0)}}t.addEventListener("input",()=>{t.classList.remove("error");const n=this.value;let s;Math.abs(n.length-this.lastValue.length)>1&&!this.pasted&&o.c&&this.setValueSilently(this.lastValue+n),this.pasted=!1,this.setLabel();let c,a,r,l="";"+"===this.value.replace(/\++/,"+")?this.setValueSilently("+"):(s=Object(i.a)(this.value),c=s.formatted,a=s.country,l=s.leftPattern,r=s.code,this.setValueSilently(this.lastValue=c?"+"+c:"")),t.dataset.leftPattern=l,e.onInput&&e.onInput(s)}),t.addEventListener("paste",()=>{this.pasted=!0}),t.addEventListener("keypress",e=>{const t=e.key;if(/\D/.test(t)&&!e.metaKey&&!e.ctrlKey&&"Backspace"!==t&&("+"!==t||!e.shiftKey))return e.preventDefault(),!1})}}},164:function(e,t,n){"use strict";n.r(t);var s=n(60),i=n(65),o=n(34),c=n(8),a=n(27),r=n(87),l=n(64),d=n(68),h=n(57),u=n(101),p=n(14),m=n(5),g=n(7),f=n(69),b=n(75),v=n(83),L=n(33),y=n(21),S=n(12),E=n(184),w=n(161),k=n(122),x=n(32),O=n(56),j=n(58),A=n(76),T=n(6),_=n(117),P=n(28),C=n(111),H=n(11),M=n(0),N=n(151),V=n(23),D=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function c(e){try{r(s.next(e))}catch(e){o(e)}}function a(e){try{r(s.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}r((s=s.apply(e,t||[])).next())}))};let I,R=null;const B=new r.a("page-sign",!0,()=>{const e=()=>{t=g.c.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.a.addEventListener("language_change",()=>{e()});const r=new Map;let b,K;const F=document.createElement("div");F.classList.add("input-wrapper");const U=new l.b({label:"Login.CountrySelectorLabel",name:Object(y.b)()});U.container.classList.add("input-select");const W=U.input,z=document.createElemen
//# sourceMappingURL=4.3e09949378470770bf73.chunk.js.map