intl-tel-input 18.3.5 → 18.5.0

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v18.3.5
2
+ * International Telephone Input v18.5.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -131,6 +131,8 @@
131
131
  autoInsertDialCode: false,
132
132
  // add a placeholder in the input with an example number for the selected country
133
133
  autoPlaceholder: "polite",
134
+ // add a country search input at the top of the dropdown
135
+ countrySearch: false,
134
136
  // modify the parentClass
135
137
  customContainer: "",
136
138
  // modify the auto placeholder
@@ -139,6 +141,8 @@
139
141
  dropdownContainer: null,
140
142
  // don't display these countries
141
143
  excludeCountries: [],
144
+ // fix the dropdown width to the input width (rather than being as wide as the longest country name)
145
+ fixDropdownWidth: false,
142
146
  // format the input value during initialisation and on setNumber
143
147
  formatOnDisplay: true,
144
148
  // geoIp lookup function
@@ -208,6 +212,15 @@
208
212
  key: "_init",
209
213
  value: function _init() {
210
214
  var _this2 = this;
215
+ // if showing fullscreen popup, do not fix the width
216
+ if (this.options.useFullscreenPopup) {
217
+ this.options.fixDropdownWidth = false;
218
+ this.options.countrySearch = false;
219
+ }
220
+ // when search enabled, we must fix the width else it would change with different results
221
+ if (this.options.countrySearch) {
222
+ this.options.fixDropdownWidth = true;
223
+ }
211
224
  // if in nationalMode, do not insert dial codes
212
225
  if (this.options.nationalMode) {
213
226
  this.options.autoInsertDialCode = false;
@@ -222,13 +235,9 @@
222
235
  if (!this.options.showFlags && forceShowFlags) {
223
236
  this.options.showFlags = true;
224
237
  }
225
- if (this.options.useFullscreenPopup) {
226
- // trigger the mobile dropdown css
227
- document.body.classList.add("iti-fullscreen-popup");
228
- // on mobile, we want a full screen dropdown, so we must append it to the body
229
- if (!this.options.dropdownContainer) {
230
- this.options.dropdownContainer = document.body;
231
- }
238
+ // on mobile, we want a full screen dropdown, so we must append it to the body
239
+ if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
240
+ this.options.dropdownContainer = document.body;
232
241
  }
233
242
  // check if input has one parent with RTL
234
243
  this.isRTL = !!this.telInput.closest("[dir=rtl]");
@@ -413,6 +422,7 @@
413
422
  }, {
414
423
  key: "_generateMarkup",
415
424
  value: function _generateMarkup() {
425
+ this.telInput.classList.add("iti__tel-input");
416
426
  // if autocomplete does not exist on the element and its form, then
417
427
  // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can
418
428
  // easily put the plugin in an inconsistent state e.g. the wrong flag selected for the
@@ -420,7 +430,7 @@
420
430
  if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
421
431
  this.telInput.setAttribute("autocomplete", "off");
422
432
  }
423
- var _this$options = this.options, allowDropdown = _this$options.allowDropdown, separateDialCode = _this$options.separateDialCode, showFlags = _this$options.showFlags, customContainer = _this$options.customContainer, hiddenInput = _this$options.hiddenInput, dropdownContainer = _this$options.dropdownContainer;
433
+ var _this$options = this.options, allowDropdown = _this$options.allowDropdown, separateDialCode = _this$options.separateDialCode, showFlags = _this$options.showFlags, customContainer = _this$options.customContainer, hiddenInput = _this$options.hiddenInput, dropdownContainer = _this$options.dropdownContainer, fixDropdownWidth = _this$options.fixDropdownWidth, useFullscreenPopup = _this$options.useFullscreenPopup, countrySearch = _this$options.countrySearch;
424
434
  // containers (mostly for positioning)
425
435
  var parentClass = "iti";
426
436
  if (allowDropdown) {
@@ -432,6 +442,9 @@
432
442
  if (showFlags) {
433
443
  parentClass += " iti--show-flags";
434
444
  }
445
+ if (!fixDropdownWidth) {
446
+ parentClass += " iti--flexible-dropdown-width";
447
+ }
435
448
  if (customContainer) {
436
449
  parentClass += " ".concat(customContainer);
437
450
  }
@@ -482,14 +495,24 @@
482
495
  this.dropdownArrow = this._createEl("div", {
483
496
  "class": "iti__arrow"
484
497
  }, this.selectedFlag);
485
- // country dropdown: preferred countries, then divider, then all countries
498
+ this.dropdownContent = this._createEl("div", {
499
+ "class": "iti__dropdown-content iti__hide"
500
+ });
501
+ if (countrySearch) {
502
+ this.searchInput = this._createEl("input", {
503
+ type: "text",
504
+ "class": "iti__search-input",
505
+ placeholder: "Search"
506
+ }, this.dropdownContent);
507
+ }
508
+ // country list: preferred countries, then divider, then all countries
486
509
  this.countryList = this._createEl("ul", {
487
- "class": "iti__country-list iti__hide",
510
+ "class": "iti__country-list",
488
511
  id: "iti-".concat(this.id, "__country-listbox"),
489
512
  role: "listbox",
490
513
  "aria-label": "List of countries"
491
- });
492
- if (this.preferredCountries.length) {
514
+ }, this.dropdownContent);
515
+ if (this.preferredCountries.length && !countrySearch) {
493
516
  this._appendListItems(this.preferredCountries, "iti__preferred", true);
494
517
  this._createEl("li", {
495
518
  "class": "iti__divider",
@@ -499,12 +522,13 @@
499
522
  this._appendListItems(this.countries, "iti__standard");
500
523
  // create dropdownContainer markup
501
524
  if (dropdownContainer) {
525
+ var fullscreenClass = useFullscreenPopup ? "iti--fullscreen-popup" : "";
502
526
  this.dropdown = this._createEl("div", {
503
- "class": "iti iti--container"
527
+ "class": "iti iti--container ".concat(fullscreenClass)
504
528
  });
505
- this.dropdown.appendChild(this.countryList);
529
+ this.dropdown.appendChild(this.dropdownContent);
506
530
  } else {
507
- this.flagsContainer.appendChild(this.countryList);
531
+ this.flagsContainer.appendChild(this.dropdownContent);
508
532
  }
509
533
  }
510
534
  if (hiddenInput) {
@@ -528,26 +552,30 @@
528
552
  }, {
529
553
  key: "_appendListItems",
530
554
  value: function _appendListItems(countries, className, preferred) {
531
- // we create so many DOM elements, it is faster to build a temp string
532
- // and then add everything to the DOM in one go at the end
533
- var tmp = "";
534
- // for each country
535
555
  for (var i = 0; i < countries.length; i++) {
536
556
  var c = countries[i];
537
557
  var idSuffix = preferred ? "-preferred" : "";
538
- // open the list item
539
- tmp += "<li class='iti__country ".concat(className, "' tabIndex='-1' id='iti-").concat(this.id, "__item-").concat(c.iso2).concat(idSuffix, "' role='option' data-dial-code='").concat(c.dialCode, "' data-country-code='").concat(c.iso2, "' aria-selected='false'>");
558
+ var listItem = this._createEl("li", {
559
+ id: "iti-".concat(this.id, "__item-").concat(c.iso2).concat(idSuffix),
560
+ "class": "iti__country ".concat(className),
561
+ tabindex: "-1",
562
+ role: "option",
563
+ "data-dial-code": c.dialCode,
564
+ "data-country-code": c.iso2,
565
+ "aria-selected": "false"
566
+ }, this.countryList);
567
+ // store this for later use e.g. country search filtering
568
+ c.node = listItem;
569
+ var content = "";
540
570
  // add the flag
541
571
  if (this.options.showFlags) {
542
- tmp += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2, "'></div></div>");
572
+ content += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2, "'></div></div>");
543
573
  }
544
574
  // and the country name and dial code
545
- tmp += "<span class='iti__country-name'>".concat(c.name, "</span>");
546
- tmp += "<span class='iti__dial-code'>+".concat(c.dialCode, "</span>");
547
- // close the list item
548
- tmp += "</li>";
575
+ content += "<span class='iti__country-name'>".concat(c.name, "</span>");
576
+ content += "<span class='iti__dial-code'>+".concat(c.dialCode, "</span>");
577
+ listItem.insertAdjacentHTML("beforeend", content);
549
578
  }
550
- this.countryList.insertAdjacentHTML("beforeend", tmp);
551
579
  }
552
580
  }, {
553
581
  key: "_setInitialState",
@@ -636,7 +664,7 @@
636
664
  // close it again
637
665
  this._handleLabelClick = function(e) {
638
666
  // if the dropdown is closed, then focus the input, else ignore the click
639
- if (_this4.countryList.classList.contains("iti__hide")) {
667
+ if (_this4.dropdownContent.classList.contains("iti__hide")) {
640
668
  _this4.telInput.focus();
641
669
  } else {
642
670
  e.preventDefault();
@@ -651,15 +679,15 @@
651
679
  // only intercept this event if we're opening the dropdown
652
680
  // else let it bubble up to the top ("click-off-to-close" listener)
653
681
  // we cannot just stopPropagation as it may be needed to close another instance
654
- if (_this4.countryList.classList.contains("iti__hide") && !_this4.telInput.disabled && !_this4.telInput.readOnly) {
682
+ if (_this4.dropdownContent.classList.contains("iti__hide") && !_this4.telInput.disabled && !_this4.telInput.readOnly) {
655
683
  _this4._showDropdown();
656
684
  }
657
685
  };
658
686
  this.selectedFlag.addEventListener("click", this._handleClickSelectedFlag);
659
- // open dropdown list if currently focused
687
+ // open dropdown if selected flag is focused and they press up/down/space/enter
660
688
  this._handleFlagsContainerKeydown = function(e) {
661
- var isDropdownHidden = _this4.countryList.classList.contains("iti__hide");
662
- if (isDropdownHidden && [ "ArrowUp", "Up", "ArrowDown", "Down", " ", "Enter" ].indexOf(e.key) !== -1) {
689
+ var isDropdownHidden = _this4.dropdownContent.classList.contains("iti__hide");
690
+ if (isDropdownHidden && [ "ArrowUp", "ArrowDown", " ", "Enter" ].includes(e.key)) {
663
691
  // prevent form from being submitted if "ENTER" was pressed
664
692
  e.preventDefault();
665
693
  // prevent event from being handled again by document
@@ -793,11 +821,18 @@
793
821
  }, {
794
822
  key: "_showDropdown",
795
823
  value: function _showDropdown() {
796
- this.countryList.classList.remove("iti__hide");
824
+ if (this.options.fixDropdownWidth) {
825
+ this.dropdownContent.style.width = "".concat(this.telInput.offsetWidth, "px");
826
+ }
827
+ this.dropdownContent.classList.remove("iti__hide");
797
828
  this.selectedFlag.setAttribute("aria-expanded", "true");
798
829
  this._setDropdownPosition();
799
- // update highlighting and scroll to active list item
800
- if (this.activeItem) {
830
+ if (this.options.countrySearch) {
831
+ // start by highlighting the first item in the list
832
+ this._highlightListItem(this.countryList.firstElementChild, false);
833
+ this.searchInput.focus();
834
+ } else if (this.activeItem) {
835
+ // update highlighting and scroll to active list item
801
836
  this._highlightListItem(this.activeItem, false);
802
837
  this._scrollTo(this.activeItem, true);
803
838
  }
@@ -828,13 +863,13 @@
828
863
  // windowTop from https://stackoverflow.com/a/14384091/217866
829
864
  var windowTop = window.pageYOffset || document.documentElement.scrollTop;
830
865
  var inputTop = pos.top + windowTop;
831
- var dropdownHeight = this.countryList.offsetHeight;
866
+ var dropdownHeight = this.dropdownContent.offsetHeight;
832
867
  // dropdownFitsBelow = (dropdownBottom < windowBottom)
833
868
  var dropdownFitsBelow = inputTop + this.telInput.offsetHeight + dropdownHeight < windowTop + window.innerHeight;
834
869
  var dropdownFitsAbove = inputTop - dropdownHeight > windowTop;
835
870
  // by default, the dropdown will be below the input. If we want to position it above the
836
871
  // input, we add the dropup class.
837
- this._toggleClass(this.countryList, "iti__country-list--dropup", !dropdownFitsBelow && dropdownFitsAbove);
872
+ this._toggleClass(this.dropdownContent, "iti__country-list--dropup", !dropdownFitsBelow && dropdownFitsAbove);
838
873
  // if dropdownContainer is enabled, calculate postion
839
874
  if (this.options.dropdownContainer) {
840
875
  // by default the dropdown will be directly over the input because it's not in the flow.
@@ -894,7 +929,7 @@
894
929
  isOpening = false;
895
930
  };
896
931
  document.documentElement.addEventListener("click", this._handleClickOffToClose);
897
- // listen for up/down scrolling, enter to select, or letters to jump to country name.
932
+ // listen for up/down scrolling, enter to select, or escape to close
898
933
  // use keydown as keypress doesn't fire for non-char keys and we want to catch if they
899
934
  // just hit down and hold it to scroll down (no keyup event).
900
935
  // listen on the document because that's where key events are triggered if no input has focus
@@ -903,15 +938,22 @@
903
938
  this._handleKeydownOnDropdown = function(e) {
904
939
  // prevent down key from scrolling the whole page,
905
940
  // and enter key from submitting a form etc
906
- e.preventDefault();
907
- // up and down to navigate
908
- if (e.key === "ArrowUp" || e.key === "Up" || e.key === "ArrowDown" || e.key === "Down") {
909
- _this9._handleUpDownKey(e.key);
910
- } else if (e.key === "Enter") {
911
- _this9._handleEnterKey();
912
- } else if (e.key === "Escape") {
913
- _this9._closeDropdown();
914
- } else if (/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {
941
+ if ([ "ArrowUp", "ArrowDown", "Enter", "Escape" ].includes(e.key)) {
942
+ e.preventDefault();
943
+ e.stopPropagation();
944
+ // up and down to navigate
945
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") {
946
+ _this9._handleUpDownKey(e.key);
947
+ } else if (e.key === "Enter") {
948
+ _this9._handleEnterKey();
949
+ } else if (e.key === "Escape") {
950
+ _this9._closeDropdown();
951
+ }
952
+ }
953
+ // alpha chars to perform search
954
+ // regex allows one latin alpha char or space, based on https://stackoverflow.com/a/26900132/217866)
955
+ if (!_this9.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {
956
+ e.stopPropagation();
915
957
  // jump to countries that start with the query string
916
958
  if (queryTimer) {
917
959
  clearTimeout(queryTimer);
@@ -925,17 +967,73 @@
925
967
  }
926
968
  };
927
969
  document.addEventListener("keydown", this._handleKeydownOnDropdown);
970
+ if (this.options.countrySearch) {
971
+ var doFilter = function doFilter() {
972
+ var inputQuery = _this9.searchInput.value.trim();
973
+ if (inputQuery) {
974
+ _this9._filterCountries(inputQuery.toLowerCase());
975
+ } else {
976
+ _this9._filterCountries(null, true);
977
+ }
978
+ };
979
+ var keyupTimer = null;
980
+ this._handleSearchChange = function() {
981
+ // filtering country nodes is expensive (lots of DOM manipulation), so rate limit it
982
+ if (keyupTimer) {
983
+ clearTimeout(keyupTimer);
984
+ }
985
+ keyupTimer = setTimeout(function() {
986
+ doFilter();
987
+ keyupTimer = null;
988
+ }, 100);
989
+ };
990
+ this.searchInput.addEventListener("input", this._handleSearchChange);
991
+ // stop propagation on search input click, so doesn't trigger click-off-to-close listener
992
+ this.searchInput.addEventListener("click", function(e) {
993
+ return e.stopPropagation();
994
+ });
995
+ }
996
+ }
997
+ }, {
998
+ key: "_filterCountries",
999
+ value: function _filterCountries(query) {
1000
+ var isReset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1001
+ var isFirst = true;
1002
+ this.countryList.innerHTML = "";
1003
+ for (var i = 0; i < this.countries.length; i++) {
1004
+ var c = this.countries[i];
1005
+ var nameLower = c.name.toLowerCase();
1006
+ var fullDialCode = "+".concat(c.dialCode);
1007
+ if (isReset || nameLower.includes(query) || fullDialCode.includes(query)) {
1008
+ this.countryList.appendChild(c.node);
1009
+ // highlight the first item
1010
+ if (isFirst) {
1011
+ this._highlightListItem(c.node, false);
1012
+ isFirst = false;
1013
+ }
1014
+ }
1015
+ }
928
1016
  }
929
1017
  }, {
930
1018
  key: "_handleUpDownKey",
931
1019
  value: function _handleUpDownKey(key) {
932
- var next = key === "ArrowUp" || key === "Up" ? this.highlightedItem.previousElementSibling : this.highlightedItem.nextElementSibling;
1020
+ var next = key === "ArrowUp" ? this.highlightedItem.previousElementSibling : this.highlightedItem.nextElementSibling;
933
1021
  if (next) {
934
1022
  // skip the divider
935
1023
  if (next.classList.contains("iti__divider")) {
936
- next = key === "ArrowUp" || key === "Up" ? next.previousElementSibling : next.nextElementSibling;
1024
+ next = key === "ArrowUp" ? next.previousElementSibling : next.nextElementSibling;
1025
+ }
1026
+ } else if (this.countryList.childElementCount > 1) {
1027
+ // otherwise, we must be at the end, so loop round again
1028
+ next = key === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild;
1029
+ }
1030
+ if (next) {
1031
+ // if country search enabled, dont lose focus from the search input on up/down
1032
+ var doFocus = !this.options.countrySearch;
1033
+ this._highlightListItem(next, doFocus);
1034
+ if (this.options.countrySearch) {
1035
+ this._scrollTo(next, false);
937
1036
  }
938
- this._highlightListItem(next, true);
939
1037
  }
940
1038
  }
941
1039
  }, {
@@ -950,7 +1048,7 @@
950
1048
  value: function _searchForCountry(query) {
951
1049
  for (var i = 0; i < this.countries.length; i++) {
952
1050
  if (this._startsWith(this.countries[i].name, query)) {
953
- var listItem = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(this.countries[i].iso2));
1051
+ var listItem = this.countries[i].node;
954
1052
  // update highlighting and scroll
955
1053
  this._highlightListItem(listItem, false);
956
1054
  this._scrollTo(listItem, true);
@@ -1190,13 +1288,16 @@
1190
1288
  }, {
1191
1289
  key: "_closeDropdown",
1192
1290
  value: function _closeDropdown() {
1193
- this.countryList.classList.add("iti__hide");
1291
+ this.dropdownContent.classList.add("iti__hide");
1194
1292
  this.selectedFlag.setAttribute("aria-expanded", "false");
1195
1293
  this.selectedFlag.removeAttribute("aria-activedescendant");
1196
1294
  // update the arrow
1197
1295
  this.dropdownArrow.classList.remove("iti__arrow--up");
1198
1296
  // unbind key events
1199
1297
  document.removeEventListener("keydown", this._handleKeydownOnDropdown);
1298
+ if (this.options.countrySearch) {
1299
+ this.searchInput.removeEventListener("input", this._handleSearchChange);
1300
+ }
1200
1301
  document.documentElement.removeEventListener("click", this._handleClickOffToClose);
1201
1302
  this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList);
1202
1303
  this.countryList.removeEventListener("click", this._handleClickCountryList);
@@ -1214,7 +1315,7 @@
1214
1315
  }, {
1215
1316
  key: "_scrollTo",
1216
1317
  value: function _scrollTo(element, middle) {
1217
- var container = this.countryList;
1318
+ var container = this.dropdownContent;
1218
1319
  // windowTop from https://stackoverflow.com/a/14384091/217866
1219
1320
  var windowTop = window.pageYOffset || document.documentElement.scrollTop;
1220
1321
  var containerHeight = container.offsetHeight;
@@ -1541,7 +1642,7 @@
1541
1642
  // default options
1542
1643
  intlTelInputGlobals.defaults = defaults;
1543
1644
  // version
1544
- intlTelInputGlobals.version = "18.3.5";
1645
+ intlTelInputGlobals.version = "18.5.0";
1545
1646
  var pluginName = "intlTelInput";
1546
1647
  // A really lightweight plugin wrapper around the constructor,
1547
1648
  // preventing against multiple instantiations
@@ -1,8 +1,8 @@
1
1
  /*
2
- * International Telephone Input v18.3.5
2
+ * International Telephone Input v18.5.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
6
 
7
- !function(a){"object"==typeof module&&module.exports?module.exports=a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b)}):a(jQuery)}(function(a,b){"use strict";function c(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?Object(arguments[b]):{},e=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&e.push.apply(e,Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable})),e.forEach(function(b){d(a,b,c[b])})}return a}function d(a,b,c){return b=h(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,h(d.key),d)}}function g(a,b,c){return b&&f(a.prototype,b),c&&f(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function h(a){var b=i(a,"string");return"symbol"==typeof b?b:String(b)}function i(a,c){if("object"!=typeof a||null===a)return a;var d=a[Symbol.toPrimitive];if(d!==b){var e=d.call(a,c||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===c?String:Number)(a)}for(var j=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],k=0;k<j.length;k++){var l=j[k];j[k]={name:l[0],iso2:l[1],dialCode:l[2],priority:l[3]||0,areaCodes:l[4]||null}}var m={getInstance:function(a){var b=a.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[b]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=m);var n=0,o={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},p=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],q=function(a,b){for(var c=Object.keys(a),d=0;d<c.length;d++)b(c[d],a[c[d]])},r=function(a){q(window.intlTelInputGlobals.instances,function(b){window.intlTelInputGlobals.instances[b][a]()})},s=function(){function a(b,c){var d=this;e(this,a),this.id=n++,this.a=b,this.b=null,this.c=null;var f=c||{};this.d={},q(o,function(a,b){d.d[a]=f.hasOwnProperty(a)?f[a]:b}),this.e=Boolean(b.getAttribute("placeholder"))}return g(a,[{key:"_init",value:function(){var a=this;this.d.nationalMode&&(this.d.autoInsertDialCode=!1),this.d.separateDialCode&&(this.d.autoInsertDialCode=!1);var b=this.d.allowDropdown&&!this.d.separateDialCode;if(!this.d.showFlags&&b&&(this.d.showFlags=!0),this.d.useFullscreenPopup&&(document.body.classList.add("iti-fullscreen-popup"),this.d.dropdownContainer||(this.d.dropdownContainer=document.body)),this.isRTL=!!this.a.closest("[dir=rtl]"),"undefined"!=typeof Promise){var c=new Promise(function(b,c){a.h=b,a.i=c}),d=new Promise(function(b,c){a.i0=b,a.i1=c});this.promise=Promise.all([c,d])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(a,c,d){c.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=c.length),this.q.hasOwnProperty(c)||(this.q[c]=[]);for(var e=0;e<this.q[c].length;e++)if(this.q[c][e]===a)return;var f=d!==b?d:this.q[c].length;this.q[c][f]=a}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var a=this.d.onlyCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(b){return a.indexOf(b.iso2)>-1})}else if(this.d.excludeCountries.length){var b=this.d.excludeCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(a){return-1===b.indexOf(a.iso2)})}else this.p=j}},{key:"_d0",value:function(){for(var a=0;a<this.p.length;a++){var b=this.p[a].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(b)&&(this.p[a].name=this.d.localizedCountries[b])}}},{key:"_d1",value:function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var a=0;a<this.p.length;a++){var b=this.p[a];this.dialCodes[b.dialCode]||(this.dialCodes[b.dialCode]=!0),this._c(b.iso2,b.dialCode,b.priority)}for(var c=0;c<this.p.length;c++){var d=this.p[c];if(d.areaCodes)for(var e=this.q[d.dialCode][0],f=0;f<d.areaCodes.length;f++){for(var g=d.areaCodes[f],h=1;h<g.length;h++){var i=d.dialCode+g.substr(0,h);this._c(e,i),this._c(d.iso2,i)}this._c(d.iso2,d.dialCode+g)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var a=0;a<this.d.preferredCountries.length;a++){var b=this.d.preferredCountries[a].toLowerCase(),c=this._y(b,!1,!0);c&&this.preferredCountries.push(c)}}},{key:"_e2",value:function(a,b,c){var d=document.createElement(a);return b&&q(b,function(a,b){return d.setAttribute(a,b)}),c&&c.appendChild(d),d}},{key:"_f",value:function(){this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var a=this.d,b=a.allowDropdown,d=a.separateDialCode,e=a.showFlags,f=a.customContainer,g=a.hiddenInput,h=a.dropdownContainer,i="iti";b&&(i+=" iti--allow-dropdown"),d&&(i+=" iti--separate-dial-code"),e&&(i+=" iti--show-flags"),f&&(i+=" ".concat(f));var j=this._e2("div",{"class":i});this.a.parentNode.insertBefore(j,this.a);var k=b||e||d;if(k&&(this.k=this._e2("div",{"class":"iti__flag-container"},j)),j.appendChild(this.a),k&&(this.selectedFlag=this._e2("div",c({"class":"iti__selected-flag"},b&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.k)),e&&(this.l=this._e2("div",{"class":"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.a.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),d&&(this.t=this._e2("div",{"class":"iti__selected-dial-code"},this.selectedFlag)),b&&(this.a.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{"class":"iti__arrow"},this.selectedFlag),this.m=this._e2("ul",{"class":"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{"class":"iti__divider","aria-hidden":"true"},this.m)),this._g(this.p,"iti__standard"),h?(this.dropdown=this._e2("div",{"class":"iti iti--container"}),this.dropdown.appendChild(this.m)):this.k.appendChild(this.m)),g){var l=g,m=this.a.getAttribute("name");if(m){var n=m.lastIndexOf("[");-1!==n&&(l="".concat(m.substr(0,n),"[").concat(l,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:l}),j.appendChild(this.hiddenInput)}}},{key:"_g",value:function(a,b,c){for(var d="",e=0;e<a.length;e++){var f=a[e],g=c?"-preferred":"";d+="<li class='iti__country ".concat(b,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(f.iso2).concat(g,"' role='option' data-dial-code='").concat(f.dialCode,"' data-country-code='").concat(f.iso2,"' aria-selected='false'>"),this.d.showFlags&&(d+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(f.iso2,"'></div></div>")),d+="<span class='iti__country-name'>".concat(f.name,"</span>"),d+="<span class='iti__dial-code'>+".concat(f.dialCode,"</span>"),d+="</li>"}this.m.insertAdjacentHTML("beforeend",d)}},{key:"_h",value:function(){var a=this.a.getAttribute("value"),b=this.a.value,c=a&&"+"===a.charAt(0)&&(!b||"+"!==b.charAt(0)),d=c?a:b,e=this._5(d),f=this._w(d),g=this.d,h=g.initialCountry,i=g.autoInsertDialCode;e&&!f?this._v(d):"auto"!==h&&(h?this._z(h.toLowerCase()):e&&f?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,d||this._z(this.j)),!d&&i&&(this.a.value="+".concat(this.s.dialCode))),d&&this._u(d)}},{key:"_i",value:function(){this._j(),this.d.autoInsertDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var a=this;this._a14=function(){a.hiddenInput.value=a.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var a=this.a;a&&"LABEL"!==a.tagName;)a=a.parentNode;return a}},{key:"_i2",value:function(){var a=this;this._a9=function(b){a.m.classList.contains("iti__hide")?a.a.focus():b.preventDefault()};var b=this._i1();b&&b.addEventListener("click",this._a9),this._a10=function(){!a.m.classList.contains("iti__hide")||a.a.disabled||a.a.readOnly||a._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(b){a.m.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(b.key)&&(b.preventDefault(),b.stopPropagation(),a._n()),"Tab"===b.key&&a._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var a=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(a.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(a){window.intlTelInputGlobals.autoCountry=a.toLowerCase(),setTimeout(function(){return r("handleAutoCountry")})},function(){return r("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var a=this;this._a12=function(){a._v(a.a.value)&&a._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(a._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(a){var b=this.a.getAttribute("maxlength");return b&&a.length>b?a.substr(0,b):a}},{key:"_l",value:function(){var a=this;this._a8=function(){a._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var a=this._m(this.a.value);a&&this.s.dialCode!==a||(this.a.value="")}}},{key:"_m",value:function(a){return a.replace(/\D/g,"")}},{key:"_m2",value:function(a){var b=document.createEvent("Event");b.initEvent(a,!0,!0),this.a.dispatchEvent(b)}},{key:"_n",value:function(){this.m.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(a,b,c){c&&!a.classList.contains(b)?a.classList.add(b):!c&&a.classList.contains(b)&&a.classList.remove(b)}},{key:"_o",value:function(){var a=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.d.useFullscreenPopup){var b=this.a.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop,d=b.top+c,e=this.m.offsetHeight,f=d+this.a.offsetHeight+e<c+window.innerHeight,g=d-e>c;if(this._n2(this.m,"iti__country-list--dropup",!f&&g),this.d.dropdownContainer){var h=!f&&g?0:this.a.offsetHeight;this.dropdown.style.top="".concat(d+h,"px"),this.dropdown.style.left="".concat(b.left+document.body.scrollLeft,"px"),this._a4=function(){return a._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(a){for(var b=a;b&&b!==this.m&&!b.classList.contains("iti__country");)b=b.parentNode;return b===this.m?null:b}},{key:"_p",value:function(){var a=this;this._a0=function(b){var c=a._o2(b.target);c&&a._x(c,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(b){var c=a._o2(b.target);c&&a._1(c)},this.m.addEventListener("click",this._a1);var b=!0;this._a2=function(){b||a._2(),b=!1},document.documentElement.addEventListener("click",this._a2);var c="",d=null;this._a3=function(b){b.preventDefault(),"ArrowUp"===b.key||"Up"===b.key||"ArrowDown"===b.key||"Down"===b.key?a._q(b.key):"Enter"===b.key?a._r():"Escape"===b.key?a._2():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(b.key)&&(d&&clearTimeout(d),c+=b.key.toLowerCase(),a._s(c),d=setTimeout(function(){c=""},1e3))},document.addEventListener("keydown",this._a3)}},{key:"_q",value:function(a){var b="ArrowUp"===a||"Up"===a?this.c.previousElementSibling:this.c.nextElementSibling;b&&(b.classList.contains("iti__divider")&&(b="ArrowUp"===a||"Up"===a?b.previousElementSibling:b.nextElementSibling),this._x(b,!0))}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(a){for(var b=0;b<this.p.length;b++)if(this._t(this.p[b].name,a)){var c=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(this.p[b].iso2));this._x(c,!1),this._3(c,!0);break}}},{key:"_t",value:function(a,b){return a.substr(0,b.length).toLowerCase()===b}},{key:"_u",value:function(a){var b=a;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var c=this.d.nationalMode||"+"!==b.charAt(0)&&!this.d.separateDialCode,d=intlTelInputUtils.numberFormat,e=d.NATIONAL,f=d.INTERNATIONAL,g=c?e:f;b=intlTelInputUtils.formatNumber(b,this.s.iso2,g)}b=this._7(b),this.a.value=b}},{key:"_v",value:function(a){var b=a,c=this.s.dialCode,d="1"===c;b&&d&&"+"!==b.charAt(0)&&("1"!==b.charAt(0)&&(b="1".concat(b)),b="+".concat(b)),this.d.separateDialCode&&c&&"+"!==b.charAt(0)&&(b="+".concat(c).concat(b));var e=this._5(b,!0),f=this._m(b),g=null;if(e){var h=this.q[this._m(e)],i=-1!==h.indexOf(this.s.iso2)&&f.length<=e.length-1;if(!("1"===c&&this._w(f))&&!i)for(var j=0;j<h.length;j++)if(h[j]){g=h[j];break}}else"+"===b.charAt(0)&&f.length?g="":b&&"+"!==b||(g=this.j);return null!==g&&this._z(g)}},{key:"_w",value:function(a){var b=this._m(a);if("1"===b.charAt(0)){var c=b.substr(1,3);return-1!==p.indexOf(c)}return!1}},{key:"_x",value:function(a,b){var c=this.c;c&&c.classList.remove("iti__highlight"),this.c=a,this.c.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",a.getAttribute("id")),b&&this.c.focus()}},{key:"_y",value:function(a,b,c){for(var d=b?j:this.p,e=0;e<d.length;e++)if(d[e].iso2===a)return d[e];if(c)return null;throw new Error("No country data for '".concat(a,"'"))}},{key:"_z",value:function(a){var b=this.d,c=b.allowDropdown,d=b.separateDialCode,e=b.showFlags,f=this.s.iso2?this.s:{};if(this.s=a?this._y(a,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),e&&this.l.setAttribute("class","iti__flag iti__".concat(a)),this._setSelectedCountryFlagTitleAttribute(a,d),d){var g=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=g;var h=this.selectedFlag.offsetWidth||this._z2();this.isRTL?this.a.style.paddingRight="".concat(h+6,"px"):this.a.style.paddingLeft="".concat(h+6,"px")}if(this._0(),c){var i=this.b;if(i&&(i.classList.remove("iti__active"),i.setAttribute("aria-selected","false")),a){var j=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a));j.setAttribute("aria-selected","true"),j.classList.add("iti__active"),this.b=j}}return f.iso2!==a}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(a,b){if(this.selectedFlag){var c;c=a&&!b?"".concat(this.s.name,": +").concat(this.s.dialCode):a?this.s.name:"Unknown",this.selectedFlag.setAttribute("title",c)}}},{key:"_z2",value:function(){var a=this.a.parentNode.cloneNode();a.style.visibility="hidden",document.body.appendChild(a);var b=this.k.cloneNode();a.appendChild(b);var c=this.selectedFlag.cloneNode(!0);b.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),d}},{key:"_0",value:function(){var a="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&a){var b=intlTelInputUtils.numberType[this.d.placeholderNumberType],c=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,b):"";c=this._7(c),"function"==typeof this.d.customPlaceholder&&(c=this.d.customPlaceholder(c,this.s)),this.a.setAttribute("placeholder",c)}}},{key:"_1",value:function(a){var b=this._z(a.getAttribute("data-country-code"));this._2(),this._4(a.getAttribute("data-dial-code")),this.a.focus();var c=this.a.value.length;this.a.setSelectionRange(c,c),b&&this._m2CountryChange()}},{key:"_2",value:function(){this.m.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.d.useFullscreenPopup||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(a,b){var c=this.m,d=window.pageYOffset||document.documentElement.scrollTop,e=c.offsetHeight,f=c.getBoundingClientRect().top+d,g=f+e,h=a.offsetHeight,i=a.getBoundingClientRect().top+d,j=i+h,k=i-f+c.scrollTop,l=e/2-h/2;if(i<f)b&&(k-=l),c.scrollTop=k;else if(j>g){b&&(k+=l);var m=e-h;c.scrollTop=k-m}}},{key:"_4",value:function(a){var b,c=this.a.value,d="+".concat(a);if("+"===c.charAt(0)){var e=this._5(c);b=e?c.replace(e,d):d,this.a.value=b}else this.d.autoInsertDialCode&&(b=c?d+c:d,this.a.value=b)}},{key:"_5",value:function(a,b){var c="";if("+"===a.charAt(0))for(var d="",e=0;e<a.length;e++){var f=a.charAt(e);if(!isNaN(parseInt(f,10))){if(d+=f,b)this.q[d]&&(c=a.substr(0,e+1));else if(this.dialCodes[d]){c=a.substr(0,e+1);break}if(d.length===this.countryCodeMaxLen)break}}return c}},{key:"_6",value:function(){var a=this.a.value.trim(),b=this.s.dialCode,c=this._m(a);return(this.d.separateDialCode&&"+"!==a.charAt(0)&&b&&c?"+".concat(b):"")+a}},{key:"_7",value:function(a){var b=a;if(this.d.separateDialCode){var c=this._5(b);if(c){c="+".concat(this.s.dialCode);var d=" "===b[c.length]||"-"===b[c.length]?c.length+1:c.length;b=b.substr(d)}}return this._j2(b)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var a=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){
8
- var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,this.s.iso2):null}},{key:"isPossibleNumber",value:function(){var a=this._6().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(a,this.s.iso2):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.s.iso2!==b&&(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),a}();m.getCountryData=function(){return j};var t=function(a,b,c){var d=document.createElement("script");d.onload=function(){r("handleUtils"),b&&b()},d.onerror=function(){r("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};m.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return t(a,b,c)});t(a)}return null},m.defaults=o,m.version="18.3.5";a.fn.intlTelInput=function(c){var d=arguments;if(c===b||"object"==typeof c)return this.each(function(){if(!a.data(this,"plugin_intlTelInput")){var b=new s(this,c);b._init(),window.intlTelInputGlobals.instances[b.id]=b,a.data(this,"plugin_intlTelInput",b)}});if("string"==typeof c&&"_"!==c[0]){var e;return this.each(function(){var b=a.data(this,"plugin_intlTelInput");b instanceof s&&"function"==typeof b[c]&&(e=b[c].apply(b,Array.prototype.slice.call(d,1))),"destroy"===c&&a.data(this,"plugin_intlTelInput",null)}),e!==b?e:this}}});
7
+ !function(a){"object"==typeof module&&module.exports?module.exports=a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b)}):a(jQuery)}(function(a,b){"use strict";function c(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?Object(arguments[b]):{},e=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&e.push.apply(e,Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable})),e.forEach(function(b){d(a,b,c[b])})}return a}function d(a,b,c){return b=h(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,h(d.key),d)}}function g(a,b,c){return b&&f(a.prototype,b),c&&f(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function h(a){var b=i(a,"string");return"symbol"==typeof b?b:String(b)}function i(a,c){if("object"!=typeof a||null===a)return a;var d=a[Symbol.toPrimitive];if(d!==b){var e=d.call(a,c||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===c?String:Number)(a)}for(var j=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],k=0;k<j.length;k++){var l=j[k];j[k]={name:l[0],iso2:l[1],dialCode:l[2],priority:l[3]||0,areaCodes:l[4]||null}}var m={getInstance:function(a){var b=a.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[b]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=m);var n=0,o={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},p=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],q=function(a,b){for(var c=Object.keys(a),d=0;d<c.length;d++)b(c[d],a[c[d]])},r=function(a){q(window.intlTelInputGlobals.instances,function(b){window.intlTelInputGlobals.instances[b][a]()})},s=function(){function a(b,c){var d=this;e(this,a),this.id=n++,this.a=b,this.b=null,this.c=null;var f=c||{};this.d={},q(o,function(a,b){d.d[a]=f.hasOwnProperty(a)?f[a]:b}),this.e=Boolean(b.getAttribute("placeholder"))}return g(a,[{key:"_init",value:function(){var a=this;this.d.useFullscreenPopup&&(this.d.fixDropdownWidth=!1,this.d.countrySearch=!1),this.d.countrySearch&&(this.d.fixDropdownWidth=!0),this.d.nationalMode&&(this.d.autoInsertDialCode=!1),this.d.separateDialCode&&(this.d.autoInsertDialCode=!1);var b=this.d.allowDropdown&&!this.d.separateDialCode;if(!this.d.showFlags&&b&&(this.d.showFlags=!0),this.d.useFullscreenPopup&&!this.d.dropdownContainer&&(this.d.dropdownContainer=document.body),this.isRTL=!!this.a.closest("[dir=rtl]"),"undefined"!=typeof Promise){var c=new Promise(function(b,c){a.h=b,a.i=c}),d=new Promise(function(b,c){a.i0=b,a.i1=c});this.promise=Promise.all([c,d])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(a,c,d){c.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=c.length),this.q.hasOwnProperty(c)||(this.q[c]=[]);for(var e=0;e<this.q[c].length;e++)if(this.q[c][e]===a)return;var f=d!==b?d:this.q[c].length;this.q[c][f]=a}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var a=this.d.onlyCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(b){return a.indexOf(b.iso2)>-1})}else if(this.d.excludeCountries.length){var b=this.d.excludeCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(a){return-1===b.indexOf(a.iso2)})}else this.p=j}},{key:"_d0",value:function(){for(var a=0;a<this.p.length;a++){var b=this.p[a].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(b)&&(this.p[a].name=this.d.localizedCountries[b])}}},{key:"_d1",value:function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var a=0;a<this.p.length;a++){var b=this.p[a];this.dialCodes[b.dialCode]||(this.dialCodes[b.dialCode]=!0),this._c(b.iso2,b.dialCode,b.priority)}for(var c=0;c<this.p.length;c++){var d=this.p[c];if(d.areaCodes)for(var e=this.q[d.dialCode][0],f=0;f<d.areaCodes.length;f++){for(var g=d.areaCodes[f],h=1;h<g.length;h++){var i=d.dialCode+g.substr(0,h);this._c(e,i),this._c(d.iso2,i)}this._c(d.iso2,d.dialCode+g)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var a=0;a<this.d.preferredCountries.length;a++){var b=this.d.preferredCountries[a].toLowerCase(),c=this._y(b,!1,!0);c&&this.preferredCountries.push(c)}}},{key:"_e2",value:function(a,b,c){var d=document.createElement(a);return b&&q(b,function(a,b){return d.setAttribute(a,b)}),c&&c.appendChild(d),d}},{key:"_f",value:function(){this.a.classList.add("iti__tel-input"),this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var a=this.d,b=a.allowDropdown,d=a.separateDialCode,e=a.showFlags,f=a.customContainer,g=a.hiddenInput,h=a.dropdownContainer,i=a.fixDropdownWidth,j=a.useFullscreenPopup,k=a.countrySearch,l="iti";b&&(l+=" iti--allow-dropdown"),d&&(l+=" iti--separate-dial-code"),e&&(l+=" iti--show-flags"),i||(l+=" iti--flexible-dropdown-width"),f&&(l+=" ".concat(f));var m=this._e2("div",{"class":l});this.a.parentNode.insertBefore(m,this.a);var n=b||e||d;if(n&&(this.k=this._e2("div",{"class":"iti__flag-container"},m)),m.appendChild(this.a),n&&(this.selectedFlag=this._e2("div",c({"class":"iti__selected-flag"},b&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.k)),e&&(this.l=this._e2("div",{"class":"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.a.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),d&&(this.t=this._e2("div",{"class":"iti__selected-dial-code"},this.selectedFlag)),b)if(this.a.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{"class":"iti__arrow"},this.selectedFlag),this.dropdownContent=this._e2("div",{"class":"iti__dropdown-content iti__hide"}),k&&(this.searchInput=this._e2("input",{type:"text","class":"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.m=this._e2("ul",{"class":"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!k&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{"class":"iti__divider","aria-hidden":"true"},this.m)),this._g(this.p,"iti__standard"),h){var o=j?"iti--fullscreen-popup":"";this.dropdown=this._e2("div",{"class":"iti iti--container ".concat(o)}),this.dropdown.appendChild(this.dropdownContent)}else this.k.appendChild(this.dropdownContent);if(g){var p=g,q=this.a.getAttribute("name");if(q){var r=q.lastIndexOf("[");-1!==r&&(p="".concat(q.substr(0,r),"[").concat(p,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:p}),m.appendChild(this.hiddenInput)}}},{key:"_g",value:function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d],f=c?"-preferred":"",g=this._e2("li",{id:"iti-".concat(this.id,"__item-").concat(e.iso2).concat(f),"class":"iti__country ".concat(b),tabindex:"-1",role:"option","data-dial-code":e.dialCode,"data-country-code":e.iso2,"aria-selected":"false"},this.m);e.node=g;var h="";this.d.showFlags&&(h+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(e.iso2,"'></div></div>")),h+="<span class='iti__country-name'>".concat(e.name,"</span>"),h+="<span class='iti__dial-code'>+".concat(e.dialCode,"</span>"),g.insertAdjacentHTML("beforeend",h)}}},{key:"_h",value:function(){var a=this.a.getAttribute("value"),b=this.a.value,c=a&&"+"===a.charAt(0)&&(!b||"+"!==b.charAt(0)),d=c?a:b,e=this._5(d),f=this._w(d),g=this.d,h=g.initialCountry,i=g.autoInsertDialCode;e&&!f?this._v(d):"auto"!==h&&(h?this._z(h.toLowerCase()):e&&f?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,d||this._z(this.j)),!d&&i&&(this.a.value="+".concat(this.s.dialCode))),d&&this._u(d)}},{key:"_i",value:function(){this._j(),this.d.autoInsertDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var a=this;this._a14=function(){a.hiddenInput.value=a.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var a=this.a;a&&"LABEL"!==a.tagName;)a=a.parentNode;return a}},{key:"_i2",value:function(){var a=this;this._a9=function(b){a.dropdownContent.classList.contains("iti__hide")?a.a.focus():b.preventDefault()};var b=this._i1();b&&b.addEventListener("click",this._a9),this._a10=function(){!a.dropdownContent.classList.contains("iti__hide")||a.a.disabled||a.a.readOnly||a._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(b){a.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),a._n()),"Tab"===b.key&&a._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var a=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(a.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(a){window.intlTelInputGlobals.autoCountry=a.toLowerCase(),setTimeout(function(){return r("handleAutoCountry")})},function(){return r("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var a=this;this._a12=function(){a._v(a.a.value)&&a._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(a._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(a){var b=this.a.getAttribute("maxlength");return b&&a.length>b?a.substr(0,b):a}},{key:"_l",value:function(){var a=this;this._a8=function(){a._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var a=this._m(this.a.value);a&&this.s.dialCode!==a||(this.a.value="")}}},{key:"_m",value:function(a){return a.replace(/\D/g,"")}},{key:"_m2",value:function(a){var b=document.createEvent("Event");b.initEvent(a,!0,!0),this.a.dispatchEvent(b)}},{key:"_n",value:function(){this.d.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.a.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.d.countrySearch?(this._x(this.m.firstElementChild,!1),this.searchInput.focus()):this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(a,b,c){c&&!a.classList.contains(b)?a.classList.add(b):!c&&a.classList.contains(b)&&a.classList.remove(b)}},{key:"_o",value:function(){var a=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.d.useFullscreenPopup){var b=this.a.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop,d=b.top+c,e=this.dropdownContent.offsetHeight,f=d+this.a.offsetHeight+e<c+window.innerHeight,g=d-e>c;if(this._n2(this.dropdownContent,"iti__country-list--dropup",!f&&g),this.d.dropdownContainer){var h=!f&&g?0:this.a.offsetHeight;this.dropdown.style.top="".concat(d+h,"px"),this.dropdown.style.left="".concat(b.left+document.body.scrollLeft,"px"),this._a4=function(){return a._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(a){for(var b=a;b&&b!==this.m&&!b.classList.contains("iti__country");)b=b.parentNode;return b===this.m?null:b}},{key:"_p",value:function(){var a=this;this._a0=function(b){var c=a._o2(b.target);c&&a._x(c,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(b){var c=a._o2(b.target);c&&a._1(c)},this.m.addEventListener("click",this._a1);var b=!0;this._a2=function(){b||a._2(),b=!1},document.documentElement.addEventListener("click",this._a2);var c="",d=null;if(this._a3=function(b){["ArrowUp","ArrowDown","Enter","Escape"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),"ArrowUp"===b.key||"ArrowDown"===b.key?a._q(b.key):"Enter"===b.key?a._r():"Escape"===b.key&&a._2()),!a.d.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(b.key)&&(b.stopPropagation(),d&&clearTimeout(d),c+=b.key.toLowerCase(),a._s(c),d=setTimeout(function(){c=""},1e3))},document.addEventListener("keydown",this._a3),this.d.countrySearch){var e=function(){var b=a.searchInput.value.trim();b?a._filterCountries(b.toLowerCase()):a._filterCountries(null,!0)},f=null;this._handleSearchChange=function(){f&&clearTimeout(f),f=setTimeout(function(){e(),f=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",function(a){return a.stopPropagation()})}}},{key:"_filterCountries",value:function(a){var c=arguments.length>1&&arguments[1]!==b&&arguments[1],d=!0;this.m.innerHTML="";for(var e=0;e<this.p.length;e++){var f=this.p[e],g=f.name.toLowerCase(),h="+".concat(f.dialCode);(c||g.includes(a)||h.includes(a))&&(this.m.appendChild(f.node),d&&(this._x(f.node,!1),d=!1))}}},{key:"_q",value:function(a){var b="ArrowUp"===a?this.c.previousElementSibling:this.c.nextElementSibling;if(b?b.classList.contains("iti__divider")&&(b="ArrowUp"===a?b.previousElementSibling:b.nextElementSibling):this.m.childElementCount>1&&(b="ArrowUp"===a?this.m.lastElementChild:this.m.firstElementChild),b){var c=!this.d.countrySearch;this._x(b,c),this.d.countrySearch&&this._3(b,!1)}}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(a){for(var b=0;b<this.p.length;b++)if(this._t(this.p[b].name,a)){var c=this.p[b].node;this._x(c,!1),this._3(c,!0);break}}},{key:"_t",value:function(a,b){return a.substr(0,b.length).toLowerCase()===b}},{key:"_u",value:function(a){var b=a;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var c=this.d.nationalMode||"+"!==b.charAt(0)&&!this.d.separateDialCode,d=intlTelInputUtils.numberFormat,e=d.NATIONAL,f=d.INTERNATIONAL,g=c?e:f;b=intlTelInputUtils.formatNumber(b,this.s.iso2,g)}b=this._7(b),this.a.value=b}},{key:"_v",value:function(a){var b=a,c=this.s.dialCode,d="1"===c;b&&d&&"+"!==b.charAt(0)&&("1"!==b.charAt(0)&&(b="1".concat(b)),b="+".concat(b)),this.d.separateDialCode&&c&&"+"!==b.charAt(0)&&(b="+".concat(c).concat(b));var e=this._5(b,!0),f=this._m(b),g=null;if(e){var h=this.q[this._m(e)],i=-1!==h.indexOf(this.s.iso2)&&f.length<=e.length-1;if(!("1"===c&&this._w(f))&&!i)for(var j=0;j<h.length;j++)if(h[j]){g=h[j];break}}else"+"===b.charAt(0)&&f.length?g="":b&&"+"!==b||(g=this.j);return null!==g&&this._z(g)}},{key:"_w",value:function(a){var b=this._m(a);if("1"===b.charAt(0)){var c=b.substr(1,3);return-1!==p.indexOf(c)}return!1}},{key:"_x",value:function(a,b){var c=this.c;c&&c.classList.remove("iti__highlight"),this.c=a,this.c.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",a.getAttribute("id")),b&&this.c.focus()}},{key:"_y",value:function(a,b,c){for(var d=b?j:this.p,e=0;e<d.length;e++)if(d[e].iso2===a)return d[e];if(c)return null;throw new Error("No country data for '".concat(a,"'"))}},{key:"_z",value:function(a){var b=this.d,c=b.allowDropdown,d=b.separateDialCode,e=b.showFlags,f=this.s.iso2?this.s:{};if(this.s=a?this._y(a,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),e&&this.l.setAttribute("class","iti__flag iti__".concat(a)),this._setSelectedCountryFlagTitleAttribute(a,d),d){var g=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=g;var h=this.selectedFlag.offsetWidth||this._z2();this.isRTL?this.a.style.paddingRight="".concat(h+6,"px"):this.a.style.paddingLeft="".concat(h+6,"px")}if(this._0(),c){var i=this.b;if(i&&(i.classList.remove("iti__active"),i.setAttribute("aria-selected","false")),a){var j=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a));j.setAttribute("aria-selected","true"),j.classList.add("iti__active"),this.b=j}}return f.iso2!==a}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(a,b){if(this.selectedFlag){var c;c=a&&!b?"".concat(this.s.name,": +").concat(this.s.dialCode):a?this.s.name:"Unknown",this.selectedFlag.setAttribute("title",c)}}},{key:"_z2",value:function(){var a=this.a.parentNode.cloneNode();a.style.visibility="hidden",document.body.appendChild(a);var b=this.k.cloneNode();a.appendChild(b);var c=this.selectedFlag.cloneNode(!0);b.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),d}},{key:"_0",value:function(){var a="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&a){var b=intlTelInputUtils.numberType[this.d.placeholderNumberType],c=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,b):"";c=this._7(c),"function"==typeof this.d.customPlaceholder&&(c=this.d.customPlaceholder(c,this.s)),this.a.setAttribute("placeholder",c)}}},{key:"_1",value:function(a){var b=this._z(a.getAttribute("data-country-code"));this._2(),this._4(a.getAttribute("data-dial-code")),this.a.focus();var c=this.a.value.length;this.a.setSelectionRange(c,c),b&&this._m2CountryChange()}},{key:"_2",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),this.d.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.d.useFullscreenPopup||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(a,b){var c=this.dropdownContent,d=window.pageYOffset||document.documentElement.scrollTop,e=c.offsetHeight,f=c.getBoundingClientRect().top+d,g=f+e,h=a.offsetHeight,i=a.getBoundingClientRect().top+d,j=i+h,k=i-f+c.scrollTop,l=e/2-h/2;if(i<f)b&&(k-=l),c.scrollTop=k;else if(j>g){b&&(k+=l);var m=e-h;c.scrollTop=k-m}}},{key:"_4",value:function(a){var b,c=this.a.value,d="+".concat(a);if("+"===c.charAt(0)){var e=this._5(c);b=e?c.replace(e,d):d,this.a.value=b}else this.d.autoInsertDialCode&&(b=c?d+c:d,this.a.value=b)}},{key:"_5",value:function(a,b){var c="";if("+"===a.charAt(0))for(var d="",e=0;e<a.length;e++){var f=a.charAt(e);if(!isNaN(parseInt(f,10))){if(d+=f,b)this.q[d]&&(c=a.substr(0,e+1));else if(this.dialCodes[d]){c=a.substr(0,e+1);break}if(d.length===this.countryCodeMaxLen)break}}return c}},{key:"_6",value:function(){var a=this.a.value.trim(),b=this.s.dialCode,c=this._m(a);return(this.d.separateDialCode&&"+"!==a.charAt(0)&&b&&c?"+".concat(b):"")+a}},{key:"_7",value:function(a){var b=a;if(this.d.separateDialCode){var c=this._5(b);if(c){
8
+ c="+".concat(this.s.dialCode);var d=" "===b[c.length]||"-"===b[c.length]?c.length+1:c.length;b=b.substr(d)}}return this._j2(b)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var a=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,this.s.iso2):null}},{key:"isPossibleNumber",value:function(){var a=this._6().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(a,this.s.iso2):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.s.iso2!==b&&(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),a}();m.getCountryData=function(){return j};var t=function(a,b,c){var d=document.createElement("script");d.onload=function(){r("handleUtils"),b&&b()},d.onerror=function(){r("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};m.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return t(a,b,c)});t(a)}return null},m.defaults=o,m.version="18.5.0";a.fn.intlTelInput=function(c){var d=arguments;if(c===b||"object"==typeof c)return this.each(function(){if(!a.data(this,"plugin_intlTelInput")){var b=new s(this,c);b._init(),window.intlTelInputGlobals.instances[b.id]=b,a.data(this,"plugin_intlTelInput",b)}});if("string"==typeof c&&"_"!==c[0]){var e;return this.each(function(){var b=a.data(this,"plugin_intlTelInput");b instanceof s&&"function"==typeof b[c]&&(e=b[c].apply(b,Array.prototype.slice.call(d,1))),"destroy"===c&&a.data(this,"plugin_intlTelInput",null)}),e!==b?e:this}}});