intl-tel-input 27.0.3 → 27.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/angular/dist/IntlTelInput.js +4 -4
- package/angular/dist/IntlTelInputWithUtils.js +4 -4
- package/dist/js/data.js +1 -1
- package/dist/js/data.min.js +1 -1
- package/dist/js/intlTelInput.js +5 -5
- package/dist/js/intlTelInput.min.js +3 -3
- package/dist/js/intlTelInput.mjs +4 -4
- package/dist/js/intlTelInputWithUtils.js +5 -5
- package/dist/js/intlTelInputWithUtils.min.js +2 -2
- package/dist/js/intlTelInputWithUtils.mjs +4 -4
- package/package.json +1 -1
- package/react/dist/IntlTelInput.js +4 -4
- package/react/dist/IntlTelInputWithUtils.js +4 -4
- package/vue/dist/{IntlTelInput-0xwtAAwu.js → IntlTelInput-DksRM5_Z.js} +38 -38
- package/vue/dist/IntlTelInput.js +1 -1
- package/vue/dist/IntlTelInputWithUtils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
See the Github Releases page for changelog: https://github.com/jackocnr/intl-tel-input/releases
|
|
2
2
|
|
|
3
|
-
Or to view a specific version, e.g. v27.0.
|
|
3
|
+
Or to view a specific version, e.g. v27.0.4, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.0.4
|
|
4
4
|
|
|
5
5
|
## Breaking changes
|
|
6
6
|
|
|
@@ -2353,7 +2353,6 @@ var UI = class _UI {
|
|
|
2353
2353
|
const wrapper = this.#createWrapperAndInsert();
|
|
2354
2354
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2355
2355
|
wrapper.appendChild(this.telInput);
|
|
2356
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2357
2356
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2358
2357
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2359
2358
|
}
|
|
@@ -2435,7 +2434,7 @@ var UI = class _UI {
|
|
|
2435
2434
|
this.#buildDropdownContent();
|
|
2436
2435
|
}
|
|
2437
2436
|
}
|
|
2438
|
-
|
|
2437
|
+
maybeEnsureDropdownWidthSet() {
|
|
2439
2438
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2440
2439
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2441
2440
|
return;
|
|
@@ -2843,7 +2842,7 @@ var UI = class _UI {
|
|
|
2843
2842
|
// UI: Open the dropdown (DOM only).
|
|
2844
2843
|
openDropdown() {
|
|
2845
2844
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2846
|
-
this
|
|
2845
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2847
2846
|
if (dropdownContainer) {
|
|
2848
2847
|
this.#handleDropdownContainer();
|
|
2849
2848
|
} else {
|
|
@@ -3304,6 +3303,7 @@ var Iti = class _Iti {
|
|
|
3304
3303
|
this.#processCountryData();
|
|
3305
3304
|
this.#ui.generateMarkup(this.#countries);
|
|
3306
3305
|
this.#setInitialState();
|
|
3306
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3307
3307
|
this.#initListeners();
|
|
3308
3308
|
this.#initRequests();
|
|
3309
3309
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4470,7 +4470,7 @@ var intlTelInput = Object.assign(
|
|
|
4470
4470
|
attachUtils,
|
|
4471
4471
|
startedLoadingUtilsScript: false,
|
|
4472
4472
|
startedLoadingAutoCountry: false,
|
|
4473
|
-
version: "27.0.
|
|
4473
|
+
version: "27.0.4"
|
|
4474
4474
|
}
|
|
4475
4475
|
);
|
|
4476
4476
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2353,7 +2353,6 @@ var UI = class _UI {
|
|
|
2353
2353
|
const wrapper = this.#createWrapperAndInsert();
|
|
2354
2354
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2355
2355
|
wrapper.appendChild(this.telInput);
|
|
2356
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2357
2356
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2358
2357
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2359
2358
|
}
|
|
@@ -2435,7 +2434,7 @@ var UI = class _UI {
|
|
|
2435
2434
|
this.#buildDropdownContent();
|
|
2436
2435
|
}
|
|
2437
2436
|
}
|
|
2438
|
-
|
|
2437
|
+
maybeEnsureDropdownWidthSet() {
|
|
2439
2438
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2440
2439
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2441
2440
|
return;
|
|
@@ -2843,7 +2842,7 @@ var UI = class _UI {
|
|
|
2843
2842
|
// UI: Open the dropdown (DOM only).
|
|
2844
2843
|
openDropdown() {
|
|
2845
2844
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2846
|
-
this
|
|
2845
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2847
2846
|
if (dropdownContainer) {
|
|
2848
2847
|
this.#handleDropdownContainer();
|
|
2849
2848
|
} else {
|
|
@@ -3304,6 +3303,7 @@ var Iti = class _Iti {
|
|
|
3304
3303
|
this.#processCountryData();
|
|
3305
3304
|
this.#ui.generateMarkup(this.#countries);
|
|
3306
3305
|
this.#setInitialState();
|
|
3306
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3307
3307
|
this.#initListeners();
|
|
3308
3308
|
this.#initRequests();
|
|
3309
3309
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4470,7 +4470,7 @@ var intlTelInput = Object.assign(
|
|
|
4470
4470
|
attachUtils,
|
|
4471
4471
|
startedLoadingUtilsScript: false,
|
|
4472
4472
|
startedLoadingAutoCountry: false,
|
|
4473
|
-
version: "27.0.
|
|
4473
|
+
version: "27.0.4"
|
|
4474
4474
|
}
|
|
4475
4475
|
);
|
|
4476
4476
|
var intl_tel_input_default = intlTelInput;
|
package/dist/js/data.js
CHANGED
package/dist/js/data.min.js
CHANGED
package/dist/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.0.
|
|
2
|
+
* International Telephone Input v27.0.4
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -2403,7 +2403,6 @@ var _factory = (() => {
|
|
|
2403
2403
|
const wrapper = this.#createWrapperAndInsert();
|
|
2404
2404
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2405
2405
|
wrapper.appendChild(this.telInput);
|
|
2406
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2407
2406
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2408
2407
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2409
2408
|
}
|
|
@@ -2485,7 +2484,7 @@ var _factory = (() => {
|
|
|
2485
2484
|
this.#buildDropdownContent();
|
|
2486
2485
|
}
|
|
2487
2486
|
}
|
|
2488
|
-
|
|
2487
|
+
maybeEnsureDropdownWidthSet() {
|
|
2489
2488
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2490
2489
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2491
2490
|
return;
|
|
@@ -2893,7 +2892,7 @@ var _factory = (() => {
|
|
|
2893
2892
|
// UI: Open the dropdown (DOM only).
|
|
2894
2893
|
openDropdown() {
|
|
2895
2894
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2896
|
-
this
|
|
2895
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2897
2896
|
if (dropdownContainer) {
|
|
2898
2897
|
this.#handleDropdownContainer();
|
|
2899
2898
|
} else {
|
|
@@ -3368,6 +3367,7 @@ var _factory = (() => {
|
|
|
3368
3367
|
this.#processCountryData();
|
|
3369
3368
|
this.#ui.generateMarkup(this.#countries);
|
|
3370
3369
|
this.#setInitialState();
|
|
3370
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3371
3371
|
this.#initListeners();
|
|
3372
3372
|
this.#initRequests();
|
|
3373
3373
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4534,7 +4534,7 @@ var _factory = (() => {
|
|
|
4534
4534
|
attachUtils,
|
|
4535
4535
|
startedLoadingUtilsScript: false,
|
|
4536
4536
|
startedLoadingAutoCountry: false,
|
|
4537
|
-
version: "27.0.
|
|
4537
|
+
version: "27.0.4"
|
|
4538
4538
|
}
|
|
4539
4539
|
);
|
|
4540
4540
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.0.
|
|
2
|
+
* International Telephone Input v27.0.4
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var _factory=(()=>{var K=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Pt=(n,t)=>{for(var e in t)K(n,e,{get:t[e],enumerable:!0})},Mt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of St(t))!_t.call(n,s)&&s!==e&&K(n,s,{get:()=>t[s],enumerable:!(i=Ot(t,s))||i.enumerable});return n};var Rt=n=>Mt(K({},"__esModule",{value:!0}),n);var Kt={};Pt(Kt,{Iti:()=>x,default:()=>Yt});var xt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],z=[];for(let n of xt)z.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var Ht=new Set(z.map(n=>n.iso2)),S=n=>Ht.has(n),_=z;var H={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input"},d={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},X={PASTE:"insertFromPaste",DELETE_FWD:"deleteContentForward"},v={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},B={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,SANE_SELECTED_WITH_DIAL_WIDTH:78,SANE_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,SANE_DROPDOWN_HEIGHT:200},$={PLUS:"+",NANP:"1"},F={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},P={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},k={AUTO:"auto"},kt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],U=new Set(kt),Q={COUNTRY_CODE:"countryCode",DIAL_CODE:"dialCode"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ut={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ut;var J=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>J(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),Wt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=J("(max-height: 600px)"),t=J("(pointer: coarse)");return ut()||t&&n}return!1},G={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:P.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:Wt()},ct=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Bt=n=>typeof n=="function",$t=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},lt=new Set(Object.values(P)),V=n=>{console.warn(`[intl-tel-input] ${n}`)},b=(n,t,e)=>{V(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of ISO2 country code strings";if(!Array.isArray(t))return b(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return b(n,e,t),!1;let o=s.toLowerCase();S(o)?i.push(s):V(`Invalid country code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return V(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(G,e)){V(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){b(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!lt.has(i)){let s=Array.from(lt).join(", ");b("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){b(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Bt(i)){b(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!$t(i)){b("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){b("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){b("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==k.AUTO&&!S(s)){b("initialCountry","a valid ISO2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.has(i)){let s=Array.from(U).join(", ");b("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){b("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.has(o)){let r=Array.from(U).join(", ");b("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var A=n=>n.replace(/\D/g,""),W=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var ft=()=>typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1;var mt=(n,t)=>{let e=W(t),i=[],s=[],o=[],r=[],l=[],a=[];for(let h of n)h.iso2===e?i.push(h):h.normalisedName.startsWith(e)?s.push(h):h.normalisedName.includes(e)?o.push(h):e===h.dialCode||e===h.dialCodePlus?r.push(h):h.dialCodePlus.includes(e)?l.push(h):h.initials.includes(e)&&a.push(h);let c=(h,m)=>h.priority-m.priority;return[...i,...s,...o,...r.sort(c),...l.sort(c),...a]},yt=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var j=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var Ct=()=>`
|
|
6
|
+
"use strict";var _factory=(()=>{var K=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Pt=(n,t)=>{for(var e in t)K(n,e,{get:t[e],enumerable:!0})},Mt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ot(t))!_t.call(n,s)&&s!==e&&K(n,s,{get:()=>t[s],enumerable:!(i=St(t,s))||i.enumerable});return n};var Rt=n=>Mt(K({},"__esModule",{value:!0}),n);var Kt={};Pt(Kt,{Iti:()=>x,default:()=>Yt});var xt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],z=[];for(let n of xt)z.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var Ht=new Set(z.map(n=>n.iso2)),O=n=>Ht.has(n),_=z;var H={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input"},d={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},X={PASTE:"insertFromPaste",DELETE_FWD:"deleteContentForward"},v={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},B={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,SANE_SELECTED_WITH_DIAL_WIDTH:78,SANE_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,SANE_DROPDOWN_HEIGHT:200},$={PLUS:"+",NANP:"1"},F={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},P={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},k={AUTO:"auto"},kt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],U=new Set(kt),Q={COUNTRY_CODE:"countryCode",DIAL_CODE:"dialCode"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ut={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ut;var J=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>J(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),Wt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=J("(max-height: 600px)"),t=J("(pointer: coarse)");return ut()||t&&n}return!1},G={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:P.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:Wt()},ct=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Bt=n=>typeof n=="function",$t=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},lt=new Set(Object.values(P)),V=n=>{console.warn(`[intl-tel-input] ${n}`)},b=(n,t,e)=>{V(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of ISO2 country code strings";if(!Array.isArray(t))return b(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return b(n,e,t),!1;let o=s.toLowerCase();O(o)?i.push(s):V(`Invalid country code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return V(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(G,e)){V(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){b(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!lt.has(i)){let s=Array.from(lt).join(", ");b("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){b(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Bt(i)){b(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!$t(i)){b("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){b("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){b("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==k.AUTO&&!O(s)){b("initialCountry","a valid ISO2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.has(i)){let s=Array.from(U).join(", ");b("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){b("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.has(o)){let r=Array.from(U).join(", ");b("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var A=n=>n.replace(/\D/g,""),W=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var ft=()=>typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1;var mt=(n,t)=>{let e=W(t),i=[],s=[],o=[],r=[],l=[],a=[];for(let h of n)h.iso2===e?i.push(h):h.normalisedName.startsWith(e)?s.push(h):h.normalisedName.includes(e)?o.push(h):e===h.dialCode||e===h.dialCodePlus?r.push(h):h.dialCodePlus.includes(e)?l.push(h):h.initials.includes(e)&&a.push(h);let c=(h,m)=>h.priority-m.priority;return[...i,...s,...o,...r.sort(c),...l.sort(c),...a]},yt=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var j=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var Ct=()=>`
|
|
7
7
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${p.HIDDEN}="true">
|
|
8
8
|
<circle cx="11" cy="11" r="7" />
|
|
9
9
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
<svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
|
|
22
22
|
<path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
|
|
23
23
|
<path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
|
|
24
|
-
</svg>`;var M=class n{#t;#e;#C;#u="";#p;#m=null;#I;#L;#i;#s;#c;#n;#d;#o;#r=null;#l=null;telInput;countryContainer;selectedCountry;selectedCountryInner;searchInput;searchClearButton;countryList;hiddenInputPhone;hiddenInputCountry;highlightedItem=null;hadInitialPlaceholder;constructor(t,e,i){t.dataset.intlTelInputId=i.toString(),this.telInput=t,this.#t=e,this.#e=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#C=!!this.telInput.closest("[dir=rtl]"),this.#t.separateDialCode&&(this.#u=this.telInput.style.paddingLeft)}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}generateMarkup(t){this.#p=t,this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("type")||this.telInput.setAttribute("type","tel"),this.telInput.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","tel"),this.telInput.hasAttribute("inputmode")||this.telInput.setAttribute("inputmode","tel");let e=this.#h();this.#a(e),e.appendChild(this.telInput),this.#f(),this.#x(),this.#A(e)}#h(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=j({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=f("div",{class:o});return this.#C&&r.setAttribute("dir","ltr"),this.telInput.before(r),r}#a(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.countryContainer=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.selectedCountry=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#e}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=f("div",{class:"iti__selected-country"},this.countryContainer);let o=f("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=f("div",{class:d.FLAG},o),e&&(this.#i=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},o)),i&&(this.#L=f("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e&&this.#M()}#f(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInput.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#M(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#e}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${l}`,role:"dialog",[p.MODAL]:"true"}),this.#C&&this.#s.setAttribute("dir","rtl"),i&&this.#R(),this.countryList=f("ul",{class:"iti__country-list",id:`iti-${this.#e}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#H(),i&&this.#w(),e||(this.#I=this.#U(),i&&(this.#s.style.height=`${this.#I}px`)),o){let a=j({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#o=f("div",{class:a}),this.#o.appendChild(this.#s)}else this.countryContainer.appendChild(this.#s)}#R(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#c=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#c.innerHTML=Ct(),this.searchInput=f("input",{id:`iti-${this.#e}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#e}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.searchClearButton=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.searchClearButton.innerHTML=gt(this.#e),this.#d=f("span",{class:"iti__a11y-text"},this.#s),this.#n=f("div",{class:`iti__no-results ${d.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#n.textContent=t.searchEmptyState??null}#x(){this.countryContainer&&(this.#D(),this.countryContainer.classList.remove(d.V_HIDE))}#A(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInput.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInput.form?.querySelector(`input[name="${s.phone}"]`);o?this.hiddenInputPhone=o:(this.hiddenInputPhone=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.hiddenInputPhone))}if(s.country){let o=this.telInput.form?.querySelector(`input[name="${s.country}"]`);o?this.hiddenInputCountry=o:(this.hiddenInputCountry=f("input",{type:"hidden",name:s.country}),t.appendChild(this.hiddenInputCountry))}}#H(){let t=document.createDocumentFragment();for(let e=0;e<this.#p.length;e++){let i=this.#p[e],s=j({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#e}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset.dialCode=i.dialCode,o.dataset.countryCode=i.iso2,i.nodeById[this.#e]=o,this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#C&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.countryList.appendChild(t)}#D(){if(this.selectedCountry){let t=this.#t.separateDialCode?L.SANE_SELECTED_WITH_DIAL_WIDTH:L.SANE_SELECTED_NO_DIAL_WIDTH,i=(this.selectedCountry.offsetWidth||this.#k()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInput.style.paddingLeft=`${i}px`}}static#T(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#k(){if(!this.telInput.parentNode)return 0;let t=n.#T(),e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.countryContainer.cloneNode();e.appendChild(i);let s=this.selectedCountry.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#U(){let t=n.#T();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.SANE_DROPDOWN_HEIGHT}#w(){let{i18n:t}=this.#t,e=this.countryList.childElementCount;this.#d.textContent=t.searchSummaryAria(e)}filterCountriesByQuery(t){let e;t===""?e=this.#p:e=mt(this.#p,t),this.#B(e)}#N(){let t=this.searchInput.value.trim();this.filterCountriesByQuery(t),this.searchInput.value?this.searchClearButton.classList.remove(d.HIDE):this.searchClearButton.classList.add(d.HIDE)}handleSearchChange(){this.#m&&clearTimeout(this.#m),this.#m=setTimeout(()=>{this.#N(),this.#m=null},B.SEARCH_DEBOUNCE_MS)}handleSearchClear(){this.searchInput.value="",this.searchInput.focus(),this.#N()}scrollCountryListToItem(t){let e=this.countryList,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}highlightListItem(t,e){let i=this.highlightedItem;if(i&&i.classList.remove(d.HIGHLIGHT),this.highlightedItem=t,this.highlightedItem){if(this.highlightedItem.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let s=this.highlightedItem.getAttribute("id")||"";this.searchInput.setAttribute(p.ACTIVE_DESCENDANT,s)}e&&this.highlightedItem.focus()}}handleUpDownKey(t){let e=t===C.ARROW_UP?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!e&&this.countryList.childElementCount>1&&(e=t===C.ARROW_UP?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this.scrollCountryListToItem(e),this.highlightListItem(e,!1))}#W(t){if(this.#r&&this.#r.dataset.countryCode!==t&&(this.#r.setAttribute(p.SELECTED,"false"),this.#r.querySelector(".iti__country-check")?.remove(),this.#r=null),t&&!this.#r){let e=this.countryList.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(p.SELECTED,"true");let i=f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e);i.innerHTML=It(),this.#r=e}}}#B(t){this.countryList.replaceChildren();let e=!0;for(let i of t){let s=i.nodeById[this.#e];s&&(this.countryList.appendChild(s),e&&(this.highlightListItem(s,!1),e=!1))}e?(this.highlightListItem(null,!1),this.#n&&this.#n.classList.remove(d.HIDE)):this.#n&&this.#n.classList.add(d.HIDE),this.countryList.scrollTop=0,this.#w()}destroy(){this.telInput.iti=void 0,delete this.telInput.dataset.intlTelInputId,this.#t.separateDialCode&&(this.telInput.style.paddingLeft=this.#u);let t=this.telInput.parentNode;t.before(this.telInput),t.remove();for(let e of this.#p)delete e.nodeById[this.#e]}openDropdown(){let{countrySearch:t,dropdownAlwaysOpen:e,dropdownContainer:i}=this.#t;if(this.#f(),i)this.#$();else{let o=this.#O(),r=this.telInput.offsetHeight+L.DROPDOWN_MARGIN;o?this.#s.style.top=`${r}px`:this.#s.style.bottom=`${r}px`}this.#s.classList.remove(d.HIDE),this.selectedCountry.setAttribute(p.EXPANDED,"true");let s=this.#r??this.countryList.firstElementChild;s&&(this.highlightListItem(s,!1),this.scrollCountryListToItem(s)),t&&!e&&this.searchInput.focus(),this.#t.useFullscreenPopup&&this.#o&&window.visualViewport&&(this.#l=()=>{this.#b(),this.highlightedItem&&this.scrollCountryListToItem(this.highlightedItem)},window.visualViewport.addEventListener("resize",this.#l)),this.#i.classList.add(d.ARROW_UP)}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#s.classList.add(d.HIDE),this.selectedCountry.setAttribute(p.EXPANDED,"false"),t&&(this.searchInput.removeAttribute(p.ACTIVE_DESCENDANT),this.searchInput.value="",this.#N(),this.highlightedItem&&(this.highlightedItem.classList.remove(d.HIGHLIGHT),this.highlightedItem=null)),this.#i.classList.remove(d.ARROW_UP),this.#l&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.#l),this.#l=null),e?(this.#o.remove(),this.#o.style.top="",this.#o.style.bottom="",this.#o.style.paddingLeft="",this.#o.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#O(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInput.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#I||i>=e}#$(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInput.getBoundingClientRect();this.#o.style.paddingLeft=`${i.left}px`,this.#o.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInput.getBoundingClientRect();this.#o.style.left=`${i.left}px`,this.#O()?this.#o.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#o.style.top="unset",this.#o.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#o)}#b(){let t=window.visualViewport;if(!t||!this.#o)return;let e=window.innerHeight-t.height;this.#o.style.bottom=`${e}px`}isDropdownClosed(){return this.#s.classList.contains(d.HIDE)}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#W(a),this.selectedCountry){let c=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,h,m,g;a?(m=r,h=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),g=i?"":Z()):(m=o.noCountrySelected,h=o.noCountrySelected,g=Z()),this.selectedCountryInner.className=c,this.selectedCountry.setAttribute("title",m),this.selectedCountry.setAttribute(p.LABEL,h),this.selectedCountryInner.innerHTML=g}if(s){let c=l?`+${l}`:"";this.#L.textContent=c,this.#D()}}};var bt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?_.filter(i=>t.includes(i.iso2)):e?.length?_.filter(i=>!e.includes(i.iso2)):[..._]},Et=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Lt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let c=1;c<a.length;c++){let h=a.substring(0,c),m=r.dialCode+h;s(l,m),s(r.iso2,m)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLen:e,dialCodeToIso2Map:i}},wt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})},Nt=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var Ft=new Set(["800","808","870","881","882","883","888","979"]),tt=n=>{let t=A(n).slice(0,3);return n.startsWith("+")&&Ft.has(t)};var et=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},vt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var At=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Vt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),it=n=>{let t=A(n);if(t.startsWith($.NANP)&&t.length>=4){let e=t.substring(1,4);return Vt.has(e)}return!1};var Y=class{#t;constructor(t){t&&this.#e(t)}#e(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#e(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Gt=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Dt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},x=class n{id;promise;#t;#e;#C;#u;#p;#m;#I;#L;#i=null;#s=null;#c;#n=!1;#d;#o=null;#r;#l;#h;constructor(t,e={}){this.id=Gt++,M.validateInput(t);let i=dt(e);this.#e={...G,...i},ht(this.#e),pt(this.#e),this.#t=new M(t,this.#e,this.id),this.#C=ft(),this.#r=new Y(t.value),this.promise=this.#M(this.#e),this.#u=bt(this.#e);let{dialCodes:s,dialCodeMaxLen:o,dialCodeToIso2Map:r}=Lt(this.#u);this.#I=s,this.#p=o,this.#m=r,this.#L=new Map(this.#u.map(l=>[l.iso2,l])),this.#R()}#a(){let t=this.#t.telInput.value.trim();return this.#r.normalise(t)}#f(t){this.#t.telInput.value=this.#r.denormalise(t)}#M(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#l=Dt()),r&&(this.#h=Dt()),Promise.all([this.#l?.promise,this.#h?.promise]).then(()=>{})}#R(){this.#d=new AbortController,this.#x(),this.#t.generateMarkup(this.#u),this.#A(),this.#H(),this.#k(),this.#e.dropdownAlwaysOpen&&this.#S()}#x(){Et(this.#u,this.#e),wt(this.#u,this.#e),Nt(this.#u)}#A(t=!1){let e=this.#t.telInput.getAttribute("value"),i=this.#r.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#_(r),a=it(r),{initialCountry:c,geoIpLookup:h}=this.#e,g=c===k.AUTO&&h&&!t,w=S(c);l?a?w?this.#g(c):g||this.#g(nt.ISO2):this.#F(r):w?this.#g(c):g||this.#g(""),r&&this.#v(r)}#H(){this.#N(),this.#e.allowDropdown&&this.#T(),(this.#t.hiddenInputPhone||this.#t.hiddenInputCountry)&&this.#t.telInput.form&&this.#D()}#D(){let t=()=>{this.#t.hiddenInputPhone&&(this.#t.hiddenInputPhone.value=this.getNumber()),this.#t.hiddenInputCountry&&(this.#t.hiddenInputCountry.value=this.#i?.iso2||"")};this.#t.telInput.form?.addEventListener("submit",t,{signal:this.#d.signal})}#T(){let t=this.#d.signal,e=r=>{this.#t.isDropdownClosed()?this.#t.telInput.focus():r.preventDefault()},i=this.#t.telInput.closest("label");i&&i.addEventListener("click",e,{signal:t});let s=()=>{this.#t.isDropdownClosed()&&!this.#t.telInput.disabled&&!this.#t.telInput.readOnly&&this.#S()};this.#t.selectedCountry.addEventListener("click",s,{signal:t});let o=r=>{let l=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];this.#t.isDropdownClosed()&&l.includes(r.key)&&(r.preventDefault(),r.stopPropagation(),this.#S()),r.key===C.TAB&&this.#E()};this.#t.countryContainer.addEventListener("keydown",o,{signal:t})}#k(){if(this.#h){let{loadUtils:t}=this.#e,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#d.signal})}this.#l&&(this.#i?this.#l.resolve():this.#U())}#U(){if(u.autoCountry){this.#q();return}if(this.#t.selectedCountryInner.classList.add(d.LOADING),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#e.geoIpLookup=="function")){let t=(i="")=>{this.#t.selectedCountryInner.classList.remove(d.LOADING);let s=i.toLowerCase();S(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountry"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{this.#t.selectedCountryInner.classList.remove(d.LOADING),n.forEachInstance("handleAutoCountryFailure")};this.#e.geoIpLookup(t,e)}}#w(){this.#S(),this.#t.searchInput.value="+",this.#t.filterCountriesByQuery("")}#N(){this.#W(),this.#B(),this.#O()}#W(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#e,r=!1;v.ALPHA_UNICODE.test(this.#a())&&(r=!0);let l=a=>{let c=this.#a();if(this.#C&&a?.data==="+"&&i&&s&&o){let I=this.#t.telInput.selectionStart||0,D=c.substring(0,I-1),N=c.substring(I);this.#f(D+N),this.#w();return}this.#F(c)&&this.#P();let h=a?.data&&v.NON_PLUS_NUMERIC.test(a.data),m=a?.inputType===X.PASTE&&c;h||m&&!t?r=!0:v.NON_PLUS_NUMERIC.test(c)||(r=!1);let g=a?.detail&&a.detail.isSetNumber,w=this.#r.isAscii();if(e&&!r&&!g&&w){let I=this.#t.telInput.selectionStart||0,N=c.substring(0,I).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,T=a?.inputType===X.DELETE_FWD,y=this.#y(),O=vt(y,c,u.utils,this.#i,i),E=At(N,O,I,T);this.#f(O),this.#t.telInput.setSelectionRange(E,E)}if(i&&c.startsWith("+")&&this.#i?.dialCode){let I=et(c,!0,i,this.#i);this.#f(I)}};this.#t.telInput.addEventListener("input",l,{signal:this.#d.signal})}#B(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:s}=this.#e;if(!t&&!e)return;let o=r=>{if(!r.key||r.key.length!==1||r.altKey||r.ctrlKey||r.metaKey)return;if(e&&i&&s&&r.key==="+"){r.preventDefault(),this.#w();return}if(!t)return;let l=this.#a(),c=!l.startsWith("+")&&this.#t.telInput.selectionStart===0&&r.key==="+",h=this.#r.normalise(r.key),m=/^[0-9]$/.test(h),g=e?m:c||m,w=this.#t.telInput,I=w.selectionStart,D=w.selectionEnd,N=l.slice(0,I??void 0),T=l.slice(D??void 0),y=N+r.key+T,O=this.#y(y),E=!1;u.utils&&this.#s&&(E=u.utils.getCoreNumber(O,this.#i?.iso2).length>this.#s);let Tt=this.#G(O)!==null;(!g||E&&!Tt&&!c)&&r.preventDefault()};this.#t.telInput.addEventListener("keydown",o,{signal:this.#d.signal})}#O(){if(!this.#e.strictMode)return;let t=e=>{e.preventDefault();let i=this.#t.telInput,s=i.selectionStart,o=i.selectionEnd,r=this.#a(),l=r.slice(0,s??void 0),a=r.slice(o??void 0),c=this.#i?.iso2,h=e.clipboardData.getData("text"),m=this.#r.normalise(h),g=s===0&&o>0,w=!r.startsWith("+")||g,I=m.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),D=I.startsWith("+"),N=I.replace(/\+/g,""),T=D&&w?`+${N}`:N,y=l+T+a;if(y.length>5&&u.utils){let E=u.utils.getCoreNumber(y,c);for(;E.length===0&&y.length>0;)y=y.slice(0,-1),E=u.utils.getCoreNumber(y,c);if(!E)return;if(this.#s&&E.length>this.#s)if(i.selectionEnd===r.length){let st=E.length-this.#s;y=y.slice(0,y.length-st)}else return}this.#f(y);let O=s+T.length;i.setSelectionRange(O,O),i.dispatchEvent(new InputEvent("input",{bubbles:!0}))};this.#t.telInput.addEventListener("paste",t,{signal:this.#d.signal})}#$(t){let e=Number(this.#t.telInput.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#b(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInput.dispatchEvent(i)}#S(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#e;if(this.#o=new AbortController,this.#t.openDropdown(),!e&&t){let i=()=>this.#E();window.addEventListener("scroll",i,{signal:this.#o.signal})}this.#J(),this.#b(H.OPEN_COUNTRY_DROPDOWN)}#J(){let t=this.#o.signal;this.#Z(t),this.#tt(t),this.#e.dropdownAlwaysOpen||this.#et(t),this.#it(t),this.#e.countrySearch&&this.#st(t)}#Z(t){let e=i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&this.#t.highlightListItem(s,!1)};this.#t.countryList.addEventListener("mouseover",e,{signal:t})}#tt(t){let e=i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&this.#Y(s)};this.#t.countryList.addEventListener("click",e,{signal:t})}#et(t){let e=i=>{i.target.closest(`#iti-${this.id}__dropdown-content`)||this.#E()};setTimeout(()=>{document.documentElement.addEventListener("click",e,{signal:t})},0)}#it(t){let e="",i=null,s=o=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(o.key)&&(o.preventDefault(),o.stopPropagation(),o.key===C.ARROW_UP||o.key===C.ARROW_DOWN?this.#t.handleUpDownKey(o.key):o.key===C.ENTER&&!o.isComposing?this.#ot():o.key===C.ESC&&(this.#E(),this.#t.selectedCountry.focus())),!this.#e.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(o.key)&&(o.stopPropagation(),i&&clearTimeout(i),e+=o.key.toLowerCase(),this.#nt(e),i=setTimeout(()=>{e=""},B.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",s,{signal:t})}#st(t){this.#t.searchInput.addEventListener("input",()=>this.#t.handleSearchChange(),{signal:t}),this.#t.searchClearButton.addEventListener("click",()=>this.#t.handleSearchClear(),{signal:t})}#nt(t){let e=yt(this.#u,t);if(e){let i=e.nodeById[this.id];this.#t.highlightListItem(i,!1),this.#t.scrollCountryListToItem(i)}}#ot(){this.#t.highlightedItem&&this.#Y(this.#t.highlightedItem)}#v(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#e,o=t;if(e&&u.utils&&this.#i){let r=tt(t),l=i&&!r||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:c}=u.utils.numberFormat,h=l?a:c;o=u.utils.formatNumber(o,this.#i?.iso2,h)}o=this.#z(o),this.#f(o)}#F(t){let e=this.#G(t);return e!==null?this.#g(e):!1}#rt(t){let e=this.#i?.dialCode,i=this.#i?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#e.separateDialCode?t.substring(1):t;return`+${e}${r}`}#G(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#i?.iso2,o=this.#i?.dialCode;i=this.#rt(i);let r=this.#_(i,!0),l=A(i);if(r){let a=A(r),c=this.#m[a];if(c.length===1)return c[0]===s?null:c[0];if(!s&&this.#c&&c.includes(this.#c))return this.#c;if(o===$.NANP&&it(l))return null;let m=this.#i?.areaCodes,g=this.#i?.priority;if(m){let T=m.map(y=>`${o}${y}`);for(let y of T)if(l.startsWith(y))return null}let I=m&&!(g===0)&&l.length>a.length,D=s&&c.includes(s)&&!I,N=s===c[0];if(!D&&!N)return c[0]}else if(i.startsWith("+")&&l.length){let a=this.#i?.dialCode||"";return a&&a.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#c)return this.#c;return null}#g(t){let e=this.#i?.iso2||"";return this.#i=t?this.#L.get(t):null,this.#i&&(this.#c=this.#i.iso2),this.#t.setCountry(this.#i),this.#V(),this.#j(),e!==t}#j(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#e;if(!t||!u.utils)return;let s=this.#i?.iso2;if(!s){this.#s=null;return}let o=u.utils.numberType[e],r=u.utils.getExampleNumber(s,!1,o,!0),l=r;for(;u.utils.isPossibleNumber(r,s,i);)l=r,r+="0";let a=u.utils.getCoreNumber(l,s);this.#s=a.length,s==="by"&&(this.#s=a.length+1)}#V(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#e,o=t===P.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===P.POLITE;if(!u.utils||!o)return;let r=u.utils.numberType[e],l=this.#i?u.utils.getExampleNumber(this.#i.iso2,i,r):"";l=this.#z(l),typeof s=="function"&&(l=s(l,this.#i)),this.#t.telInput.setAttribute("placeholder",l)}#Y(t){let e=t.dataset[Q.COUNTRY_CODE],i=this.#g(e);this.#E();let s=t.dataset[Q.DIAL_CODE];if(this.#K(s),this.#e.formatOnDisplay){let o=this.#a();this.#v(o)}this.#t.telInput.focus(),i&&this.#P()}#E(t){this.#t.isDropdownClosed()||this.#e.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#o.abort(),this.#o=null,this.#b(H.CLOSE_COUNTRY_DROPDOWN))}#K(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#_(e),o;s?o=e.replace(s,i):o=i,this.#f(o)}#_(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#m[s])break;if(this.#I.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#p)break}return i}#y(t){let e=t?this.#r.normalise(t):this.#a(),i=this.#i?.dialCode,s,o=A(e);return this.#e.separateDialCode&&!e.startsWith("+")&&i&&o?s=`+${i}`:s="",s+e}#z(t){let e=!!this.#_(t),i=et(t,e,this.#e.separateDialCode,this.#i);return this.#$(i)}#X(){let t=this.#i;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#P(){let t=this.#X();this.#b(H.COUNTRY_CHANGE,t)}#q(){if(!this.#l||!u.autoCountry)return;if(this.#n){this.#l.resolve();return}this.#c=u.autoCountry,this.#i||this.#t.selectedCountryInner.classList.contains(d.GLOBE)||this.setCountry(this.#c),this.#l.resolve()}#lt(){if(this.#n){this.#l?.reject();return}this.#A(!0),this.#l?.reject()}#at(){if(this.#n){this.#h?.resolve();return}if(!u.utils){this.#h?.resolve();return}let t=this.#a();t&&this.#v(t),this.#i&&(this.#V(),this.#j()),this.#h?.resolve()}#ut(t){if(this.#n){this.#h?.reject(t);return}this.#h?.reject(t)}destroy(){this.#n||(this.#n=!0,this.#e.allowDropdown&&this.#E(!0),this.#d.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return!this.#n}getExtension(){return this.#n?"":(R("getExtension"),u.utils.getExtension(this.#y(),this.#i?.iso2))}getNumber(t){if(this.#n)return"";R("getNumber");let e=this.#i?.iso2,i=this.#y(),s=u.utils.formatNumber(i,e,t);return this.#r.denormalise(s)}getNumberType(){return this.#n?q.UNKNOWN_NUMBER_TYPE:(R("getNumberType"),u.utils.getNumberType(this.#y(),this.#i?.iso2))}getSelectedCountryData(){return this.#X()}getValidationError(){if(this.#n)return q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#i?.iso2;return u.utils.getValidationError(this.#y(),t)}isValidNumber(){if(this.#n)return null;R("isValidNumber");let t=this.#i?.dialCode,e=this.#i?.iso2,i=this.#y(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=A(r).length;if(s.length>l)return!1}}return this.#Q(!1)}isValidNumberPrecise(){return this.#n?null:(R("isValidNumberPrecise"),this.#Q(!0))}#ct(t){return u.utils?u.utils.isPossibleNumber(t,this.#i?.iso2,this.#e.allowedNumberTypes):null}#Q(t){let{allowNumberExtensions:e,allowPhonewords:i}=this.#e,s=a=>t?this.#dt(a):this.#ct(a),o=this.#y();if(!this.#i&&!tt(o)||!s(o))return!1;if(o.search(v.ALPHA_UNICODE)>-1){let a=this.#i?.iso2;return u.utils.getExtension(o,a)?e:i}return!0}#dt(t){return u.utils?u.utils.isValidNumber(t,this.#i?.iso2,this.#e.allowedNumberTypes):null}setCountry(t){if(this.#n)return;let e=t?.toLowerCase();if(!S(e))throw new Error(`Invalid country code: '${e}'`);let i=this.#i?.iso2;if(t&&e!==i||!t&&i){if(this.#g(e),this.#K(this.#i?.dialCode||""),this.#e.formatOnDisplay){let o=this.#a();this.#v(o)}this.#P()}}setNumber(t){if(this.#n)return;let e=this.#r.normalise(t),i=this.#F(e);this.#v(e),i&&this.#P(),this.#b(H.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#n||(this.#e.placeholderNumberType=t,this.#V())}setDisabled(t){this.#n||(this.#t.telInput.disabled=t,this.#t.selectedCountry&&(t?this.#t.selectedCountry.setAttribute("disabled","true"):this.#t.selectedCountry.removeAttribute("disabled")))}setReadonly(t){this.#t.telInput&&(this.#t.telInput.readOnly=t,this.#t.selectedCountry&&(t?this.#t.selectedCountry.setAttribute("disabled","true"):this.#t.selectedCountry.removeAttribute("disabled")))}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtils":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountry":o.#q();break;case"handleAutoCountryFailure":o.#lt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtilsScript){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof n}`));return u.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,x.forEachInstance("handleUtils"),!0}).catch(e=>{throw x.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new x(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:G,documentReady:()=>document.readyState==="complete",getCountryData:()=>_,getInstance:n=>{let t=n.dataset.intlTelInputId;return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"27.0.3"}),Yt=u;return Rt(Kt);})();
|
|
24
|
+
</svg>`;var M=class n{#t;#e;#C;#u="";#p;#f=null;#I;#L;#i;#s;#c;#n;#d;#o;#r=null;#l=null;telInput;countryContainer;selectedCountry;selectedCountryInner;searchInput;searchClearButton;countryList;hiddenInputPhone;hiddenInputCountry;highlightedItem=null;hadInitialPlaceholder;constructor(t,e,i){t.dataset.intlTelInputId=i.toString(),this.telInput=t,this.#t=e,this.#e=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#C=!!this.telInput.closest("[dir=rtl]"),this.#t.separateDialCode&&(this.#u=this.telInput.style.paddingLeft)}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}generateMarkup(t){this.#p=t,this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("type")||this.telInput.setAttribute("type","tel"),this.telInput.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","tel"),this.telInput.hasAttribute("inputmode")||this.telInput.setAttribute("inputmode","tel");let e=this.#h();this.#a(e),e.appendChild(this.telInput),this.#R(),this.#x(e)}#h(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=j({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=f("div",{class:o});return this.#C&&r.setAttribute("dir","ltr"),this.telInput.before(r),r}#a(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.countryContainer=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.selectedCountry=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#e}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=f("div",{class:"iti__selected-country"},this.countryContainer);let o=f("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=f("div",{class:d.FLAG},o),e&&(this.#i=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},o)),i&&(this.#L=f("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e&&this.#m()}maybeEnsureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInput.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#m(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#e}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${l}`,role:"dialog",[p.MODAL]:"true"}),this.#C&&this.#s.setAttribute("dir","rtl"),i&&this.#M(),this.countryList=f("ul",{class:"iti__country-list",id:`iti-${this.#e}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#N(),i&&this.#D(),e||(this.#I=this.#k(),i&&(this.#s.style.height=`${this.#I}px`)),o){let a=j({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#o=f("div",{class:a}),this.#o.appendChild(this.#s)}else this.countryContainer.appendChild(this.#s)}#M(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#c=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#c.innerHTML=Ct(),this.searchInput=f("input",{id:`iti-${this.#e}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#e}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.searchClearButton=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.searchClearButton.innerHTML=gt(this.#e),this.#d=f("span",{class:"iti__a11y-text"},this.#s),this.#n=f("div",{class:`iti__no-results ${d.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#n.textContent=t.searchEmptyState??null}#R(){this.countryContainer&&(this.#v(),this.countryContainer.classList.remove(d.V_HIDE))}#x(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInput.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInput.form?.querySelector(`input[name="${s.phone}"]`);o?this.hiddenInputPhone=o:(this.hiddenInputPhone=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.hiddenInputPhone))}if(s.country){let o=this.telInput.form?.querySelector(`input[name="${s.country}"]`);o?this.hiddenInputCountry=o:(this.hiddenInputCountry=f("input",{type:"hidden",name:s.country}),t.appendChild(this.hiddenInputCountry))}}#N(){let t=document.createDocumentFragment();for(let e=0;e<this.#p.length;e++){let i=this.#p[e],s=j({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#e}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset.dialCode=i.dialCode,o.dataset.countryCode=i.iso2,i.nodeById[this.#e]=o,this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#C&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.countryList.appendChild(t)}#v(){if(this.selectedCountry){let t=this.#t.separateDialCode?L.SANE_SELECTED_WITH_DIAL_WIDTH:L.SANE_SELECTED_NO_DIAL_WIDTH,i=(this.selectedCountry.offsetWidth||this.#H()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInput.style.paddingLeft=`${i}px`}}static#A(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#H(){if(!this.telInput.parentNode)return 0;let t=n.#A(),e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.countryContainer.cloneNode();e.appendChild(i);let s=this.selectedCountry.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#k(){let t=n.#A();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.SANE_DROPDOWN_HEIGHT}#D(){let{i18n:t}=this.#t,e=this.countryList.childElementCount;this.#d.textContent=t.searchSummaryAria(e)}filterCountriesByQuery(t){let e;t===""?e=this.#p:e=mt(this.#p,t),this.#W(e)}#b(){let t=this.searchInput.value.trim();this.filterCountriesByQuery(t),this.searchInput.value?this.searchClearButton.classList.remove(d.HIDE):this.searchClearButton.classList.add(d.HIDE)}handleSearchChange(){this.#f&&clearTimeout(this.#f),this.#f=setTimeout(()=>{this.#b(),this.#f=null},B.SEARCH_DEBOUNCE_MS)}handleSearchClear(){this.searchInput.value="",this.searchInput.focus(),this.#b()}scrollCountryListToItem(t){let e=this.countryList,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}highlightListItem(t,e){let i=this.highlightedItem;if(i&&i.classList.remove(d.HIGHLIGHT),this.highlightedItem=t,this.highlightedItem){if(this.highlightedItem.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let s=this.highlightedItem.getAttribute("id")||"";this.searchInput.setAttribute(p.ACTIVE_DESCENDANT,s)}e&&this.highlightedItem.focus()}}handleUpDownKey(t){let e=t===C.ARROW_UP?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!e&&this.countryList.childElementCount>1&&(e=t===C.ARROW_UP?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this.scrollCountryListToItem(e),this.highlightListItem(e,!1))}#U(t){if(this.#r&&this.#r.dataset.countryCode!==t&&(this.#r.setAttribute(p.SELECTED,"false"),this.#r.querySelector(".iti__country-check")?.remove(),this.#r=null),t&&!this.#r){let e=this.countryList.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(p.SELECTED,"true");let i=f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e);i.innerHTML=It(),this.#r=e}}}#W(t){this.countryList.replaceChildren();let e=!0;for(let i of t){let s=i.nodeById[this.#e];s&&(this.countryList.appendChild(s),e&&(this.highlightListItem(s,!1),e=!1))}e?(this.highlightListItem(null,!1),this.#n&&this.#n.classList.remove(d.HIDE)):this.#n&&this.#n.classList.add(d.HIDE),this.countryList.scrollTop=0,this.#D()}destroy(){this.telInput.iti=void 0,delete this.telInput.dataset.intlTelInputId,this.#t.separateDialCode&&(this.telInput.style.paddingLeft=this.#u);let t=this.telInput.parentNode;t.before(this.telInput),t.remove();for(let e of this.#p)delete e.nodeById[this.#e]}openDropdown(){let{countrySearch:t,dropdownAlwaysOpen:e,dropdownContainer:i}=this.#t;if(this.maybeEnsureDropdownWidthSet(),i)this.#B();else{let o=this.#T(),r=this.telInput.offsetHeight+L.DROPDOWN_MARGIN;o?this.#s.style.top=`${r}px`:this.#s.style.bottom=`${r}px`}this.#s.classList.remove(d.HIDE),this.selectedCountry.setAttribute(p.EXPANDED,"true");let s=this.#r??this.countryList.firstElementChild;s&&(this.highlightListItem(s,!1),this.scrollCountryListToItem(s)),t&&!e&&this.searchInput.focus(),this.#t.useFullscreenPopup&&this.#o&&window.visualViewport&&(this.#l=()=>{this.#$(),this.highlightedItem&&this.scrollCountryListToItem(this.highlightedItem)},window.visualViewport.addEventListener("resize",this.#l)),this.#i.classList.add(d.ARROW_UP)}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#s.classList.add(d.HIDE),this.selectedCountry.setAttribute(p.EXPANDED,"false"),t&&(this.searchInput.removeAttribute(p.ACTIVE_DESCENDANT),this.searchInput.value="",this.#b(),this.highlightedItem&&(this.highlightedItem.classList.remove(d.HIGHLIGHT),this.highlightedItem=null)),this.#i.classList.remove(d.ARROW_UP),this.#l&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.#l),this.#l=null),e?(this.#o.remove(),this.#o.style.top="",this.#o.style.bottom="",this.#o.style.paddingLeft="",this.#o.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#T(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInput.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#I||i>=e}#B(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInput.getBoundingClientRect();this.#o.style.paddingLeft=`${i.left}px`,this.#o.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInput.getBoundingClientRect();this.#o.style.left=`${i.left}px`,this.#T()?this.#o.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#o.style.top="unset",this.#o.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#o)}#$(){let t=window.visualViewport;if(!t||!this.#o)return;let e=window.innerHeight-t.height;this.#o.style.bottom=`${e}px`}isDropdownClosed(){return this.#s.classList.contains(d.HIDE)}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#U(a),this.selectedCountry){let c=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,h,m,g;a?(m=r,h=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),g=i?"":Z()):(m=o.noCountrySelected,h=o.noCountrySelected,g=Z()),this.selectedCountryInner.className=c,this.selectedCountry.setAttribute("title",m),this.selectedCountry.setAttribute(p.LABEL,h),this.selectedCountryInner.innerHTML=g}if(s){let c=l?`+${l}`:"";this.#L.textContent=c,this.#v()}}};var bt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?_.filter(i=>t.includes(i.iso2)):e?.length?_.filter(i=>!e.includes(i.iso2)):[..._]},Et=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Lt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let c=1;c<a.length;c++){let h=a.substring(0,c),m=r.dialCode+h;s(l,m),s(r.iso2,m)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLen:e,dialCodeToIso2Map:i}},wt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})},Nt=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var Ft=new Set(["800","808","870","881","882","883","888","979"]),tt=n=>{let t=A(n).slice(0,3);return n.startsWith("+")&&Ft.has(t)};var et=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},vt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var At=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Vt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),it=n=>{let t=A(n);if(t.startsWith($.NANP)&&t.length>=4){let e=t.substring(1,4);return Vt.has(e)}return!1};var Y=class{#t;constructor(t){t&&this.#e(t)}#e(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#e(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Gt=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Dt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},x=class n{id;promise;#t;#e;#C;#u;#p;#f;#I;#L;#i=null;#s=null;#c;#n=!1;#d;#o=null;#r;#l;#h;constructor(t,e={}){this.id=Gt++,M.validateInput(t);let i=dt(e);this.#e={...G,...i},ht(this.#e),pt(this.#e),this.#t=new M(t,this.#e,this.id),this.#C=ft(),this.#r=new Y(t.value),this.promise=this.#M(this.#e),this.#u=bt(this.#e);let{dialCodes:s,dialCodeMaxLen:o,dialCodeToIso2Map:r}=Lt(this.#u);this.#I=s,this.#p=o,this.#f=r,this.#L=new Map(this.#u.map(l=>[l.iso2,l])),this.#R()}#a(){let t=this.#t.telInput.value.trim();return this.#r.normalise(t)}#m(t){this.#t.telInput.value=this.#r.denormalise(t)}#M(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#l=Dt()),r&&(this.#h=Dt()),Promise.all([this.#l?.promise,this.#h?.promise]).then(()=>{})}#R(){this.#d=new AbortController,this.#x(),this.#t.generateMarkup(this.#u),this.#N(),this.#t.maybeEnsureDropdownWidthSet(),this.#v(),this.#k(),this.#e.dropdownAlwaysOpen&&this.#O()}#x(){Et(this.#u,this.#e),wt(this.#u,this.#e),Nt(this.#u)}#N(t=!1){let e=this.#t.telInput.getAttribute("value"),i=this.#r.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#_(r),a=it(r),{initialCountry:c,geoIpLookup:h}=this.#e,g=c===k.AUTO&&h&&!t,w=O(c);l?a?w?this.#g(c):g||this.#g(nt.ISO2):this.#F(r):w?this.#g(c):g||this.#g(""),r&&this.#w(r)}#v(){this.#U(),this.#e.allowDropdown&&this.#H(),(this.#t.hiddenInputPhone||this.#t.hiddenInputCountry)&&this.#t.telInput.form&&this.#A()}#A(){let t=()=>{this.#t.hiddenInputPhone&&(this.#t.hiddenInputPhone.value=this.getNumber()),this.#t.hiddenInputCountry&&(this.#t.hiddenInputCountry.value=this.#i?.iso2||"")};this.#t.telInput.form?.addEventListener("submit",t,{signal:this.#d.signal})}#H(){let t=this.#d.signal,e=r=>{this.#t.isDropdownClosed()?this.#t.telInput.focus():r.preventDefault()},i=this.#t.telInput.closest("label");i&&i.addEventListener("click",e,{signal:t});let s=()=>{this.#t.isDropdownClosed()&&!this.#t.telInput.disabled&&!this.#t.telInput.readOnly&&this.#O()};this.#t.selectedCountry.addEventListener("click",s,{signal:t});let o=r=>{let l=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];this.#t.isDropdownClosed()&&l.includes(r.key)&&(r.preventDefault(),r.stopPropagation(),this.#O()),r.key===C.TAB&&this.#E()};this.#t.countryContainer.addEventListener("keydown",o,{signal:t})}#k(){if(this.#h){let{loadUtils:t}=this.#e,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#d.signal})}this.#l&&(this.#i?this.#l.resolve():this.#D())}#D(){if(u.autoCountry){this.#q();return}if(this.#t.selectedCountryInner.classList.add(d.LOADING),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#e.geoIpLookup=="function")){let t=(i="")=>{this.#t.selectedCountryInner.classList.remove(d.LOADING);let s=i.toLowerCase();O(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountry"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{this.#t.selectedCountryInner.classList.remove(d.LOADING),n.forEachInstance("handleAutoCountryFailure")};this.#e.geoIpLookup(t,e)}}#b(){this.#O(),this.#t.searchInput.value="+",this.#t.filterCountriesByQuery("")}#U(){this.#W(),this.#T(),this.#B()}#W(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#e,r=!1;v.ALPHA_UNICODE.test(this.#a())&&(r=!0);let l=a=>{let c=this.#a();if(this.#C&&a?.data==="+"&&i&&s&&o){let I=this.#t.telInput.selectionStart||0,D=c.substring(0,I-1),N=c.substring(I);this.#m(D+N),this.#b();return}this.#F(c)&&this.#P();let h=a?.data&&v.NON_PLUS_NUMERIC.test(a.data),m=a?.inputType===X.PASTE&&c;h||m&&!t?r=!0:v.NON_PLUS_NUMERIC.test(c)||(r=!1);let g=a?.detail&&a.detail.isSetNumber,w=this.#r.isAscii();if(e&&!r&&!g&&w){let I=this.#t.telInput.selectionStart||0,N=c.substring(0,I).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,T=a?.inputType===X.DELETE_FWD,y=this.#y(),S=vt(y,c,u.utils,this.#i,i),E=At(N,S,I,T);this.#m(S),this.#t.telInput.setSelectionRange(E,E)}if(i&&c.startsWith("+")&&this.#i?.dialCode){let I=et(c,!0,i,this.#i);this.#m(I)}};this.#t.telInput.addEventListener("input",l,{signal:this.#d.signal})}#T(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:s}=this.#e;if(!t&&!e)return;let o=r=>{if(!r.key||r.key.length!==1||r.altKey||r.ctrlKey||r.metaKey)return;if(e&&i&&s&&r.key==="+"){r.preventDefault(),this.#b();return}if(!t)return;let l=this.#a(),c=!l.startsWith("+")&&this.#t.telInput.selectionStart===0&&r.key==="+",h=this.#r.normalise(r.key),m=/^[0-9]$/.test(h),g=e?m:c||m,w=this.#t.telInput,I=w.selectionStart,D=w.selectionEnd,N=l.slice(0,I??void 0),T=l.slice(D??void 0),y=N+r.key+T,S=this.#y(y),E=!1;u.utils&&this.#s&&(E=u.utils.getCoreNumber(S,this.#i?.iso2).length>this.#s);let Tt=this.#G(S)!==null;(!g||E&&!Tt&&!c)&&r.preventDefault()};this.#t.telInput.addEventListener("keydown",o,{signal:this.#d.signal})}#B(){if(!this.#e.strictMode)return;let t=e=>{e.preventDefault();let i=this.#t.telInput,s=i.selectionStart,o=i.selectionEnd,r=this.#a(),l=r.slice(0,s??void 0),a=r.slice(o??void 0),c=this.#i?.iso2,h=e.clipboardData.getData("text"),m=this.#r.normalise(h),g=s===0&&o>0,w=!r.startsWith("+")||g,I=m.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),D=I.startsWith("+"),N=I.replace(/\+/g,""),T=D&&w?`+${N}`:N,y=l+T+a;if(y.length>5&&u.utils){let E=u.utils.getCoreNumber(y,c);for(;E.length===0&&y.length>0;)y=y.slice(0,-1),E=u.utils.getCoreNumber(y,c);if(!E)return;if(this.#s&&E.length>this.#s)if(i.selectionEnd===r.length){let st=E.length-this.#s;y=y.slice(0,y.length-st)}else return}this.#m(y);let S=s+T.length;i.setSelectionRange(S,S),i.dispatchEvent(new InputEvent("input",{bubbles:!0}))};this.#t.telInput.addEventListener("paste",t,{signal:this.#d.signal})}#$(t){let e=Number(this.#t.telInput.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#S(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInput.dispatchEvent(i)}#O(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#e;if(this.#o=new AbortController,this.#t.openDropdown(),!e&&t){let i=()=>this.#E();window.addEventListener("scroll",i,{signal:this.#o.signal})}this.#J(),this.#S(H.OPEN_COUNTRY_DROPDOWN)}#J(){let t=this.#o.signal;this.#Z(t),this.#tt(t),this.#e.dropdownAlwaysOpen||this.#et(t),this.#it(t),this.#e.countrySearch&&this.#st(t)}#Z(t){let e=i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&this.#t.highlightListItem(s,!1)};this.#t.countryList.addEventListener("mouseover",e,{signal:t})}#tt(t){let e=i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&this.#Y(s)};this.#t.countryList.addEventListener("click",e,{signal:t})}#et(t){let e=i=>{i.target.closest(`#iti-${this.id}__dropdown-content`)||this.#E()};setTimeout(()=>{document.documentElement.addEventListener("click",e,{signal:t})},0)}#it(t){let e="",i=null,s=o=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(o.key)&&(o.preventDefault(),o.stopPropagation(),o.key===C.ARROW_UP||o.key===C.ARROW_DOWN?this.#t.handleUpDownKey(o.key):o.key===C.ENTER&&!o.isComposing?this.#ot():o.key===C.ESC&&(this.#E(),this.#t.selectedCountry.focus())),!this.#e.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(o.key)&&(o.stopPropagation(),i&&clearTimeout(i),e+=o.key.toLowerCase(),this.#nt(e),i=setTimeout(()=>{e=""},B.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",s,{signal:t})}#st(t){this.#t.searchInput.addEventListener("input",()=>this.#t.handleSearchChange(),{signal:t}),this.#t.searchClearButton.addEventListener("click",()=>this.#t.handleSearchClear(),{signal:t})}#nt(t){let e=yt(this.#u,t);if(e){let i=e.nodeById[this.id];this.#t.highlightListItem(i,!1),this.#t.scrollCountryListToItem(i)}}#ot(){this.#t.highlightedItem&&this.#Y(this.#t.highlightedItem)}#w(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#e,o=t;if(e&&u.utils&&this.#i){let r=tt(t),l=i&&!r||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:c}=u.utils.numberFormat,h=l?a:c;o=u.utils.formatNumber(o,this.#i?.iso2,h)}o=this.#z(o),this.#m(o)}#F(t){let e=this.#G(t);return e!==null?this.#g(e):!1}#rt(t){let e=this.#i?.dialCode,i=this.#i?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#e.separateDialCode?t.substring(1):t;return`+${e}${r}`}#G(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#i?.iso2,o=this.#i?.dialCode;i=this.#rt(i);let r=this.#_(i,!0),l=A(i);if(r){let a=A(r),c=this.#f[a];if(c.length===1)return c[0]===s?null:c[0];if(!s&&this.#c&&c.includes(this.#c))return this.#c;if(o===$.NANP&&it(l))return null;let m=this.#i?.areaCodes,g=this.#i?.priority;if(m){let T=m.map(y=>`${o}${y}`);for(let y of T)if(l.startsWith(y))return null}let I=m&&!(g===0)&&l.length>a.length,D=s&&c.includes(s)&&!I,N=s===c[0];if(!D&&!N)return c[0]}else if(i.startsWith("+")&&l.length){let a=this.#i?.dialCode||"";return a&&a.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#c)return this.#c;return null}#g(t){let e=this.#i?.iso2||"";return this.#i=t?this.#L.get(t):null,this.#i&&(this.#c=this.#i.iso2),this.#t.setCountry(this.#i),this.#V(),this.#j(),e!==t}#j(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#e;if(!t||!u.utils)return;let s=this.#i?.iso2;if(!s){this.#s=null;return}let o=u.utils.numberType[e],r=u.utils.getExampleNumber(s,!1,o,!0),l=r;for(;u.utils.isPossibleNumber(r,s,i);)l=r,r+="0";let a=u.utils.getCoreNumber(l,s);this.#s=a.length,s==="by"&&(this.#s=a.length+1)}#V(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#e,o=t===P.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===P.POLITE;if(!u.utils||!o)return;let r=u.utils.numberType[e],l=this.#i?u.utils.getExampleNumber(this.#i.iso2,i,r):"";l=this.#z(l),typeof s=="function"&&(l=s(l,this.#i)),this.#t.telInput.setAttribute("placeholder",l)}#Y(t){let e=t.dataset[Q.COUNTRY_CODE],i=this.#g(e);this.#E();let s=t.dataset[Q.DIAL_CODE];if(this.#K(s),this.#e.formatOnDisplay){let o=this.#a();this.#w(o)}this.#t.telInput.focus(),i&&this.#P()}#E(t){this.#t.isDropdownClosed()||this.#e.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#o.abort(),this.#o=null,this.#S(H.CLOSE_COUNTRY_DROPDOWN))}#K(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#_(e),o;s?o=e.replace(s,i):o=i,this.#m(o)}#_(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#f[s])break;if(this.#I.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#p)break}return i}#y(t){let e=t?this.#r.normalise(t):this.#a(),i=this.#i?.dialCode,s,o=A(e);return this.#e.separateDialCode&&!e.startsWith("+")&&i&&o?s=`+${i}`:s="",s+e}#z(t){let e=!!this.#_(t),i=et(t,e,this.#e.separateDialCode,this.#i);return this.#$(i)}#X(){let t=this.#i;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#P(){let t=this.#X();this.#S(H.COUNTRY_CHANGE,t)}#q(){if(!this.#l||!u.autoCountry)return;if(this.#n){this.#l.resolve();return}this.#c=u.autoCountry,this.#i||this.#t.selectedCountryInner.classList.contains(d.GLOBE)||this.setCountry(this.#c),this.#l.resolve()}#lt(){if(this.#n){this.#l?.reject();return}this.#N(!0),this.#l?.reject()}#at(){if(this.#n){this.#h?.resolve();return}if(!u.utils){this.#h?.resolve();return}let t=this.#a();t&&this.#w(t),this.#i&&(this.#V(),this.#j()),this.#h?.resolve()}#ut(t){if(this.#n){this.#h?.reject(t);return}this.#h?.reject(t)}destroy(){this.#n||(this.#n=!0,this.#e.allowDropdown&&this.#E(!0),this.#d.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return!this.#n}getExtension(){return this.#n?"":(R("getExtension"),u.utils.getExtension(this.#y(),this.#i?.iso2))}getNumber(t){if(this.#n)return"";R("getNumber");let e=this.#i?.iso2,i=this.#y(),s=u.utils.formatNumber(i,e,t);return this.#r.denormalise(s)}getNumberType(){return this.#n?q.UNKNOWN_NUMBER_TYPE:(R("getNumberType"),u.utils.getNumberType(this.#y(),this.#i?.iso2))}getSelectedCountryData(){return this.#X()}getValidationError(){if(this.#n)return q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#i?.iso2;return u.utils.getValidationError(this.#y(),t)}isValidNumber(){if(this.#n)return null;R("isValidNumber");let t=this.#i?.dialCode,e=this.#i?.iso2,i=this.#y(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=A(r).length;if(s.length>l)return!1}}return this.#Q(!1)}isValidNumberPrecise(){return this.#n?null:(R("isValidNumberPrecise"),this.#Q(!0))}#ct(t){return u.utils?u.utils.isPossibleNumber(t,this.#i?.iso2,this.#e.allowedNumberTypes):null}#Q(t){let{allowNumberExtensions:e,allowPhonewords:i}=this.#e,s=a=>t?this.#dt(a):this.#ct(a),o=this.#y();if(!this.#i&&!tt(o)||!s(o))return!1;if(o.search(v.ALPHA_UNICODE)>-1){let a=this.#i?.iso2;return u.utils.getExtension(o,a)?e:i}return!0}#dt(t){return u.utils?u.utils.isValidNumber(t,this.#i?.iso2,this.#e.allowedNumberTypes):null}setCountry(t){if(this.#n)return;let e=t?.toLowerCase();if(!O(e))throw new Error(`Invalid country code: '${e}'`);let i=this.#i?.iso2;if(t&&e!==i||!t&&i){if(this.#g(e),this.#K(this.#i?.dialCode||""),this.#e.formatOnDisplay){let o=this.#a();this.#w(o)}this.#P()}}setNumber(t){if(this.#n)return;let e=this.#r.normalise(t),i=this.#F(e);this.#w(e),i&&this.#P(),this.#S(H.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#n||(this.#e.placeholderNumberType=t,this.#V())}setDisabled(t){this.#n||(this.#t.telInput.disabled=t,this.#t.selectedCountry&&(t?this.#t.selectedCountry.setAttribute("disabled","true"):this.#t.selectedCountry.removeAttribute("disabled")))}setReadonly(t){this.#t.telInput&&(this.#t.telInput.readOnly=t,this.#t.selectedCountry&&(t?this.#t.selectedCountry.setAttribute("disabled","true"):this.#t.selectedCountry.removeAttribute("disabled")))}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtils":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountry":o.#q();break;case"handleAutoCountryFailure":o.#lt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtilsScript){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof n}`));return u.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,x.forEachInstance("handleUtils"),!0}).catch(e=>{throw x.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new x(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:G,documentReady:()=>document.readyState==="complete",getCountryData:()=>_,getInstance:n=>{let t=n.dataset.intlTelInputId;return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"27.0.4"}),Yt=u;return Rt(Kt);})();
|
|
25
25
|
var intlTelInput = _factory.default;
|
package/dist/js/intlTelInput.mjs
CHANGED
|
@@ -2371,7 +2371,6 @@ var UI = class _UI {
|
|
|
2371
2371
|
const wrapper = this.#createWrapperAndInsert();
|
|
2372
2372
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2373
2373
|
wrapper.appendChild(this.telInput);
|
|
2374
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2375
2374
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2376
2375
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2377
2376
|
}
|
|
@@ -2453,7 +2452,7 @@ var UI = class _UI {
|
|
|
2453
2452
|
this.#buildDropdownContent();
|
|
2454
2453
|
}
|
|
2455
2454
|
}
|
|
2456
|
-
|
|
2455
|
+
maybeEnsureDropdownWidthSet() {
|
|
2457
2456
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2458
2457
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2459
2458
|
return;
|
|
@@ -2861,7 +2860,7 @@ var UI = class _UI {
|
|
|
2861
2860
|
// UI: Open the dropdown (DOM only).
|
|
2862
2861
|
openDropdown() {
|
|
2863
2862
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2864
|
-
this
|
|
2863
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2865
2864
|
if (dropdownContainer) {
|
|
2866
2865
|
this.#handleDropdownContainer();
|
|
2867
2866
|
} else {
|
|
@@ -3336,6 +3335,7 @@ var Iti = class _Iti {
|
|
|
3336
3335
|
this.#processCountryData();
|
|
3337
3336
|
this.#ui.generateMarkup(this.#countries);
|
|
3338
3337
|
this.#setInitialState();
|
|
3338
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3339
3339
|
this.#initListeners();
|
|
3340
3340
|
this.#initRequests();
|
|
3341
3341
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4502,7 +4502,7 @@ var intlTelInput = Object.assign(
|
|
|
4502
4502
|
attachUtils,
|
|
4503
4503
|
startedLoadingUtilsScript: false,
|
|
4504
4504
|
startedLoadingAutoCountry: false,
|
|
4505
|
-
version: "27.0.
|
|
4505
|
+
version: "27.0.4"
|
|
4506
4506
|
}
|
|
4507
4507
|
);
|
|
4508
4508
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.0.
|
|
2
|
+
* International Telephone Input v27.0.4
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -2402,7 +2402,6 @@ var _factory = (() => {
|
|
|
2402
2402
|
const wrapper = this.#createWrapperAndInsert();
|
|
2403
2403
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2404
2404
|
wrapper.appendChild(this.telInput);
|
|
2405
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2406
2405
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2407
2406
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2408
2407
|
}
|
|
@@ -2484,7 +2483,7 @@ var _factory = (() => {
|
|
|
2484
2483
|
this.#buildDropdownContent();
|
|
2485
2484
|
}
|
|
2486
2485
|
}
|
|
2487
|
-
|
|
2486
|
+
maybeEnsureDropdownWidthSet() {
|
|
2488
2487
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2489
2488
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2490
2489
|
return;
|
|
@@ -2892,7 +2891,7 @@ var _factory = (() => {
|
|
|
2892
2891
|
// UI: Open the dropdown (DOM only).
|
|
2893
2892
|
openDropdown() {
|
|
2894
2893
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2895
|
-
this
|
|
2894
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2896
2895
|
if (dropdownContainer) {
|
|
2897
2896
|
this.#handleDropdownContainer();
|
|
2898
2897
|
} else {
|
|
@@ -3367,6 +3366,7 @@ var _factory = (() => {
|
|
|
3367
3366
|
this.#processCountryData();
|
|
3368
3367
|
this.#ui.generateMarkup(this.#countries);
|
|
3369
3368
|
this.#setInitialState();
|
|
3369
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3370
3370
|
this.#initListeners();
|
|
3371
3371
|
this.#initRequests();
|
|
3372
3372
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4533,7 +4533,7 @@ var _factory = (() => {
|
|
|
4533
4533
|
attachUtils,
|
|
4534
4534
|
startedLoadingUtilsScript: false,
|
|
4535
4535
|
startedLoadingAutoCountry: false,
|
|
4536
|
-
version: "27.0.
|
|
4536
|
+
version: "27.0.4"
|
|
4537
4537
|
}
|
|
4538
4538
|
);
|
|
4539
4539
|
var intl_tel_input_default = intlTelInput;
|