intl-tel-input 25.12.2 → 25.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "25.12.2",
3
+ "version": "25.12.4",
4
4
  "description": "A JavaScript plugin for entering and validating international telephone numbers",
5
5
  "keywords": [
6
6
  "international",
package/react/README.md CHANGED
@@ -28,7 +28,7 @@ import "intl-tel-input/styles";
28
28
 
29
29
  See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/react/demo/validation/ValidationApp.tsx) for a more fleshed-out example of how to handle validation.
30
30
 
31
- A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.2/build/js/utils.js"`.
31
+ A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"`.
32
32
 
33
33
  ## Props
34
34
  Here's a list of all of the current props you can pass to the IntlTelInput React component.
@@ -3584,6 +3584,10 @@ var Iti = class _Iti {
3584
3584
  return iso2Codes[0];
3585
3585
  }
3586
3586
  } else if (number.startsWith("+") && numeric.length) {
3587
+ const currentDial = this.selectedCountryData.dialCode || "";
3588
+ if (currentDial && currentDial.startsWith(numeric)) {
3589
+ return null;
3590
+ }
3587
3591
  return "";
3588
3592
  } else if ((!number || number === "+") && !selectedIso2) {
3589
3593
  return this.defaultCountry;
@@ -3736,19 +3740,23 @@ var Iti = class _Iti {
3736
3740
  let dialCode = "";
3737
3741
  if (number.startsWith("+")) {
3738
3742
  let numericChars = "";
3743
+ let foundBaseDialCode = false;
3739
3744
  for (let i = 0; i < number.length; i++) {
3740
3745
  const c = number.charAt(i);
3741
3746
  if (/[0-9]/.test(c)) {
3742
3747
  numericChars += c;
3743
- const isMatch = Boolean(this.dialCodeToIso2Map[numericChars]);
3744
- if (!isMatch) {
3748
+ const hasMapEntry = Boolean(this.dialCodeToIso2Map[numericChars]);
3749
+ if (!hasMapEntry) {
3745
3750
  break;
3746
3751
  }
3747
- if (includeAreaCode) {
3752
+ if (this.dialCodes.has(numericChars)) {
3748
3753
  dialCode = number.substring(0, i + 1);
3749
- } else if (this.dialCodes.has(numericChars)) {
3754
+ foundBaseDialCode = true;
3755
+ if (!includeAreaCode) {
3756
+ break;
3757
+ }
3758
+ } else if (includeAreaCode && foundBaseDialCode) {
3750
3759
  dialCode = number.substring(0, i + 1);
3751
- break;
3752
3760
  }
3753
3761
  if (numericChars.length === this.dialCodeMaxLen) {
3754
3762
  break;
@@ -4032,7 +4040,7 @@ var intlTelInput = Object.assign(
4032
4040
  attachUtils,
4033
4041
  startedLoadingUtilsScript: false,
4034
4042
  startedLoadingAutoCountry: false,
4035
- version: "25.12.2"
4043
+ version: "25.12.4"
4036
4044
  }
4037
4045
  );
4038
4046
  var intl_tel_input_default = intlTelInput;
@@ -3548,6 +3548,10 @@ var Iti = class _Iti {
3548
3548
  return iso2Codes[0];
3549
3549
  }
3550
3550
  } else if (number.startsWith("+") && numeric.length) {
3551
+ const currentDial = this.selectedCountryData.dialCode || "";
3552
+ if (currentDial && currentDial.startsWith(numeric)) {
3553
+ return null;
3554
+ }
3551
3555
  return "";
3552
3556
  } else if ((!number || number === "+") && !selectedIso2) {
3553
3557
  return this.defaultCountry;
@@ -3700,19 +3704,23 @@ var Iti = class _Iti {
3700
3704
  let dialCode = "";
3701
3705
  if (number.startsWith("+")) {
3702
3706
  let numericChars = "";
3707
+ let foundBaseDialCode = false;
3703
3708
  for (let i = 0; i < number.length; i++) {
3704
3709
  const c = number.charAt(i);
3705
3710
  if (/[0-9]/.test(c)) {
3706
3711
  numericChars += c;
3707
- const isMatch = Boolean(this.dialCodeToIso2Map[numericChars]);
3708
- if (!isMatch) {
3712
+ const hasMapEntry = Boolean(this.dialCodeToIso2Map[numericChars]);
3713
+ if (!hasMapEntry) {
3709
3714
  break;
3710
3715
  }
3711
- if (includeAreaCode) {
3716
+ if (this.dialCodes.has(numericChars)) {
3712
3717
  dialCode = number.substring(0, i + 1);
3713
- } else if (this.dialCodes.has(numericChars)) {
3718
+ foundBaseDialCode = true;
3719
+ if (!includeAreaCode) {
3720
+ break;
3721
+ }
3722
+ } else if (includeAreaCode && foundBaseDialCode) {
3714
3723
  dialCode = number.substring(0, i + 1);
3715
- break;
3716
3724
  }
3717
3725
  if (numericChars.length === this.dialCodeMaxLen) {
3718
3726
  break;
@@ -3996,7 +4004,7 @@ var intlTelInput = Object.assign(
3996
4004
  attachUtils,
3997
4005
  startedLoadingUtilsScript: false,
3998
4006
  startedLoadingAutoCountry: false,
3999
- version: "25.12.2"
4007
+ version: "25.12.4"
4000
4008
  }
4001
4009
  );
4002
4010
  var intl_tel_input_default = intlTelInput;
@@ -3584,6 +3584,10 @@ var Iti = class _Iti {
3584
3584
  return iso2Codes[0];
3585
3585
  }
3586
3586
  } else if (number.startsWith("+") && numeric.length) {
3587
+ const currentDial = this.selectedCountryData.dialCode || "";
3588
+ if (currentDial && currentDial.startsWith(numeric)) {
3589
+ return null;
3590
+ }
3587
3591
  return "";
3588
3592
  } else if ((!number || number === "+") && !selectedIso2) {
3589
3593
  return this.defaultCountry;
@@ -3736,19 +3740,23 @@ var Iti = class _Iti {
3736
3740
  let dialCode = "";
3737
3741
  if (number.startsWith("+")) {
3738
3742
  let numericChars = "";
3743
+ let foundBaseDialCode = false;
3739
3744
  for (let i = 0; i < number.length; i++) {
3740
3745
  const c = number.charAt(i);
3741
3746
  if (/[0-9]/.test(c)) {
3742
3747
  numericChars += c;
3743
- const isMatch = Boolean(this.dialCodeToIso2Map[numericChars]);
3744
- if (!isMatch) {
3748
+ const hasMapEntry = Boolean(this.dialCodeToIso2Map[numericChars]);
3749
+ if (!hasMapEntry) {
3745
3750
  break;
3746
3751
  }
3747
- if (includeAreaCode) {
3752
+ if (this.dialCodes.has(numericChars)) {
3748
3753
  dialCode = number.substring(0, i + 1);
3749
- } else if (this.dialCodes.has(numericChars)) {
3754
+ foundBaseDialCode = true;
3755
+ if (!includeAreaCode) {
3756
+ break;
3757
+ }
3758
+ } else if (includeAreaCode && foundBaseDialCode) {
3750
3759
  dialCode = number.substring(0, i + 1);
3751
- break;
3752
3760
  }
3753
3761
  if (numericChars.length === this.dialCodeMaxLen) {
3754
3762
  break;
@@ -4032,7 +4040,7 @@ var intlTelInput = Object.assign(
4032
4040
  attachUtils,
4033
4041
  startedLoadingUtilsScript: false,
4034
4042
  startedLoadingAutoCountry: false,
4035
- version: "25.12.2"
4043
+ version: "25.12.4"
4036
4044
  }
4037
4045
  );
4038
4046
  var intl_tel_input_default = intlTelInput;
@@ -3548,6 +3548,10 @@ var Iti = class _Iti {
3548
3548
  return iso2Codes[0];
3549
3549
  }
3550
3550
  } else if (number.startsWith("+") && numeric.length) {
3551
+ const currentDial = this.selectedCountryData.dialCode || "";
3552
+ if (currentDial && currentDial.startsWith(numeric)) {
3553
+ return null;
3554
+ }
3551
3555
  return "";
3552
3556
  } else if ((!number || number === "+") && !selectedIso2) {
3553
3557
  return this.defaultCountry;
@@ -3700,19 +3704,23 @@ var Iti = class _Iti {
3700
3704
  let dialCode = "";
3701
3705
  if (number.startsWith("+")) {
3702
3706
  let numericChars = "";
3707
+ let foundBaseDialCode = false;
3703
3708
  for (let i = 0; i < number.length; i++) {
3704
3709
  const c = number.charAt(i);
3705
3710
  if (/[0-9]/.test(c)) {
3706
3711
  numericChars += c;
3707
- const isMatch = Boolean(this.dialCodeToIso2Map[numericChars]);
3708
- if (!isMatch) {
3712
+ const hasMapEntry = Boolean(this.dialCodeToIso2Map[numericChars]);
3713
+ if (!hasMapEntry) {
3709
3714
  break;
3710
3715
  }
3711
- if (includeAreaCode) {
3716
+ if (this.dialCodes.has(numericChars)) {
3712
3717
  dialCode = number.substring(0, i + 1);
3713
- } else if (this.dialCodes.has(numericChars)) {
3718
+ foundBaseDialCode = true;
3719
+ if (!includeAreaCode) {
3720
+ break;
3721
+ }
3722
+ } else if (includeAreaCode && foundBaseDialCode) {
3714
3723
  dialCode = number.substring(0, i + 1);
3715
- break;
3716
3724
  }
3717
3725
  if (numericChars.length === this.dialCodeMaxLen) {
3718
3726
  break;
@@ -3996,7 +4004,7 @@ var intlTelInput = Object.assign(
3996
4004
  attachUtils,
3997
4005
  startedLoadingUtilsScript: false,
3998
4006
  startedLoadingAutoCountry: false,
3999
- version: "25.12.2"
4007
+ version: "25.12.4"
4000
4008
  }
4001
4009
  );
4002
4010
  var intl_tel_input_default = intlTelInput;
package/vue/README.md CHANGED
@@ -34,7 +34,7 @@ See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master
34
34
  "vue:demo": "vite --config vue/demo/[demo variant]/vite.config.js"
35
35
  ```
36
36
 
37
- A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.2/build/js/utils.js"`.
37
+ A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"`.
38
38
 
39
39
  ## Props
40
40
  Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
@@ -1974,7 +1974,7 @@ const nt = {
1974
1974
  }, H = {
1975
1975
  PASTE: "insertFromPaste",
1976
1976
  DELETE_FWD: "deleteContentForward"
1977
- }, D = {
1977
+ }, N = {
1978
1978
  ALPHA_UNICODE: new RegExp("\\p{L}", "u"),
1979
1979
  // any kind of letter from any language
1980
1980
  NON_PLUS_NUMERIC: /[^+0-9]/,
@@ -2508,7 +2508,7 @@ const mt = (l) => {
2508
2508
  return o;
2509
2509
  }
2510
2510
  return t.length;
2511
- }, Nt = [
2511
+ }, Dt = [
2512
2512
  "800",
2513
2513
  "822",
2514
2514
  "833",
@@ -2530,17 +2530,17 @@ const mt = (l) => {
2530
2530
  const t = v(l);
2531
2531
  if (t.startsWith(G.NANP) && t.length >= 4) {
2532
2532
  const e = t.substring(1, 4);
2533
- return Nt.includes(e);
2533
+ return Dt.includes(e);
2534
2534
  }
2535
2535
  return !1;
2536
2536
  };
2537
2537
  for (const l of E)
2538
2538
  l.name = $[l.iso2];
2539
- let Dt = 0;
2539
+ let Nt = 0;
2540
2540
  const Et = new Set(E.map((l) => l.iso2)), M = (l) => Et.has(l);
2541
2541
  class U {
2542
2542
  constructor(t, e = {}) {
2543
- this.id = Dt++, this.options = { ...z, ...e }, ut(this.options, $), this.ui = new Ct(t, this.options, this.id), this.isAndroid = U._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = mt(this.options);
2543
+ this.id = Nt++, this.options = { ...z, ...e }, ut(this.options, $), this.ui = new Ct(t, this.options, this.id), this.isAndroid = U._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = mt(this.options);
2544
2544
  const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: o } = yt(
2545
2545
  this.countries,
2546
2546
  this.options
@@ -2676,7 +2676,7 @@ class U {
2676
2676
  countrySearch: o
2677
2677
  } = this.options;
2678
2678
  let n = !1;
2679
- D.ALPHA_UNICODE.test(this.ui.telInput.value) && (n = !0);
2679
+ N.ALPHA_UNICODE.test(this.ui.telInput.value) && (n = !0);
2680
2680
  const r = (a) => {
2681
2681
  if (this.isAndroid && (a == null ? void 0 : a.data) === "+" && i && s && o) {
2682
2682
  const b = this.ui.telInput.selectionStart || 0, p = this.ui.telInput.value.substring(
@@ -2687,15 +2687,15 @@ class U {
2687
2687
  return;
2688
2688
  }
2689
2689
  this._updateCountryFromNumber(this.ui.telInput.value) && this._triggerCountryChange();
2690
- const d = (a == null ? void 0 : a.data) && D.NON_PLUS_NUMERIC.test(a.data), c = (a == null ? void 0 : a.inputType) === H.PASTE && this.ui.telInput.value;
2691
- d || c && !t ? n = !0 : D.NON_PLUS_NUMERIC.test(this.ui.telInput.value) || (n = !1);
2690
+ const d = (a == null ? void 0 : a.data) && N.NON_PLUS_NUMERIC.test(a.data), c = (a == null ? void 0 : a.inputType) === H.PASTE && this.ui.telInput.value;
2691
+ d || c && !t ? n = !0 : N.NON_PLUS_NUMERIC.test(this.ui.telInput.value) || (n = !1);
2692
2692
  const f = (a == null ? void 0 : a.detail) && a.detail.isSetNumber;
2693
2693
  if (e && !n && !f) {
2694
2694
  const b = this.ui.telInput.selectionStart || 0, y = this.ui.telInput.value.substring(
2695
2695
  0,
2696
2696
  b
2697
2697
  ).replace(
2698
- D.NON_PLUS_NUMERIC_GLOBAL,
2698
+ N.NON_PLUS_NUMERIC_GLOBAL,
2699
2699
  ""
2700
2700
  ).length, w = (a == null ? void 0 : a.inputType) === H.DELETE_FWD, I = this._getFullNumber(), _ = _t(
2701
2701
  I,
@@ -2703,13 +2703,13 @@ class U {
2703
2703
  u.utils,
2704
2704
  this.selectedCountryData,
2705
2705
  this.options.separateDialCode
2706
- ), N = wt(
2706
+ ), D = wt(
2707
2707
  y,
2708
2708
  _,
2709
2709
  b,
2710
2710
  w
2711
2711
  );
2712
- this.ui.telInput.value = _, this.ui.telInput.setSelectionRange(N, N);
2712
+ this.ui.telInput.value = _, this.ui.telInput.setSelectionRange(D, D);
2713
2713
  }
2714
2714
  };
2715
2715
  this.ui.telInput.addEventListener(
@@ -2747,7 +2747,7 @@ class U {
2747
2747
  if (this.options.strictMode) {
2748
2748
  const t = (e) => {
2749
2749
  e.preventDefault();
2750
- const i = this.ui.telInput, s = i.selectionStart, o = i.selectionEnd, n = i.value.slice(0, s), r = i.value.slice(o), a = this.selectedCountryData.iso2, d = e.clipboardData.getData("text"), c = s === 0 && o > 0, f = !i.value.startsWith("+") || c, b = d.replace(D.NON_PLUS_NUMERIC_GLOBAL, ""), p = b.startsWith("+"), y = b.replace(/\+/g, ""), w = p && f ? `+${y}` : y;
2750
+ const i = this.ui.telInput, s = i.selectionStart, o = i.selectionEnd, n = i.value.slice(0, s), r = i.value.slice(o), a = this.selectedCountryData.iso2, d = e.clipboardData.getData("text"), c = s === 0 && o > 0, f = !i.value.startsWith("+") || c, b = d.replace(N.NON_PLUS_NUMERIC_GLOBAL, ""), p = b.startsWith("+"), y = b.replace(/\+/g, ""), w = p && f ? `+${y}` : y;
2751
2751
  let I = n + w + r, _ = u.utils.getCoreNumber(I, a);
2752
2752
  for (; _.length === 0 && I.length > 0; )
2753
2753
  I = I.slice(0, -1), _ = u.utils.getCoreNumber(I, a);
@@ -2760,8 +2760,8 @@ class U {
2760
2760
  } else
2761
2761
  return;
2762
2762
  i.value = I;
2763
- const N = s + w.length;
2764
- i.setSelectionRange(N, N), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
2763
+ const D = s + w.length;
2764
+ i.setSelectionRange(D, D), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
2765
2765
  };
2766
2766
  this.ui.telInput.addEventListener("paste", t, {
2767
2767
  signal: this.abortController.signal
@@ -2868,7 +2868,7 @@ class U {
2868
2868
  g.ARROW_DOWN,
2869
2869
  g.ENTER,
2870
2870
  g.ESC
2871
- ].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === g.ARROW_UP || o.key === g.ARROW_DOWN ? this._handleUpDownKey(o.key) : o.key === g.ENTER ? this._handleEnterKey() : o.key === g.ESC && this._closeDropdown()), !this.options.countrySearch && D.HIDDEN_SEARCH_CHAR.test(o.key) && (o.stopPropagation(), i && clearTimeout(i), e += o.key.toLowerCase(), this._searchForCountry(e), i = setTimeout(() => {
2871
+ ].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === g.ARROW_UP || o.key === g.ARROW_DOWN ? this._handleUpDownKey(o.key) : o.key === g.ENTER ? this._handleEnterKey() : o.key === g.ESC && this._closeDropdown()), !this.options.countrySearch && N.HIDDEN_SEARCH_CHAR.test(o.key) && (o.stopPropagation(), i && clearTimeout(i), e += o.key.toLowerCase(), this._searchForCountry(e), i = setTimeout(() => {
2872
2872
  e = "";
2873
2873
  }, lt.HIDDEN_SEARCH_RESET_MS));
2874
2874
  };
@@ -2967,21 +2967,20 @@ class U {
2967
2967
  const { areaCodes: f, priority: b } = this.selectedCountryData;
2968
2968
  if (f) {
2969
2969
  const _ = f.map(
2970
- (N) => `${o}${N}`
2970
+ (D) => `${o}${D}`
2971
2971
  );
2972
- for (const N of _)
2973
- if (r.startsWith(N))
2972
+ for (const D of _)
2973
+ if (r.startsWith(D))
2974
2974
  return null;
2975
2975
  }
2976
2976
  const y = f && !(b === 0) && r.length > a.length, w = s && d.includes(s) && !y, I = s === d[0];
2977
2977
  if (!w && !I)
2978
2978
  return d[0];
2979
- } else {
2980
- if (i.startsWith("+") && r.length)
2981
- return "";
2982
- if ((!i || i === "+") && !s)
2983
- return this.defaultCountry;
2984
- }
2979
+ } else if (i.startsWith("+") && r.length) {
2980
+ const a = this.selectedCountryData.dialCode || "";
2981
+ return a && a.startsWith(r) ? null : "";
2982
+ } else if ((!i || i === "+") && !s)
2983
+ return this.defaultCountry;
2985
2984
  return null;
2986
2985
  }
2987
2986
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
@@ -3071,18 +3070,16 @@ class U {
3071
3070
  _getDialCode(t, e) {
3072
3071
  let i = "";
3073
3072
  if (t.startsWith("+")) {
3074
- let s = "";
3075
- for (let o = 0; o < t.length; o++) {
3076
- const n = t.charAt(o);
3077
- if (/[0-9]/.test(n)) {
3078
- if (s += n, !!!this.dialCodeToIso2Map[s])
3073
+ let s = "", o = !1;
3074
+ for (let n = 0; n < t.length; n++) {
3075
+ const r = t.charAt(n);
3076
+ if (/[0-9]/.test(r)) {
3077
+ if (s += r, !!!this.dialCodeToIso2Map[s])
3079
3078
  break;
3080
- if (e)
3081
- i = t.substring(0, o + 1);
3082
- else if (this.dialCodes.has(s)) {
3083
- i = t.substring(0, o + 1);
3084
- break;
3085
- }
3079
+ if (this.dialCodes.has(s)) {
3080
+ if (i = t.substring(0, n + 1), o = !0, !e)
3081
+ break;
3082
+ } else e && o && (i = t.substring(0, n + 1));
3086
3083
  if (s.length === this.dialCodeMaxLen)
3087
3084
  break;
3088
3085
  }
@@ -3194,7 +3191,7 @@ class U {
3194
3191
  return null;
3195
3192
  if (!this.selectedCountryData.iso2)
3196
3193
  return !1;
3197
- const e = (n) => t ? this._utilsIsValidNumber(n) : this._utilsIsPossibleNumber(n), i = this._getFullNumber(), s = i.search(D.ALPHA_UNICODE);
3194
+ const e = (n) => t ? this._utilsIsValidNumber(n) : this._utilsIsPossibleNumber(n), i = this._getFullNumber(), s = i.search(N.ALPHA_UNICODE);
3198
3195
  if (s > -1 && !this.options.allowPhonewords) {
3199
3196
  const n = i.substring(0, s), r = e(n), a = e(i);
3200
3197
  return r && a;
@@ -3282,7 +3279,7 @@ const Lt = (l) => {
3282
3279
  attachUtils: Lt,
3283
3280
  startedLoadingUtilsScript: !1,
3284
3281
  startedLoadingAutoCountry: !1,
3285
- version: "25.12.2"
3282
+ version: "25.12.4"
3286
3283
  }
3287
3284
  ), vt = {
3288
3285
  __name: "IntlTelInput",
@@ -2976,12 +2976,11 @@ class R1 {
2976
2976
  const T = A && !(v === 0) && f.length > C.length, k = s && I.includes(s) && !T, P = s === I[0];
2977
2977
  if (!k && !P)
2978
2978
  return I[0];
2979
- } else {
2980
- if (i.startsWith("+") && f.length)
2981
- return "";
2982
- if ((!i || i === "+") && !s)
2983
- return this.defaultCountry;
2984
- }
2979
+ } else if (i.startsWith("+") && f.length) {
2980
+ const C = this.selectedCountryData.dialCode || "";
2981
+ return C && C.startsWith(f) ? null : "";
2982
+ } else if ((!i || i === "+") && !s)
2983
+ return this.defaultCountry;
2985
2984
  return null;
2986
2985
  }
2987
2986
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
@@ -3071,18 +3070,16 @@ class R1 {
3071
3070
  _getDialCode(e, $) {
3072
3071
  let i = "";
3073
3072
  if (e.startsWith("+")) {
3074
- let s = "";
3075
- for (let a = 0; a < e.length; a++) {
3076
- const u = e.charAt(a);
3077
- if (/[0-9]/.test(u)) {
3078
- if (s += u, !!!this.dialCodeToIso2Map[s])
3073
+ let s = "", a = !1;
3074
+ for (let u = 0; u < e.length; u++) {
3075
+ const f = e.charAt(u);
3076
+ if (/[0-9]/.test(f)) {
3077
+ if (s += f, !!!this.dialCodeToIso2Map[s])
3079
3078
  break;
3080
- if ($)
3081
- i = e.substring(0, a + 1);
3082
- else if (this.dialCodes.has(s)) {
3083
- i = e.substring(0, a + 1);
3084
- break;
3085
- }
3079
+ if (this.dialCodes.has(s)) {
3080
+ if (i = e.substring(0, u + 1), a = !0, !$)
3081
+ break;
3082
+ } else $ && a && (i = e.substring(0, u + 1));
3086
3083
  if (s.length === this.dialCodeMaxLen)
3087
3084
  break;
3088
3085
  }
@@ -3282,7 +3279,7 @@ const L2 = (h) => {
3282
3279
  attachUtils: L2,
3283
3280
  startedLoadingUtilsScript: !1,
3284
3281
  startedLoadingAutoCountry: !1,
3285
- version: "25.12.2"
3282
+ version: "25.12.4"
3286
3283
  }
3287
3284
  );
3288
3285
  (function() {