1"use strict";(self.webpackChunktwilio_com_frontend=self.webpackChunktwilio_com_frontend||[]).push([[829],{829:function(e,t,c){function n(){document.querySelectorAll(".country-code-select").forEach(e=>{const t=function(e){const t=e.querySelector(".country-code__dropdown");return t?(new Promise(t=>{t(JSON.parse(e.getAttribute("data-countries")??""))}).then(c=>{c.forEach(c=>{const n=document.createElement("li"),r=document.createElement("button"),a=document.createElement("span"),o=document.createElement("img"),i=document.createElement("div"),d=document.createElement("span"),u=document.createElement("span"),l=document.createElement("span");if(o.setAttribute("alt",""),n.classList.add("country-code__list"),a.classList.add("country-code__flag"),r.classList.add("country-code__option"),i.classList.add("country-code__location"),d.classList.add("country-code__location-name"),u.classList.add("country-code__location-dial"),a.setAttribute("role","presentation"),o.src=c.flagPath,d.innerHTML=c.countryName,u.innerHTML=c.countryDialCode,r.setAttribute("data",JSON.stringify(c)),r.setAttribute("name",c.countryName),a.appendChild(o),r.appendChild(a),i.appendChild(d),i.appendChild(u),i.appendChild(l),r.appendChild(i),n.appendChild(r),t.appendChild(n),(navigator.language.split("-")[1]??"US")===c.countryCode){const n=e.querySelector(".country-code__current"),r=n?.querySelector(".country-code__img"),a=e.querySelector(".country-code__dial-code"),o=n?.querySelector(".country-code__selected-code");l.classList.add("country-code__blue-tick"),l.ariaLabel="active",r&&a&&(r.src=c.flagPath,a.value=c.countryDialCode,o&&(o.textContent=c.countryDialCode),t.setAttribute("aria-hidden","true"))}r.addEventListener("click",c=>{if(c.preventDefault(),c.stopPropagation(),!c.currentTarget)return;const n=e.querySelector(".country-code__current"),a=n?.querySelector(".country-code__img"),o=e.querySelector(".country-code__dial-code"),i=n?.querySelector(".country-code__selected-code"),d=JSON.parse(r.getAttribute("data")??""),u="object"==typeof(s=d)&&null!==s&&"flagPath"in s&&"countryCode"in s&&"countryDialCode"in s&&"countryName"in s?d:{flagPath:"",countryDialCode:""};var s;const y=t.querySelector('[aria-label="active"]');y&&(y.classList.remove("country-code__blue-tick"),y.ariaLabel=""),l.classList.add("country-code__blue-tick"),l.ariaLabel="active",a&&o&&(a.src=u.flagPath,o.value=u.countryDialCode,i&&(i.textContent=u.countryDialCode),t.setAttribute("aria-hidden","true"))})})}),t):null}(e),c=e.querySelector(".country-code__current");if(!c||!t)return;c.addEventListener("click",e=>{e.preventDefault(),"false"===t.getAttribute("aria-hidden")?(t.setAttribute("aria-hidden","true"),c.classList.remove("active")):(t.setAttribute("aria-hidden","false"),c.classList.add("active"))}),document.addEventListener("click",({target:e})=>{e instanceof Node&&!c.contains(e)&&(c.classList.remove("active"),t.setAttribute("aria-hidden","true"))});const n=e.querySelector(".country-code__highlightable-input"),r=e.querySelector(".country-code__input-text");r?.addEventListener("click",()=>{n?.classList.add("active")}),r?.addEventListener("input",()=>{const e=r.value.replace(/\D/g,"");r.value=e||""}),r?.addEventListener("focusout",()=>{n?.classList.remove("active")})})}c.d(t,{initializeCountrySelectors:function(){return n}})}}]);
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.