intl-tel-input 25.4.7 → 25.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.
- package/README.md +5 -5
- package/angular/build/IntlTelInput.cjs +9 -9
- package/angular/build/IntlTelInput.d.ts +1 -1
- package/angular/build/IntlTelInput.js +9 -9
- package/angular/build/IntlTelInputWithUtils.cjs +9 -9
- package/angular/build/IntlTelInputWithUtils.js +9 -9
- package/angular/build/intl-tel-input/angular.js +205 -0
- package/angular/build/intl-tel-input/angularWithUtils.js +206 -0
- package/angular/build/intl-tel-input/data.js +1096 -0
- package/angular/build/intl-tel-input/i18n/ar/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ar/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ar/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bg/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bg/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bg/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bn/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bn/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bn/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bs/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bs/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bs/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ca/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ca/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ca/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/cs/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/cs/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/cs/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/da/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/da/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/da/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/de/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/de/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/de/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ee/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ee/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ee/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/el/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/el/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/el/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/en/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/en/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/en/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/es/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/es/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/es/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fa/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fa/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fa/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hu/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hu/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hu/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/id/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/id/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/id/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/index.js +40 -0
- package/angular/build/intl-tel-input/i18n/it/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/it/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/it/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ja/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ja/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ja/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ko/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ko/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ko/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/mr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/mr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/mr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/nl/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/nl/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/nl/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/no/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/no/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/no/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/pl/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/pl/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/pl/interface.js +24 -0
- package/angular/build/intl-tel-input/i18n/pt/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/pt/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/pt/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ro/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ro/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ro/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ru/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ru/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ru/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/sk/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/sk/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/sk/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/sv/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/sv/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/sv/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/te/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/te/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/te/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/th/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/th/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/th/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/tr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/tr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/tr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/types.js +1 -0
- package/angular/build/intl-tel-input/i18n/uk/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/uk/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/uk/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ur/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ur/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ur/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/uz/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/uz/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/uz/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/vi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/vi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/vi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/zh/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/zh/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/zh/interface.js +13 -0
- package/angular/build/intl-tel-input/intlTelInputWithUtils.js +4 -0
- package/angular/build/intl-tel-input/utils.js +1341 -0
- package/angular/build/intl-tel-input.js +1812 -0
- package/angular/build/types/intl-tel-input/angular.d.ts +40 -0
- package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +40 -0
- package/angular/build/types/intl-tel-input/data.d.ts +11 -0
- package/angular/build/types/intl-tel-input/i18n/ar/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ar/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ar/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bg/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bg/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bg/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bn/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bn/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bn/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bs/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bs/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bs/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ca/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ca/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ca/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/cs/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/cs/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/cs/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/da/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/da/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/da/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/de/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/de/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/de/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ee/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ee/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ee/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/el/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/el/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/el/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/en/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/en/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/en/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/es/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/es/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/es/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fa/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fa/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fa/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hu/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hu/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hu/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/id/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/id/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/id/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/index.d.ts +39 -0
- package/angular/build/types/intl-tel-input/i18n/it/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/it/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/it/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ja/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ja/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ja/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ko/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ko/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ko/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/mr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/mr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/mr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/nl/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/nl/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/nl/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/no/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/no/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/no/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pl/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pl/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/pl/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pt/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pt/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/pt/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ro/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ro/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ro/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ru/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ru/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ru/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sk/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sk/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/sk/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sv/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sv/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/sv/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/te/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/te/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/te/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/th/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/th/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/th/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/tr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/tr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/tr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/types.d.ts +254 -0
- package/angular/build/types/intl-tel-input/i18n/uk/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uk/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/uk/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ur/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ur/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ur/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uz/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uz/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/uz/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/vi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/vi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/vi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/zh/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/zh/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/zh/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/intlTelInputWithUtils.d.ts +2 -0
- package/angular/build/types/intl-tel-input/utils.d.ts +2 -0
- package/angular/build/types/intl-tel-input.d.ts +199 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +1 -1
- package/build/js/intlTelInput.js +46 -17
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +46 -17
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +5 -7
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +45 -16
- package/react/build/IntlTelInput.d.ts +1 -1
- package/react/build/IntlTelInput.js +45 -16
- package/react/build/IntlTelInputWithUtils.cjs +45 -16
- package/react/build/IntlTelInputWithUtils.js +45 -16
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +160 -153
- package/vue/build/IntlTelInputWithUtils.mjs +543 -536
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
const
|
|
1
|
+
import { mergeModels as n2, useModel as M2, ref as I1, onMounted as D2, watch as P2, onUnmounted as x2, withDirectives as R2, createElementBlock as B2, openBlock as k2, mergeProps as O2, vModelText as G2 } from "vue";
|
|
2
|
+
const s2 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
5
5
|
// Afghanistan
|
|
@@ -1323,9 +1323,9 @@ const r2 = [
|
|
|
1323
1323
|
"263"
|
|
1324
1324
|
]
|
|
1325
1325
|
], W = [];
|
|
1326
|
-
for (let
|
|
1327
|
-
const e =
|
|
1328
|
-
W[
|
|
1326
|
+
for (let I = 0; I < s2.length; I++) {
|
|
1327
|
+
const e = s2[I];
|
|
1328
|
+
W[I] = {
|
|
1329
1329
|
name: "",
|
|
1330
1330
|
// this is now populated in the plugin
|
|
1331
1331
|
iso2: e[0],
|
|
@@ -1590,11 +1590,11 @@ const F2 = {
|
|
|
1590
1590
|
// additional countries (not supported by country-list library)
|
|
1591
1591
|
ac: "Ascension Island",
|
|
1592
1592
|
xk: "Kosovo"
|
|
1593
|
-
},
|
|
1594
|
-
for (let
|
|
1595
|
-
W[
|
|
1593
|
+
}, u2 = { ...F2, ...U2 };
|
|
1594
|
+
for (let I = 0; I < W.length; I++)
|
|
1595
|
+
W[I].name = u2[W[I].iso2];
|
|
1596
1596
|
let V2 = 0;
|
|
1597
|
-
const
|
|
1597
|
+
const l2 = {
|
|
1598
1598
|
//* Whether or not to allow the dropdown.
|
|
1599
1599
|
allowDropdown: !0,
|
|
1600
1600
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
@@ -1667,46 +1667,46 @@ const a2 = {
|
|
|
1667
1667
|
"887",
|
|
1668
1668
|
"888",
|
|
1669
1669
|
"889"
|
|
1670
|
-
], c1 = (
|
|
1671
|
-
const e = c1(
|
|
1670
|
+
], c1 = (I) => I.replace(/\D/g, ""), r2 = (I = "") => I.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), o2 = (I) => {
|
|
1671
|
+
const e = c1(I);
|
|
1672
1672
|
if (e.charAt(0) === "1") {
|
|
1673
|
-
const
|
|
1674
|
-
return K2.includes(
|
|
1673
|
+
const i = e.substr(1, 3);
|
|
1674
|
+
return K2.includes(i);
|
|
1675
1675
|
}
|
|
1676
1676
|
return !1;
|
|
1677
|
-
}, H2 = (
|
|
1678
|
-
if (
|
|
1677
|
+
}, H2 = (I, e, i, s) => {
|
|
1678
|
+
if (i === 0 && !s)
|
|
1679
1679
|
return 0;
|
|
1680
1680
|
let o = 0;
|
|
1681
1681
|
for (let a = 0; a < e.length; a++) {
|
|
1682
|
-
if (/[+0-9]/.test(e[a]) && o++, o ===
|
|
1682
|
+
if (/[+0-9]/.test(e[a]) && o++, o === I && !s)
|
|
1683
1683
|
return a + 1;
|
|
1684
|
-
if (s && o ===
|
|
1684
|
+
if (s && o === I + 1)
|
|
1685
1685
|
return a;
|
|
1686
1686
|
}
|
|
1687
1687
|
return e.length;
|
|
1688
|
-
},
|
|
1689
|
-
const s = document.createElement(
|
|
1690
|
-
return e && Object.entries(e).forEach(([o, a]) => s.setAttribute(o, a)),
|
|
1691
|
-
}, $1 = (
|
|
1692
|
-
const { instances:
|
|
1693
|
-
Object.values(
|
|
1688
|
+
}, E = (I, e, i) => {
|
|
1689
|
+
const s = document.createElement(I);
|
|
1690
|
+
return e && Object.entries(e).forEach(([o, a]) => s.setAttribute(o, a)), i && i.appendChild(s), s;
|
|
1691
|
+
}, $1 = (I, ...e) => {
|
|
1692
|
+
const { instances: i } = y;
|
|
1693
|
+
Object.values(i).forEach((s) => s[I](...e));
|
|
1694
1694
|
};
|
|
1695
1695
|
class j2 {
|
|
1696
|
-
constructor(e,
|
|
1697
|
-
this.id = V2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({},
|
|
1696
|
+
constructor(e, i = {}) {
|
|
1697
|
+
this.id = V2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2, i), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
|
|
1698
1698
|
}
|
|
1699
1699
|
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
1700
1700
|
_init() {
|
|
1701
1701
|
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.onlyCountries.length === 1 && (this.options.initialCountry = this.options.onlyCountries[0]), this.options.separateDialCode && (this.options.nationalMode = !1), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
1702
1702
|
const e = this.options.allowDropdown || this.options.separateDialCode;
|
|
1703
|
-
this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...
|
|
1704
|
-
const
|
|
1703
|
+
this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...u2, ...this.options.i18n };
|
|
1704
|
+
const i = new Promise((o, a) => {
|
|
1705
1705
|
this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = a;
|
|
1706
1706
|
}), s = new Promise((o, a) => {
|
|
1707
1707
|
this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise = a;
|
|
1708
1708
|
});
|
|
1709
|
-
this.promise = Promise.all([
|
|
1709
|
+
this.promise = Promise.all([i, s]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
|
|
1710
1710
|
}
|
|
1711
1711
|
//********************
|
|
1712
1712
|
//* PRIVATE METHODS
|
|
@@ -1717,28 +1717,28 @@ class j2 {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
//* Sort countries by countryOrder option (if present), then name.
|
|
1719
1719
|
_sortCountries() {
|
|
1720
|
-
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e,
|
|
1720
|
+
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
|
|
1721
1721
|
const { countryOrder: s } = this.options;
|
|
1722
1722
|
if (s) {
|
|
1723
|
-
const o = s.indexOf(e.iso2), a = s.indexOf(
|
|
1723
|
+
const o = s.indexOf(e.iso2), a = s.indexOf(i.iso2), c = o > -1, g = a > -1;
|
|
1724
1724
|
if (c || g)
|
|
1725
1725
|
return c && g ? o - a : c ? -1 : 1;
|
|
1726
1726
|
}
|
|
1727
|
-
return e.name.localeCompare(
|
|
1727
|
+
return e.name.localeCompare(i.name);
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
1730
|
//* Add a dial code to this.dialCodeToIso2Map.
|
|
1731
|
-
_addToDialCodeMap(e,
|
|
1732
|
-
|
|
1733
|
-
for (let a = 0; a < this.dialCodeToIso2Map[
|
|
1734
|
-
if (this.dialCodeToIso2Map[
|
|
1731
|
+
_addToDialCodeMap(e, i, s) {
|
|
1732
|
+
i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
|
|
1733
|
+
for (let a = 0; a < this.dialCodeToIso2Map[i].length; a++)
|
|
1734
|
+
if (this.dialCodeToIso2Map[i][a] === e)
|
|
1735
1735
|
return;
|
|
1736
|
-
const o = s !== void 0 ? s : this.dialCodeToIso2Map[
|
|
1737
|
-
this.dialCodeToIso2Map[
|
|
1736
|
+
const o = s !== void 0 ? s : this.dialCodeToIso2Map[i].length;
|
|
1737
|
+
this.dialCodeToIso2Map[i][o] = e;
|
|
1738
1738
|
}
|
|
1739
1739
|
//* Process onlyCountries or excludeCountries array if present.
|
|
1740
1740
|
_processAllCountries() {
|
|
1741
|
-
const { onlyCountries: e, excludeCountries:
|
|
1741
|
+
const { onlyCountries: e, excludeCountries: i } = this.options;
|
|
1742
1742
|
if (e.length) {
|
|
1743
1743
|
const s = e.map(
|
|
1744
1744
|
(o) => o.toLowerCase()
|
|
@@ -1746,8 +1746,8 @@ class j2 {
|
|
|
1746
1746
|
this.countries = W.filter(
|
|
1747
1747
|
(o) => s.includes(o.iso2)
|
|
1748
1748
|
);
|
|
1749
|
-
} else if (
|
|
1750
|
-
const s =
|
|
1749
|
+
} else if (i.length) {
|
|
1750
|
+
const s = i.map(
|
|
1751
1751
|
(o) => o.toLowerCase()
|
|
1752
1752
|
);
|
|
1753
1753
|
this.countries = W.filter(
|
|
@@ -1759,57 +1759,57 @@ class j2 {
|
|
|
1759
1759
|
//* Translate Countries by object literal provided on config.
|
|
1760
1760
|
_translateCountryNames() {
|
|
1761
1761
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1762
|
-
const
|
|
1763
|
-
this.options.i18n.hasOwnProperty(
|
|
1762
|
+
const i = this.countries[e].iso2.toLowerCase();
|
|
1763
|
+
this.options.i18n.hasOwnProperty(i) && (this.countries[e].name = this.options.i18n[i]);
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
1766
|
//* Generate this.dialCodes and this.dialCodeToIso2Map.
|
|
1767
1767
|
_processDialCodes() {
|
|
1768
1768
|
this.dialCodes = {}, this.dialCodeMaxLen = 0, this.dialCodeToIso2Map = {};
|
|
1769
1769
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1770
|
-
const
|
|
1771
|
-
this.dialCodes[
|
|
1770
|
+
const i = this.countries[e];
|
|
1771
|
+
this.dialCodes[i.dialCode] || (this.dialCodes[i.dialCode] = !0), this._addToDialCodeMap(i.iso2, i.dialCode, i.priority);
|
|
1772
1772
|
}
|
|
1773
1773
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const s = this.dialCodeToIso2Map[
|
|
1777
|
-
for (let o = 0; o <
|
|
1778
|
-
const a =
|
|
1774
|
+
const i = this.countries[e];
|
|
1775
|
+
if (i.areaCodes) {
|
|
1776
|
+
const s = this.dialCodeToIso2Map[i.dialCode][0];
|
|
1777
|
+
for (let o = 0; o < i.areaCodes.length; o++) {
|
|
1778
|
+
const a = i.areaCodes[o];
|
|
1779
1779
|
for (let c = 1; c < a.length; c++) {
|
|
1780
|
-
const g = a.substr(0, c), f =
|
|
1781
|
-
this._addToDialCodeMap(s, f), this._addToDialCodeMap(
|
|
1780
|
+
const g = a.substr(0, c), f = i.dialCode + g;
|
|
1781
|
+
this._addToDialCodeMap(s, f), this._addToDialCodeMap(i.iso2, f);
|
|
1782
1782
|
}
|
|
1783
|
-
this._addToDialCodeMap(
|
|
1783
|
+
this._addToDialCodeMap(i.iso2, i.dialCode + a);
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1789
1789
|
_generateMarkup() {
|
|
1790
|
-
var
|
|
1790
|
+
var C, m, x;
|
|
1791
1791
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
1792
1792
|
const {
|
|
1793
1793
|
allowDropdown: e,
|
|
1794
|
-
separateDialCode:
|
|
1794
|
+
separateDialCode: i,
|
|
1795
1795
|
showFlags: s,
|
|
1796
1796
|
containerClass: o,
|
|
1797
1797
|
hiddenInput: a,
|
|
1798
1798
|
dropdownContainer: c,
|
|
1799
1799
|
fixDropdownWidth: g,
|
|
1800
1800
|
useFullscreenPopup: f,
|
|
1801
|
-
countrySearch:
|
|
1802
|
-
i18n:
|
|
1801
|
+
countrySearch: v,
|
|
1802
|
+
i18n: b
|
|
1803
1803
|
} = this.options;
|
|
1804
|
-
let
|
|
1805
|
-
e && (
|
|
1806
|
-
const
|
|
1807
|
-
if ((
|
|
1808
|
-
this.countryContainer =
|
|
1804
|
+
let S = "iti";
|
|
1805
|
+
e && (S += " iti--allow-dropdown"), s && (S += " iti--show-flags"), o && (S += ` ${o}`), f || (S += " iti--inline-dropdown");
|
|
1806
|
+
const L = E("div", { class: S });
|
|
1807
|
+
if ((C = this.telInput.parentNode) == null || C.insertBefore(L, this.telInput), e || s || i) {
|
|
1808
|
+
this.countryContainer = E(
|
|
1809
1809
|
"div",
|
|
1810
1810
|
{ class: "iti__country-container" },
|
|
1811
|
-
|
|
1812
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry =
|
|
1811
|
+
L
|
|
1812
|
+
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = E(
|
|
1813
1813
|
"button",
|
|
1814
1814
|
{
|
|
1815
1815
|
type: "button",
|
|
@@ -1821,112 +1821,112 @@ class j2 {
|
|
|
1821
1821
|
role: "combobox"
|
|
1822
1822
|
},
|
|
1823
1823
|
this.countryContainer
|
|
1824
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
1824
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = E(
|
|
1825
1825
|
"div",
|
|
1826
1826
|
{ class: "iti__selected-country" },
|
|
1827
1827
|
this.countryContainer
|
|
1828
1828
|
);
|
|
1829
|
-
const
|
|
1830
|
-
if (this.selectedCountryInner =
|
|
1829
|
+
const O = E("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
|
|
1830
|
+
if (this.selectedCountryInner = E("div", { class: "iti__flag" }, O), this.selectedCountryA11yText = E(
|
|
1831
1831
|
"span",
|
|
1832
1832
|
{ class: "iti__a11y-text" },
|
|
1833
1833
|
this.selectedCountryInner
|
|
1834
|
-
), e && (this.dropdownArrow =
|
|
1834
|
+
), e && (this.dropdownArrow = E(
|
|
1835
1835
|
"div",
|
|
1836
1836
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1837
|
-
|
|
1838
|
-
)),
|
|
1837
|
+
O
|
|
1838
|
+
)), i && (this.selectedDialCode = E(
|
|
1839
1839
|
"div",
|
|
1840
1840
|
{ class: "iti__selected-dial-code" },
|
|
1841
1841
|
this.selectedCountry
|
|
1842
1842
|
)), e) {
|
|
1843
|
-
const
|
|
1844
|
-
if (this.dropdownContent =
|
|
1843
|
+
const T = g ? "" : "iti--flexible-dropdown-width";
|
|
1844
|
+
if (this.dropdownContent = E("div", {
|
|
1845
1845
|
id: `iti-${this.id}__dropdown-content`,
|
|
1846
|
-
class: `iti__dropdown-content iti__hide ${
|
|
1847
|
-
}),
|
|
1846
|
+
class: `iti__dropdown-content iti__hide ${T}`
|
|
1847
|
+
}), v && (this.searchInput = E(
|
|
1848
1848
|
"input",
|
|
1849
1849
|
{
|
|
1850
1850
|
type: "text",
|
|
1851
1851
|
class: "iti__search-input",
|
|
1852
|
-
placeholder:
|
|
1852
|
+
placeholder: b.searchPlaceholder,
|
|
1853
1853
|
role: "combobox",
|
|
1854
1854
|
"aria-expanded": "true",
|
|
1855
|
-
"aria-label":
|
|
1855
|
+
"aria-label": b.searchPlaceholder,
|
|
1856
1856
|
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1857
1857
|
"aria-autocomplete": "list",
|
|
1858
1858
|
autocomplete: "off"
|
|
1859
1859
|
},
|
|
1860
1860
|
this.dropdownContent
|
|
1861
|
-
), this.searchResultsA11yText =
|
|
1861
|
+
), this.searchResultsA11yText = E(
|
|
1862
1862
|
"span",
|
|
1863
1863
|
{ class: "iti__a11y-text" },
|
|
1864
1864
|
this.dropdownContent
|
|
1865
|
-
)), this.countryList =
|
|
1865
|
+
)), this.countryList = E(
|
|
1866
1866
|
"ul",
|
|
1867
1867
|
{
|
|
1868
1868
|
class: "iti__country-list",
|
|
1869
1869
|
id: `iti-${this.id}__country-listbox`,
|
|
1870
1870
|
role: "listbox",
|
|
1871
|
-
"aria-label":
|
|
1871
|
+
"aria-label": b.countryListAriaLabel
|
|
1872
1872
|
},
|
|
1873
1873
|
this.dropdownContent
|
|
1874
|
-
), this._appendListItems(),
|
|
1875
|
-
let
|
|
1876
|
-
o && (
|
|
1874
|
+
), this._appendListItems(), v && this._updateSearchResultsText(), c) {
|
|
1875
|
+
let G = "iti iti--container";
|
|
1876
|
+
o && (G += ` ${o}`), f ? G += " iti--fullscreen-popup" : G += " iti--inline-dropdown", this.dropdown = E("div", { class: G }), this.dropdown.appendChild(this.dropdownContent);
|
|
1877
1877
|
} else
|
|
1878
1878
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
|
-
if (
|
|
1882
|
-
const
|
|
1883
|
-
if (
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1881
|
+
if (L.appendChild(this.telInput), this._updateInputPadding(), a) {
|
|
1882
|
+
const O = this.telInput.getAttribute("name") || "", T = a(O);
|
|
1883
|
+
if (T.phone) {
|
|
1884
|
+
const G = (m = this.telInput.form) == null ? void 0 : m.querySelector(`input[name="${T.phone}"]`);
|
|
1885
|
+
G ? this.hiddenInput = G : (this.hiddenInput = E("input", {
|
|
1886
1886
|
type: "hidden",
|
|
1887
|
-
name:
|
|
1888
|
-
}),
|
|
1887
|
+
name: T.phone
|
|
1888
|
+
}), L.appendChild(this.hiddenInput));
|
|
1889
1889
|
}
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1890
|
+
if (T.country) {
|
|
1891
|
+
const G = (x = this.telInput.form) == null ? void 0 : x.querySelector(`input[name="${T.country}"]`);
|
|
1892
|
+
G ? this.hiddenInputCountry = G : (this.hiddenInputCountry = E("input", {
|
|
1893
1893
|
type: "hidden",
|
|
1894
|
-
name:
|
|
1895
|
-
}),
|
|
1894
|
+
name: T.country
|
|
1895
|
+
}), L.appendChild(this.hiddenInputCountry));
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
1899
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
1900
1900
|
_appendListItems() {
|
|
1901
1901
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1902
|
-
const
|
|
1902
|
+
const i = this.countries[e], s = e === 0 ? "iti__highlight" : "", o = E(
|
|
1903
1903
|
"li",
|
|
1904
1904
|
{
|
|
1905
|
-
id: `iti-${this.id}__item-${
|
|
1905
|
+
id: `iti-${this.id}__item-${i.iso2}`,
|
|
1906
1906
|
class: `iti__country ${s}`,
|
|
1907
1907
|
tabindex: "-1",
|
|
1908
1908
|
role: "option",
|
|
1909
|
-
"data-dial-code":
|
|
1910
|
-
"data-country-code":
|
|
1909
|
+
"data-dial-code": i.dialCode,
|
|
1910
|
+
"data-country-code": i.iso2,
|
|
1911
1911
|
"aria-selected": "false"
|
|
1912
1912
|
},
|
|
1913
1913
|
this.countryList
|
|
1914
1914
|
);
|
|
1915
|
-
|
|
1915
|
+
i.nodeById[this.id] = o;
|
|
1916
1916
|
let a = "";
|
|
1917
|
-
this.options.showFlags && (a += `<div class='iti__flag iti__${
|
|
1917
|
+
this.options.showFlags && (a += `<div class='iti__flag iti__${i.iso2}'></div>`), a += `<span class='iti__country-name'>${i.name}</span>`, a += `<span class='iti__dial-code'>+${i.dialCode}</span>`, o.insertAdjacentHTML("beforeend", a);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
//* Set the initial state of the input value and the selected country by:
|
|
1921
1921
|
//* 1. Extracting a dial code from the given number
|
|
1922
1922
|
//* 2. Using explicit initialCountry
|
|
1923
1923
|
_setInitialState(e = !1) {
|
|
1924
|
-
const
|
|
1924
|
+
const i = this.telInput.getAttribute("value"), s = this.telInput.value, a = i && i.charAt(0) === "+" && (!s || s.charAt(0) !== "+") ? i : s, c = this._getDialCode(a), g = o2(a), { initialCountry: f, geoIpLookup: v } = this.options, b = f === "auto" && v;
|
|
1925
1925
|
if (c && !g)
|
|
1926
1926
|
this._updateCountryFromNumber(a);
|
|
1927
|
-
else if (!
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1927
|
+
else if (!b || e) {
|
|
1928
|
+
const S = f ? f.toLowerCase() : "";
|
|
1929
|
+
S && this._getCountryData(S, !0) ? this._setCountry(S) : c && g ? this._setCountry("us") : this._setCountry();
|
|
1930
1930
|
}
|
|
1931
1931
|
a && this._updateValFromNumber(a);
|
|
1932
1932
|
}
|
|
@@ -1946,14 +1946,14 @@ class j2 {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
//* initialise the dropdown listeners.
|
|
1948
1948
|
_initDropdownListeners() {
|
|
1949
|
-
this._handleLabelClick = (
|
|
1950
|
-
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() :
|
|
1949
|
+
this._handleLabelClick = (i) => {
|
|
1950
|
+
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : i.preventDefault();
|
|
1951
1951
|
};
|
|
1952
1952
|
const e = this.telInput.closest("label");
|
|
1953
1953
|
e && e.addEventListener("click", this._handleLabelClick), this._handleClickSelectedCountry = () => {
|
|
1954
1954
|
this.dropdownContent.classList.contains("iti__hide") && !this.telInput.disabled && !this.telInput.readOnly && this._openDropdown();
|
|
1955
|
-
}, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (
|
|
1956
|
-
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(
|
|
1955
|
+
}, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (i) => {
|
|
1956
|
+
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(i.key) && (i.preventDefault(), i.stopPropagation(), this._openDropdown()), i.key === "Tab" && this._closeDropdown();
|
|
1957
1957
|
}, this.countryContainer.addEventListener(
|
|
1958
1958
|
"keydown",
|
|
1959
1959
|
this._handleCountryContainerKeydown
|
|
@@ -1961,19 +1961,19 @@ class j2 {
|
|
|
1961
1961
|
}
|
|
1962
1962
|
//* Init many requests: utils script / geo ip lookup.
|
|
1963
1963
|
_initRequests() {
|
|
1964
|
-
let { loadUtils: e, initialCountry:
|
|
1965
|
-
e && !
|
|
1964
|
+
let { loadUtils: e, initialCountry: i, geoIpLookup: s } = this.options;
|
|
1965
|
+
e && !y.utils ? (this._handlePageLoad = () => {
|
|
1966
1966
|
var a;
|
|
1967
|
-
window.removeEventListener("load", this._handlePageLoad), (a =
|
|
1967
|
+
window.removeEventListener("load", this._handlePageLoad), (a = y.attachUtils(e)) == null || a.catch(() => {
|
|
1968
1968
|
});
|
|
1969
|
-
},
|
|
1969
|
+
}, y.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && s && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
1970
1970
|
}
|
|
1971
1971
|
//* Perform the geo ip lookup.
|
|
1972
1972
|
_loadAutoCountry() {
|
|
1973
|
-
|
|
1973
|
+
y.autoCountry ? this.handleAutoCountry() : y.startedLoadingAutoCountry || (y.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
1974
1974
|
(e = "") => {
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1975
|
+
const i = e.toLowerCase();
|
|
1976
|
+
i && this._getCountryData(i, !0) ? (y.autoCountry = i, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
|
|
1977
1977
|
},
|
|
1978
1978
|
() => {
|
|
1979
1979
|
this._setInitialState(!0), $1("rejectAutoCountryPromise");
|
|
@@ -1985,21 +1985,21 @@ class j2 {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
//* Initialize the tel input listeners.
|
|
1987
1987
|
_initTelInputListeners() {
|
|
1988
|
-
const { strictMode: e, formatAsYouType:
|
|
1988
|
+
const { strictMode: e, formatAsYouType: i, separateDialCode: s, formatOnDisplay: o, allowDropdown: a, countrySearch: c } = this.options;
|
|
1989
1989
|
let g = !1;
|
|
1990
1990
|
new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (f) => {
|
|
1991
1991
|
if (this.isAndroid && (f == null ? void 0 : f.data) === "+" && s && a && c) {
|
|
1992
|
-
const
|
|
1993
|
-
this.telInput.value =
|
|
1992
|
+
const L = this.telInput.selectionStart || 0, C = this.telInput.value.substring(0, L - 1), m = this.telInput.value.substring(L);
|
|
1993
|
+
this.telInput.value = C + m, this._openDropdownWithPlus();
|
|
1994
1994
|
return;
|
|
1995
1995
|
}
|
|
1996
1996
|
this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
2001
|
-
const
|
|
2002
|
-
this.telInput.value =
|
|
1997
|
+
const v = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data), b = (f == null ? void 0 : f.inputType) === "insertFromPaste" && this.telInput.value;
|
|
1998
|
+
v || b && !e ? g = !0 : /[^+0-9]/.test(this.telInput.value) || (g = !1);
|
|
1999
|
+
const S = (f == null ? void 0 : f.detail) && f.detail.isSetNumber && !o;
|
|
2000
|
+
if (i && !g && !S) {
|
|
2001
|
+
const L = this.telInput.selectionStart || 0, m = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, x = (f == null ? void 0 : f.inputType) === "deleteContentForward", O = this._formatNumberAsYouType(), T = H2(m, O, L, x);
|
|
2002
|
+
this.telInput.value = O, this.telInput.setSelectionRange(T, T);
|
|
2003
2003
|
}
|
|
2004
2004
|
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || s) && (this._handleKeydownEvent = (f) => {
|
|
2005
2005
|
if (f.key && f.key.length === 1 && !f.altKey && !f.ctrlKey && !f.metaKey) {
|
|
@@ -2008,35 +2008,30 @@ class j2 {
|
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
2010
|
if (e) {
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
if (_) {
|
|
2014
|
-
const f1 = this.selectedCountryData.iso2;
|
|
2015
|
-
P = this._getCountryFromNumber(G) !== f1;
|
|
2016
|
-
}
|
|
2017
|
-
(!I || M && !P && !b) && f.preventDefault();
|
|
2011
|
+
const v = this.telInput.value, S = !(v.charAt(0) === "+") && this.telInput.selectionStart === 0 && f.key === "+", L = /^[0-9]$/.test(f.key), C = s ? L : S || L, m = v.slice(0, this.telInput.selectionStart) + f.key + v.slice(this.telInput.selectionEnd), x = this._getFullNumber(m), O = y.utils.getCoreNumber(x, this.selectedCountryData.iso2), T = this.maxCoreNumberLength && O.length > this.maxCoreNumberLength, f1 = this._getNewCountryFromNumber(x) !== null;
|
|
2012
|
+
(!C || T && !f1 && !S) && f.preventDefault();
|
|
2018
2013
|
}
|
|
2019
2014
|
}
|
|
2020
2015
|
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
|
|
2021
2016
|
}
|
|
2022
2017
|
//* Adhere to the input's maxlength attr.
|
|
2023
2018
|
_cap(e) {
|
|
2024
|
-
const
|
|
2025
|
-
return
|
|
2019
|
+
const i = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
|
|
2020
|
+
return i && e.length > i ? e.substr(0, i) : e;
|
|
2026
2021
|
}
|
|
2027
2022
|
//* Trigger a custom event on the input.
|
|
2028
|
-
_trigger(e,
|
|
2023
|
+
_trigger(e, i = {}) {
|
|
2029
2024
|
const s = new CustomEvent(e, {
|
|
2030
2025
|
bubbles: !0,
|
|
2031
2026
|
cancelable: !0,
|
|
2032
|
-
detail:
|
|
2027
|
+
detail: i
|
|
2033
2028
|
});
|
|
2034
2029
|
this.telInput.dispatchEvent(s);
|
|
2035
2030
|
}
|
|
2036
2031
|
//* Open the dropdown.
|
|
2037
2032
|
_openDropdown() {
|
|
2038
|
-
const { fixDropdownWidth: e, countrySearch:
|
|
2039
|
-
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(),
|
|
2033
|
+
const { fixDropdownWidth: e, countrySearch: i } = this.options;
|
|
2034
|
+
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), i) {
|
|
2040
2035
|
const s = this.countryList.firstElementChild;
|
|
2041
2036
|
s && (this._highlightListItem(s, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
|
|
2042
2037
|
}
|
|
@@ -2045,8 +2040,8 @@ class j2 {
|
|
|
2045
2040
|
//* Set the dropdown position
|
|
2046
2041
|
_setDropdownPosition() {
|
|
2047
2042
|
if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
|
|
2048
|
-
const e = this.telInput.getBoundingClientRect(),
|
|
2049
|
-
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top +
|
|
2043
|
+
const e = this.telInput.getBoundingClientRect(), i = this.telInput.offsetHeight;
|
|
2044
|
+
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + i}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
|
|
2050
2045
|
}
|
|
2051
2046
|
}
|
|
2052
2047
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
@@ -2070,10 +2065,10 @@ class j2 {
|
|
|
2070
2065
|
"click",
|
|
2071
2066
|
this._handleClickOffToClose
|
|
2072
2067
|
);
|
|
2073
|
-
let
|
|
2068
|
+
let i = "", s = null;
|
|
2074
2069
|
if (this._handleKeydownOnDropdown = (o) => {
|
|
2075
|
-
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(), s && clearTimeout(s),
|
|
2076
|
-
|
|
2070
|
+
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(), s && clearTimeout(s), i += o.key.toLowerCase(), this._searchForCountry(i), s = setTimeout(() => {
|
|
2071
|
+
i = "";
|
|
2077
2072
|
}, 1e3));
|
|
2078
2073
|
}, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
|
|
2079
2074
|
const o = () => {
|
|
@@ -2090,8 +2085,8 @@ class j2 {
|
|
|
2090
2085
|
}
|
|
2091
2086
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2092
2087
|
_searchForCountry(e) {
|
|
2093
|
-
for (let
|
|
2094
|
-
const s = this.countries[
|
|
2088
|
+
for (let i = 0; i < this.countries.length; i++) {
|
|
2089
|
+
const s = this.countries[i];
|
|
2095
2090
|
if (s.name.substr(0, e.length).toLowerCase() === e) {
|
|
2096
2091
|
const a = s.nodeById[this.id];
|
|
2097
2092
|
this._highlightListItem(a, !1), this._scrollTo(a);
|
|
@@ -2100,30 +2095,39 @@ class j2 {
|
|
|
2100
2095
|
}
|
|
2101
2096
|
}
|
|
2102
2097
|
//* Country search enabled: Filter the countries according to the search query.
|
|
2103
|
-
_filterCountries(e,
|
|
2098
|
+
_filterCountries(e, i = !1) {
|
|
2104
2099
|
let s = !0;
|
|
2105
2100
|
this.countryList.innerHTML = "";
|
|
2106
|
-
const o =
|
|
2107
|
-
for (let
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2101
|
+
const o = r2(e), a = o.length, c = [], g = [], f = [], v = [], b = [], S = [];
|
|
2102
|
+
for (let C = 0; C < this.countries.length; C++) {
|
|
2103
|
+
const m = this.countries[C], x = r2(m.name), O = m.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((T) => T[0]).join("").toLowerCase();
|
|
2104
|
+
i || a === 0 ? f.push(m) : m.iso2.toLowerCase() === o ? c.push(m) : x.startsWith(o) ? g.push(m) : x.includes(o) ? f.push(m) : o === m.dialCode || o === `+${m.dialCode}` ? v.push(m) : `+${m.dialCode}`.includes(o) ? b.push(m) : O.includes(o) && S.push(m);
|
|
2105
|
+
}
|
|
2106
|
+
const L = [
|
|
2107
|
+
...c.sort((C, m) => C.priority - m.priority),
|
|
2108
|
+
...g.sort((C, m) => C.priority - m.priority),
|
|
2109
|
+
...f.sort((C, m) => C.priority - m.priority),
|
|
2110
|
+
...v.sort((C, m) => C.priority - m.priority),
|
|
2111
|
+
...b.sort((C, m) => C.priority - m.priority),
|
|
2112
|
+
...S.sort((C, m) => C.priority - m.priority)
|
|
2113
|
+
];
|
|
2114
|
+
for (const C of L) {
|
|
2115
|
+
const m = C.nodeById[this.id];
|
|
2116
|
+
m && (this.countryList.appendChild(m), s && (this._highlightListItem(m, !1), s = !1));
|
|
2113
2117
|
}
|
|
2114
2118
|
s && this._highlightListItem(null, !1), this.countryList.scrollTop = 0, this._updateSearchResultsText();
|
|
2115
2119
|
}
|
|
2116
2120
|
//* Update search results text (for a11y).
|
|
2117
2121
|
_updateSearchResultsText() {
|
|
2118
|
-
const { i18n: e } = this.options,
|
|
2122
|
+
const { i18n: e } = this.options, i = this.countryList.childElementCount;
|
|
2119
2123
|
let s;
|
|
2120
|
-
"searchResultsText" in e ? s = e.searchResultsText(
|
|
2124
|
+
"searchResultsText" in e ? s = e.searchResultsText(i) : i === 0 ? s = e.zeroSearchResults : i === 1 ? s = e.oneSearchResult : s = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = s;
|
|
2121
2125
|
}
|
|
2122
2126
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2123
2127
|
_handleUpDownKey(e) {
|
|
2124
2128
|
var s, o;
|
|
2125
|
-
let
|
|
2126
|
-
!
|
|
2129
|
+
let i = e === "ArrowUp" ? (s = this.highlightedItem) == null ? void 0 : s.previousElementSibling : (o = this.highlightedItem) == null ? void 0 : o.nextElementSibling;
|
|
2130
|
+
!i && this.countryList.childElementCount > 1 && (i = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), i && (this._scrollTo(i), this._highlightListItem(i, !1));
|
|
2127
2131
|
}
|
|
2128
2132
|
//* Select the currently highlighted item.
|
|
2129
2133
|
_handleEnterKey() {
|
|
@@ -2132,45 +2136,48 @@ class j2 {
|
|
|
2132
2136
|
//* Update the input's value to the given val (format first if possible)
|
|
2133
2137
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2134
2138
|
_updateValFromNumber(e) {
|
|
2135
|
-
let
|
|
2136
|
-
if (this.options.formatOnDisplay &&
|
|
2137
|
-
const s = this.options.nationalMode ||
|
|
2138
|
-
|
|
2139
|
-
|
|
2139
|
+
let i = e;
|
|
2140
|
+
if (this.options.formatOnDisplay && y.utils && this.selectedCountryData) {
|
|
2141
|
+
const s = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: a } = y.utils.numberFormat, c = s ? o : a;
|
|
2142
|
+
i = y.utils.formatNumber(
|
|
2143
|
+
i,
|
|
2140
2144
|
this.selectedCountryData.iso2,
|
|
2141
2145
|
c
|
|
2142
2146
|
);
|
|
2143
2147
|
}
|
|
2144
|
-
|
|
2148
|
+
i = this._beforeSetNumber(i), this.telInput.value = i;
|
|
2145
2149
|
}
|
|
2146
2150
|
//* Check if need to select a new country based on the given number
|
|
2147
2151
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2148
2152
|
_updateCountryFromNumber(e) {
|
|
2149
|
-
const
|
|
2150
|
-
return
|
|
2153
|
+
const i = this._getNewCountryFromNumber(e);
|
|
2154
|
+
return i !== null ? this._setCountry(i) : !1;
|
|
2151
2155
|
}
|
|
2152
2156
|
_ensureHasDialCode(e) {
|
|
2153
|
-
const { dialCode:
|
|
2154
|
-
if (e.charAt(0) === "+" || !
|
|
2157
|
+
const { dialCode: i, nationalPrefix: s } = this.selectedCountryData;
|
|
2158
|
+
if (e.charAt(0) === "+" || !i)
|
|
2155
2159
|
return e;
|
|
2156
2160
|
const c = s && e.charAt(0) === s && !this.options.separateDialCode ? e.substring(1) : e;
|
|
2157
|
-
return `+${
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2161
|
+
return `+${i}${c}`;
|
|
2162
|
+
}
|
|
2163
|
+
// Get the country ISO2 code from the given number
|
|
2164
|
+
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2165
|
+
// NOTE: consider refactoring this to be more clear
|
|
2166
|
+
_getNewCountryFromNumber(e) {
|
|
2167
|
+
const i = e.indexOf("+");
|
|
2168
|
+
let s = i ? e.substring(i) : e;
|
|
2162
2169
|
const o = this.selectedCountryData.iso2, a = this.selectedCountryData.dialCode;
|
|
2163
2170
|
s = this._ensureHasDialCode(s);
|
|
2164
2171
|
const c = this._getDialCode(s, !0), g = c1(s);
|
|
2165
2172
|
if (c) {
|
|
2166
|
-
const f = c1(c),
|
|
2167
|
-
if (!o && this.defaultCountry &&
|
|
2173
|
+
const f = c1(c), v = this.dialCodeToIso2Map[f];
|
|
2174
|
+
if (!o && this.defaultCountry && v.includes(this.defaultCountry))
|
|
2168
2175
|
return this.defaultCountry;
|
|
2169
|
-
const
|
|
2170
|
-
if (!(a === "1" &&
|
|
2171
|
-
for (let
|
|
2172
|
-
if (
|
|
2173
|
-
return
|
|
2176
|
+
const b = this.selectedCountryData.areaCodes && g.length > f.length, S = o && v.includes(o) && !b;
|
|
2177
|
+
if (!(a === "1" && o2(g)) && !S) {
|
|
2178
|
+
for (let C = 0; C < v.length; C++)
|
|
2179
|
+
if (v[C])
|
|
2180
|
+
return v[C];
|
|
2174
2181
|
}
|
|
2175
2182
|
} else {
|
|
2176
2183
|
if (s.charAt(0) === "+" && g.length)
|
|
@@ -2181,34 +2188,34 @@ class j2 {
|
|
|
2181
2188
|
return null;
|
|
2182
2189
|
}
|
|
2183
2190
|
//* Remove highlighting from other list items and highlight the given item.
|
|
2184
|
-
_highlightListItem(e,
|
|
2191
|
+
_highlightListItem(e, i) {
|
|
2185
2192
|
const s = this.highlightedItem;
|
|
2186
2193
|
if (s && (s.classList.remove("iti__highlight"), s.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem) {
|
|
2187
2194
|
this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true");
|
|
2188
2195
|
const o = this.highlightedItem.getAttribute("id") || "";
|
|
2189
2196
|
this.selectedCountry.setAttribute("aria-activedescendant", o), this.options.countrySearch && this.searchInput.setAttribute("aria-activedescendant", o);
|
|
2190
2197
|
}
|
|
2191
|
-
|
|
2198
|
+
i && this.highlightedItem.focus();
|
|
2192
2199
|
}
|
|
2193
2200
|
//* Find the country data for the given iso2 code
|
|
2194
2201
|
//* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
|
|
2195
|
-
_getCountryData(e,
|
|
2202
|
+
_getCountryData(e, i) {
|
|
2196
2203
|
for (let s = 0; s < this.countries.length; s++)
|
|
2197
2204
|
if (this.countries[s].iso2 === e)
|
|
2198
2205
|
return this.countries[s];
|
|
2199
|
-
if (
|
|
2206
|
+
if (i)
|
|
2200
2207
|
return null;
|
|
2201
2208
|
throw new Error(`No country data for '${e}'`);
|
|
2202
2209
|
}
|
|
2203
2210
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
|
|
2204
2211
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
2205
2212
|
_setCountry(e) {
|
|
2206
|
-
const { separateDialCode:
|
|
2213
|
+
const { separateDialCode: i, showFlags: s, i18n: o } = this.options, a = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
2207
2214
|
if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountryInner) {
|
|
2208
2215
|
let c = "", g = "";
|
|
2209
2216
|
e && s ? (c = `iti__flag iti__${e}`, g = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", g = o.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = g;
|
|
2210
2217
|
}
|
|
2211
|
-
if (this._setSelectedCountryTitleAttribute(e,
|
|
2218
|
+
if (this._setSelectedCountryTitleAttribute(e, i), i) {
|
|
2212
2219
|
const c = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2213
2220
|
this.selectedDialCode.innerHTML = c, this._updateInputPadding();
|
|
2214
2221
|
}
|
|
@@ -2217,34 +2224,34 @@ class j2 {
|
|
|
2217
2224
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2218
2225
|
_updateInputPadding() {
|
|
2219
2226
|
if (this.selectedCountry) {
|
|
2220
|
-
const
|
|
2221
|
-
this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${
|
|
2227
|
+
const i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth()) + 6;
|
|
2228
|
+
this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${i}px` : this.telInput.style.paddingRight = `${i}px`;
|
|
2222
2229
|
}
|
|
2223
2230
|
}
|
|
2224
2231
|
//* Update the maximum valid number length for the currently selected country.
|
|
2225
2232
|
_updateMaxLength() {
|
|
2226
|
-
const { strictMode: e, placeholderNumberType:
|
|
2227
|
-
if (e &&
|
|
2233
|
+
const { strictMode: e, placeholderNumberType: i, validationNumberTypes: s } = this.options, { iso2: o } = this.selectedCountryData;
|
|
2234
|
+
if (e && y.utils)
|
|
2228
2235
|
if (o) {
|
|
2229
|
-
const a =
|
|
2230
|
-
let c =
|
|
2236
|
+
const a = y.utils.numberType[i];
|
|
2237
|
+
let c = y.utils.getExampleNumber(
|
|
2231
2238
|
o,
|
|
2232
2239
|
!1,
|
|
2233
2240
|
a,
|
|
2234
2241
|
!0
|
|
2235
2242
|
), g = c;
|
|
2236
|
-
for (;
|
|
2243
|
+
for (; y.utils.isPossibleNumber(c, o, s); )
|
|
2237
2244
|
g = c, c += "0";
|
|
2238
|
-
const f =
|
|
2245
|
+
const f = y.utils.getCoreNumber(g, o);
|
|
2239
2246
|
this.maxCoreNumberLength = f.length, o === "by" && (this.maxCoreNumberLength = f.length + 1);
|
|
2240
2247
|
} else
|
|
2241
2248
|
this.maxCoreNumberLength = null;
|
|
2242
2249
|
}
|
|
2243
|
-
_setSelectedCountryTitleAttribute(e = null,
|
|
2250
|
+
_setSelectedCountryTitleAttribute(e = null, i) {
|
|
2244
2251
|
if (!this.selectedCountry)
|
|
2245
2252
|
return;
|
|
2246
2253
|
let s;
|
|
2247
|
-
e && !
|
|
2254
|
+
e && !i ? s = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? s = this.selectedCountryData.name : s = "Unknown", this.selectedCountry.setAttribute("title", s);
|
|
2248
2255
|
}
|
|
2249
2256
|
//* When the input is in a hidden container during initialisation, we must inject some markup
|
|
2250
2257
|
//* into the end of the DOM to calculate the correct offsetWidth.
|
|
@@ -2254,10 +2261,10 @@ class j2 {
|
|
|
2254
2261
|
if (this.telInput.parentNode) {
|
|
2255
2262
|
const e = this.telInput.parentNode.cloneNode(!1);
|
|
2256
2263
|
e.style.visibility = "hidden", document.body.appendChild(e);
|
|
2257
|
-
const
|
|
2258
|
-
e.appendChild(
|
|
2264
|
+
const i = this.countryContainer.cloneNode();
|
|
2265
|
+
e.appendChild(i);
|
|
2259
2266
|
const s = this.selectedCountry.cloneNode(!0);
|
|
2260
|
-
|
|
2267
|
+
i.appendChild(s);
|
|
2261
2268
|
const o = s.offsetWidth;
|
|
2262
2269
|
return document.body.removeChild(e), o;
|
|
2263
2270
|
}
|
|
@@ -2267,13 +2274,13 @@ class j2 {
|
|
|
2267
2274
|
_updatePlaceholder() {
|
|
2268
2275
|
const {
|
|
2269
2276
|
autoPlaceholder: e,
|
|
2270
|
-
placeholderNumberType:
|
|
2277
|
+
placeholderNumberType: i,
|
|
2271
2278
|
nationalMode: s,
|
|
2272
2279
|
customPlaceholder: o
|
|
2273
2280
|
} = this.options, a = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
|
|
2274
|
-
if (
|
|
2275
|
-
const c =
|
|
2276
|
-
let g = this.selectedCountryData.iso2 ?
|
|
2281
|
+
if (y.utils && a) {
|
|
2282
|
+
const c = y.utils.numberType[i];
|
|
2283
|
+
let g = this.selectedCountryData.iso2 ? y.utils.getExampleNumber(
|
|
2277
2284
|
this.selectedCountryData.iso2,
|
|
2278
2285
|
s,
|
|
2279
2286
|
c
|
|
@@ -2283,10 +2290,10 @@ class j2 {
|
|
|
2283
2290
|
}
|
|
2284
2291
|
//* Called when the user selects a list item from the dropdown.
|
|
2285
2292
|
_selectListItem(e) {
|
|
2286
|
-
const
|
|
2293
|
+
const i = this._setCountry(
|
|
2287
2294
|
e.getAttribute("data-country-code")
|
|
2288
2295
|
);
|
|
2289
|
-
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(),
|
|
2296
|
+
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), i && this._triggerCountryChange();
|
|
2290
2297
|
}
|
|
2291
2298
|
//* Close the dropdown and unbind any listeners.
|
|
2292
2299
|
_closeDropdown() {
|
|
@@ -2300,34 +2307,34 @@ class j2 {
|
|
|
2300
2307
|
}
|
|
2301
2308
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2302
2309
|
_scrollTo(e) {
|
|
2303
|
-
const
|
|
2310
|
+
const i = this.countryList, s = document.documentElement.scrollTop, o = i.offsetHeight, a = i.getBoundingClientRect().top + s, c = a + o, g = e.offsetHeight, f = e.getBoundingClientRect().top + s, v = f + g, b = f - a + i.scrollTop;
|
|
2304
2311
|
if (f < a)
|
|
2305
|
-
|
|
2306
|
-
else if (
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2312
|
+
i.scrollTop = b;
|
|
2313
|
+
else if (v > c) {
|
|
2314
|
+
const S = o - g;
|
|
2315
|
+
i.scrollTop = b - S;
|
|
2309
2316
|
}
|
|
2310
2317
|
}
|
|
2311
2318
|
//* Replace any existing dial code with the new one
|
|
2312
2319
|
//* Note: called from _selectListItem and setCountry
|
|
2313
2320
|
_updateDialCode(e) {
|
|
2314
|
-
const
|
|
2321
|
+
const i = this.telInput.value, s = `+${e}`;
|
|
2315
2322
|
let o;
|
|
2316
|
-
if (
|
|
2317
|
-
const a = this._getDialCode(
|
|
2318
|
-
a ? o =
|
|
2323
|
+
if (i.charAt(0) === "+") {
|
|
2324
|
+
const a = this._getDialCode(i);
|
|
2325
|
+
a ? o = i.replace(a, s) : o = s, this.telInput.value = o;
|
|
2319
2326
|
}
|
|
2320
2327
|
}
|
|
2321
2328
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
2322
2329
|
//* Note: returns the raw string inc plus character and any whitespace/dots etc.
|
|
2323
|
-
_getDialCode(e,
|
|
2330
|
+
_getDialCode(e, i) {
|
|
2324
2331
|
let s = "";
|
|
2325
2332
|
if (e.charAt(0) === "+") {
|
|
2326
2333
|
let o = "";
|
|
2327
2334
|
for (let a = 0; a < e.length; a++) {
|
|
2328
2335
|
const c = e.charAt(a);
|
|
2329
2336
|
if (!isNaN(parseInt(c, 10))) {
|
|
2330
|
-
if (o += c,
|
|
2337
|
+
if (o += c, i)
|
|
2331
2338
|
this.dialCodeToIso2Map[o] && (s = e.substr(0, a + 1));
|
|
2332
2339
|
else if (this.dialCodes[o]) {
|
|
2333
2340
|
s = e.substr(0, a + 1);
|
|
@@ -2342,23 +2349,23 @@ class j2 {
|
|
|
2342
2349
|
}
|
|
2343
2350
|
//* Get the input val, adding the dial code if separateDialCode is enabled.
|
|
2344
2351
|
_getFullNumber(e) {
|
|
2345
|
-
const
|
|
2352
|
+
const i = e || this.telInput.value.trim(), { dialCode: s } = this.selectedCountryData;
|
|
2346
2353
|
let o;
|
|
2347
|
-
const a = c1(
|
|
2348
|
-
return this.options.separateDialCode &&
|
|
2354
|
+
const a = c1(i);
|
|
2355
|
+
return this.options.separateDialCode && i.charAt(0) !== "+" && s && a ? o = `+${s}` : o = "", o + i;
|
|
2349
2356
|
}
|
|
2350
2357
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2351
2358
|
_beforeSetNumber(e) {
|
|
2352
|
-
let
|
|
2359
|
+
let i = e;
|
|
2353
2360
|
if (this.options.separateDialCode) {
|
|
2354
|
-
let s = this._getDialCode(
|
|
2361
|
+
let s = this._getDialCode(i);
|
|
2355
2362
|
if (s) {
|
|
2356
2363
|
s = `+${this.selectedCountryData.dialCode}`;
|
|
2357
|
-
const o =
|
|
2358
|
-
|
|
2364
|
+
const o = i[s.length] === " " || i[s.length] === "-" ? s.length + 1 : s.length;
|
|
2365
|
+
i = i.substr(o);
|
|
2359
2366
|
}
|
|
2360
2367
|
}
|
|
2361
|
-
return this._cap(
|
|
2368
|
+
return this._cap(i);
|
|
2362
2369
|
}
|
|
2363
2370
|
//* Trigger the 'countrychange' event.
|
|
2364
2371
|
_triggerCountryChange() {
|
|
@@ -2366,19 +2373,19 @@ class j2 {
|
|
|
2366
2373
|
}
|
|
2367
2374
|
//* Format the number as the user types.
|
|
2368
2375
|
_formatNumberAsYouType() {
|
|
2369
|
-
const e = this._getFullNumber(),
|
|
2370
|
-
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" &&
|
|
2376
|
+
const e = this._getFullNumber(), i = y.utils ? y.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: s } = this.selectedCountryData;
|
|
2377
|
+
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${s}`) ? (i.split(`+${s}`)[1] || "").trim() : i;
|
|
2371
2378
|
}
|
|
2372
2379
|
//**************************
|
|
2373
2380
|
//* SECRET PUBLIC METHODS
|
|
2374
2381
|
//**************************
|
|
2375
2382
|
//* This is called when the geoip call returns.
|
|
2376
2383
|
handleAutoCountry() {
|
|
2377
|
-
this.options.initialCountry === "auto" &&
|
|
2384
|
+
this.options.initialCountry === "auto" && y.autoCountry && (this.defaultCountry = y.autoCountry, this.selectedCountryData.iso2 || this.selectedCountryInner.classList.contains("iti__globe") || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
|
|
2378
2385
|
}
|
|
2379
2386
|
//* This is called when the utils request completes.
|
|
2380
2387
|
handleUtils() {
|
|
2381
|
-
|
|
2388
|
+
y.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2382
2389
|
}
|
|
2383
2390
|
//********************
|
|
2384
2391
|
//* PUBLIC METHODS
|
|
@@ -2387,7 +2394,7 @@ class j2 {
|
|
|
2387
2394
|
destroy() {
|
|
2388
2395
|
var a, c;
|
|
2389
2396
|
this.telInput.iti = void 0;
|
|
2390
|
-
const { allowDropdown: e, separateDialCode:
|
|
2397
|
+
const { allowDropdown: e, separateDialCode: i } = this.options;
|
|
2391
2398
|
if (e) {
|
|
2392
2399
|
this._closeDropdown(), this.selectedCountry.removeEventListener(
|
|
2393
2400
|
"click",
|
|
@@ -2400,24 +2407,24 @@ class j2 {
|
|
|
2400
2407
|
g && g.removeEventListener("click", this._handleLabelClick);
|
|
2401
2408
|
}
|
|
2402
2409
|
const { form: s } = this.telInput;
|
|
2403
|
-
this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"),
|
|
2410
|
+
this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2404
2411
|
const o = this.telInput.parentNode;
|
|
2405
|
-
(a = o == null ? void 0 : o.parentNode) == null || a.insertBefore(this.telInput, o), (c = o == null ? void 0 : o.parentNode) == null || c.removeChild(o), delete
|
|
2412
|
+
(a = o == null ? void 0 : o.parentNode) == null || a.insertBefore(this.telInput, o), (c = o == null ? void 0 : o.parentNode) == null || c.removeChild(o), delete y.instances[this.id];
|
|
2406
2413
|
}
|
|
2407
2414
|
//* Get the extension from the current number.
|
|
2408
2415
|
getExtension() {
|
|
2409
|
-
return
|
|
2416
|
+
return y.utils ? y.utils.getExtension(
|
|
2410
2417
|
this._getFullNumber(),
|
|
2411
2418
|
this.selectedCountryData.iso2
|
|
2412
2419
|
) : "";
|
|
2413
2420
|
}
|
|
2414
2421
|
//* Format the number to the given format.
|
|
2415
2422
|
getNumber(e) {
|
|
2416
|
-
if (
|
|
2417
|
-
const { iso2:
|
|
2418
|
-
return
|
|
2423
|
+
if (y.utils) {
|
|
2424
|
+
const { iso2: i } = this.selectedCountryData;
|
|
2425
|
+
return y.utils.formatNumber(
|
|
2419
2426
|
this._getFullNumber(),
|
|
2420
|
-
|
|
2427
|
+
i,
|
|
2421
2428
|
e
|
|
2422
2429
|
);
|
|
2423
2430
|
}
|
|
@@ -2425,7 +2432,7 @@ class j2 {
|
|
|
2425
2432
|
}
|
|
2426
2433
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
2427
2434
|
getNumberType() {
|
|
2428
|
-
return
|
|
2435
|
+
return y.utils ? y.utils.getNumberType(
|
|
2429
2436
|
this._getFullNumber(),
|
|
2430
2437
|
this.selectedCountryData.iso2
|
|
2431
2438
|
) : -99;
|
|
@@ -2436,9 +2443,9 @@ class j2 {
|
|
|
2436
2443
|
}
|
|
2437
2444
|
//* Get the validation error.
|
|
2438
2445
|
getValidationError() {
|
|
2439
|
-
if (
|
|
2446
|
+
if (y.utils) {
|
|
2440
2447
|
const { iso2: e } = this.selectedCountryData;
|
|
2441
|
-
return
|
|
2448
|
+
return y.utils.getValidationError(this._getFullNumber(), e);
|
|
2442
2449
|
}
|
|
2443
2450
|
return -99;
|
|
2444
2451
|
}
|
|
@@ -2446,39 +2453,39 @@ class j2 {
|
|
|
2446
2453
|
isValidNumber() {
|
|
2447
2454
|
if (!this.selectedCountryData.iso2)
|
|
2448
2455
|
return !1;
|
|
2449
|
-
const e = this._getFullNumber(),
|
|
2450
|
-
if (
|
|
2451
|
-
const s = e.substring(0,
|
|
2456
|
+
const e = this._getFullNumber(), i = e.search(new RegExp("\\p{L}", "u"));
|
|
2457
|
+
if (i > -1) {
|
|
2458
|
+
const s = e.substring(0, i), o = this._utilsIsPossibleNumber(s), a = this._utilsIsPossibleNumber(e);
|
|
2452
2459
|
return o && a;
|
|
2453
2460
|
}
|
|
2454
2461
|
return this._utilsIsPossibleNumber(e);
|
|
2455
2462
|
}
|
|
2456
2463
|
_utilsIsPossibleNumber(e) {
|
|
2457
|
-
return
|
|
2464
|
+
return y.utils ? y.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2458
2465
|
}
|
|
2459
2466
|
//* Validate the input val (precise)
|
|
2460
2467
|
isValidNumberPrecise() {
|
|
2461
2468
|
if (!this.selectedCountryData.iso2)
|
|
2462
2469
|
return !1;
|
|
2463
|
-
const e = this._getFullNumber(),
|
|
2464
|
-
if (
|
|
2465
|
-
const s = e.substring(0,
|
|
2470
|
+
const e = this._getFullNumber(), i = e.search(new RegExp("\\p{L}", "u"));
|
|
2471
|
+
if (i > -1) {
|
|
2472
|
+
const s = e.substring(0, i), o = this._utilsIsValidNumber(s), a = this._utilsIsValidNumber(e);
|
|
2466
2473
|
return o && a;
|
|
2467
2474
|
}
|
|
2468
2475
|
return this._utilsIsValidNumber(e);
|
|
2469
2476
|
}
|
|
2470
2477
|
_utilsIsValidNumber(e) {
|
|
2471
|
-
return
|
|
2478
|
+
return y.utils ? y.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2472
2479
|
}
|
|
2473
2480
|
//* Update the selected country, and update the input val accordingly.
|
|
2474
2481
|
setCountry(e) {
|
|
2475
|
-
const
|
|
2476
|
-
(e &&
|
|
2482
|
+
const i = e == null ? void 0 : e.toLowerCase(), s = this.selectedCountryData.iso2;
|
|
2483
|
+
(e && i !== s || !e && s) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
|
|
2477
2484
|
}
|
|
2478
2485
|
//* Set the input value and update the country.
|
|
2479
2486
|
setNumber(e) {
|
|
2480
|
-
const
|
|
2481
|
-
this._updateValFromNumber(e),
|
|
2487
|
+
const i = this._updateCountryFromNumber(e);
|
|
2488
|
+
this._updateValFromNumber(e), i && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
|
|
2482
2489
|
}
|
|
2483
2490
|
//* Set the placeholder number typ
|
|
2484
2491
|
setPlaceholderNumberType(e) {
|
|
@@ -2488,71 +2495,71 @@ class j2 {
|
|
|
2488
2495
|
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2489
2496
|
}
|
|
2490
2497
|
}
|
|
2491
|
-
const W2 = (
|
|
2492
|
-
if (!
|
|
2498
|
+
const W2 = (I) => {
|
|
2499
|
+
if (!y.utils && !y.startedLoadingUtilsScript) {
|
|
2493
2500
|
let e;
|
|
2494
|
-
if (typeof
|
|
2501
|
+
if (typeof I == "function")
|
|
2495
2502
|
try {
|
|
2496
|
-
e = Promise.resolve(
|
|
2497
|
-
} catch (
|
|
2498
|
-
return Promise.reject(
|
|
2503
|
+
e = Promise.resolve(I());
|
|
2504
|
+
} catch (i) {
|
|
2505
|
+
return Promise.reject(i);
|
|
2499
2506
|
}
|
|
2500
2507
|
else
|
|
2501
|
-
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
2502
|
-
return
|
|
2503
|
-
const s =
|
|
2508
|
+
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof I}`));
|
|
2509
|
+
return y.startedLoadingUtilsScript = !0, e.then((i) => {
|
|
2510
|
+
const s = i == null ? void 0 : i.default;
|
|
2504
2511
|
if (!s || typeof s != "object")
|
|
2505
2512
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2506
|
-
return
|
|
2507
|
-
}).catch((
|
|
2508
|
-
throw $1("rejectUtilsScriptPromise",
|
|
2513
|
+
return y.utils = s, $1("handleUtils"), !0;
|
|
2514
|
+
}).catch((i) => {
|
|
2515
|
+
throw $1("rejectUtilsScriptPromise", i), i;
|
|
2509
2516
|
});
|
|
2510
2517
|
}
|
|
2511
2518
|
return null;
|
|
2512
|
-
},
|
|
2513
|
-
(
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2519
|
+
}, y = Object.assign(
|
|
2520
|
+
(I, e) => {
|
|
2521
|
+
const i = new j2(I, e);
|
|
2522
|
+
return i._init(), I.setAttribute("data-intl-tel-input-id", i.id.toString()), y.instances[i.id] = i, I.iti = i, i;
|
|
2516
2523
|
},
|
|
2517
2524
|
{
|
|
2518
|
-
defaults:
|
|
2525
|
+
defaults: l2,
|
|
2519
2526
|
//* Using a static var like this allows us to mock it in the tests.
|
|
2520
2527
|
documentReady: () => document.readyState === "complete",
|
|
2521
2528
|
//* Get the country data object.
|
|
2522
2529
|
getCountryData: () => W,
|
|
2523
2530
|
//* A getter for the plugin instance.
|
|
2524
|
-
getInstance: (
|
|
2525
|
-
const e =
|
|
2526
|
-
return e ?
|
|
2531
|
+
getInstance: (I) => {
|
|
2532
|
+
const e = I.getAttribute("data-intl-tel-input-id");
|
|
2533
|
+
return e ? y.instances[e] : null;
|
|
2527
2534
|
},
|
|
2528
2535
|
//* A map from instance ID to instance object.
|
|
2529
2536
|
instances: {},
|
|
2530
2537
|
attachUtils: W2,
|
|
2531
2538
|
startedLoadingUtilsScript: !1,
|
|
2532
2539
|
startedLoadingAutoCountry: !1,
|
|
2533
|
-
version: "25.
|
|
2540
|
+
version: "25.5.0"
|
|
2534
2541
|
}
|
|
2535
2542
|
);
|
|
2536
2543
|
(function() {
|
|
2537
|
-
var
|
|
2544
|
+
var I = this || self;
|
|
2538
2545
|
function e(d, t) {
|
|
2539
2546
|
d = d.split(".");
|
|
2540
|
-
var $ =
|
|
2547
|
+
var $ = I;
|
|
2541
2548
|
d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
|
|
2542
|
-
for (var
|
|
2549
|
+
for (var n; d.length && (n = d.shift()); ) d.length || t === void 0 ? $[n] && $[n] !== Object.prototype[n] ? $ = $[n] : $ = $[n] = {} : $[n] = t;
|
|
2543
2550
|
}
|
|
2544
|
-
function
|
|
2551
|
+
function i(d, t) {
|
|
2545
2552
|
function $() {
|
|
2546
2553
|
}
|
|
2547
|
-
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(
|
|
2554
|
+
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(n, r, u) {
|
|
2548
2555
|
for (var l = Array(arguments.length - 2), h = 2; h < arguments.length; h++) l[h - 2] = arguments[h];
|
|
2549
|
-
return t.prototype[r].apply(
|
|
2556
|
+
return t.prototype[r].apply(n, l);
|
|
2550
2557
|
};
|
|
2551
2558
|
}
|
|
2552
2559
|
function s(d) {
|
|
2553
2560
|
const t = [];
|
|
2554
2561
|
let $ = 0;
|
|
2555
|
-
for (const
|
|
2562
|
+
for (const n in d) t[$++] = d[n];
|
|
2556
2563
|
return t;
|
|
2557
2564
|
}
|
|
2558
2565
|
var o = class {
|
|
@@ -2576,7 +2583,7 @@ const W2 = (y) => {
|
|
|
2576
2583
|
}
|
|
2577
2584
|
new g();
|
|
2578
2585
|
const f = {};
|
|
2579
|
-
class
|
|
2586
|
+
class v {
|
|
2580
2587
|
constructor() {
|
|
2581
2588
|
if (f !== f) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2582
2589
|
}
|
|
@@ -2584,34 +2591,34 @@ const W2 = (y) => {
|
|
|
2584
2591
|
return "";
|
|
2585
2592
|
}
|
|
2586
2593
|
}
|
|
2587
|
-
new
|
|
2588
|
-
const
|
|
2589
|
-
class
|
|
2594
|
+
new v();
|
|
2595
|
+
const b = {};
|
|
2596
|
+
class S {
|
|
2590
2597
|
constructor() {
|
|
2591
|
-
var t =
|
|
2592
|
-
if (
|
|
2598
|
+
var t = I.trustedTypes && I.trustedTypes.emptyHTML || "";
|
|
2599
|
+
if (b !== b) throw Error("SafeHtml is not meant to be built directly");
|
|
2593
2600
|
this.g = t;
|
|
2594
2601
|
}
|
|
2595
2602
|
toString() {
|
|
2596
2603
|
return this.g.toString();
|
|
2597
2604
|
}
|
|
2598
2605
|
}
|
|
2599
|
-
new
|
|
2600
|
-
function
|
|
2606
|
+
new S();
|
|
2607
|
+
function L(d, t) {
|
|
2601
2608
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2609
|
+
case x:
|
|
2610
|
+
case O:
|
|
2611
|
+
case T:
|
|
2602
2612
|
case G:
|
|
2603
|
-
case F:
|
|
2604
|
-
case M:
|
|
2605
|
-
case P:
|
|
2606
2613
|
case f1:
|
|
2607
|
-
case
|
|
2608
|
-
case
|
|
2614
|
+
case m:
|
|
2615
|
+
case C:
|
|
2609
2616
|
this.o = !0;
|
|
2610
2617
|
}
|
|
2611
2618
|
this.j = t.defaultValue;
|
|
2612
2619
|
}
|
|
2613
|
-
var
|
|
2614
|
-
function
|
|
2620
|
+
var C = 1, m = 2, x = 3, O = 4, T = 6, G = 16, f1 = 18;
|
|
2621
|
+
function h2(d, t) {
|
|
2615
2622
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2616
2623
|
var $ = t[d];
|
|
2617
2624
|
this.g[$.g] = $;
|
|
@@ -2630,40 +2637,40 @@ const W2 = (y) => {
|
|
|
2630
2637
|
}, R.prototype.get = function(d, t) {
|
|
2631
2638
|
return p(this, d.g, t);
|
|
2632
2639
|
}, R.prototype.set = function(d, t) {
|
|
2633
|
-
|
|
2640
|
+
M(this, d.g, t);
|
|
2634
2641
|
}, R.prototype.add = function(d, t) {
|
|
2635
|
-
|
|
2642
|
+
S1(this, d.g, t);
|
|
2636
2643
|
};
|
|
2637
|
-
function
|
|
2638
|
-
for (var $ = c2(d.m()),
|
|
2639
|
-
var r = $[
|
|
2644
|
+
function v1(d, t) {
|
|
2645
|
+
for (var $ = c2(d.m()), n = 0; n < $.length; n++) {
|
|
2646
|
+
var r = $[n], u = r.g;
|
|
2640
2647
|
if (B(t, u)) {
|
|
2641
2648
|
d.g && delete d.g[r.g];
|
|
2642
2649
|
var l = r.h == 11 || r.h == 10;
|
|
2643
2650
|
if (r.l) {
|
|
2644
|
-
r =
|
|
2645
|
-
for (var h = 0; h < r.length; h++)
|
|
2646
|
-
} else r =
|
|
2651
|
+
r = P(t, u);
|
|
2652
|
+
for (var h = 0; h < r.length; h++) S1(d, u, l ? r[h].clone() : r[h]);
|
|
2653
|
+
} else r = i1(t, u), l ? (l = i1(d, u)) ? v1(l, r) : M(d, u, r.clone()) : M(d, u, r);
|
|
2647
2654
|
}
|
|
2648
2655
|
}
|
|
2649
2656
|
}
|
|
2650
2657
|
R.prototype.clone = function() {
|
|
2651
2658
|
var d = new this.constructor();
|
|
2652
|
-
return d != this && (d.h = {}, d.g && (d.g = {}),
|
|
2659
|
+
return d != this && (d.h = {}, d.g && (d.g = {}), v1(d, this)), d;
|
|
2653
2660
|
};
|
|
2654
2661
|
function B(d, t) {
|
|
2655
2662
|
return d.h[t] != null;
|
|
2656
2663
|
}
|
|
2657
|
-
function
|
|
2664
|
+
function i1(d, t) {
|
|
2658
2665
|
var $ = d.h[t];
|
|
2659
2666
|
if ($ == null) return null;
|
|
2660
2667
|
if (d.l) {
|
|
2661
2668
|
if (!(t in d.g)) {
|
|
2662
|
-
var
|
|
2669
|
+
var n = d.l, r = d.j[t];
|
|
2663
2670
|
if ($ != null) if (r.l) {
|
|
2664
|
-
for (var u = [], l = 0; l < $.length; l++) u[l] =
|
|
2671
|
+
for (var u = [], l = 0; l < $.length; l++) u[l] = n.h(r, $[l]);
|
|
2665
2672
|
$ = u;
|
|
2666
|
-
} else $ =
|
|
2673
|
+
} else $ = n.h(r, $);
|
|
2667
2674
|
return d.g[t] = $;
|
|
2668
2675
|
}
|
|
2669
2676
|
return d.g[t];
|
|
@@ -2671,10 +2678,10 @@ const W2 = (y) => {
|
|
|
2671
2678
|
return $;
|
|
2672
2679
|
}
|
|
2673
2680
|
function p(d, t, $) {
|
|
2674
|
-
var
|
|
2675
|
-
return d.j[t].l ?
|
|
2681
|
+
var n = i1(d, t);
|
|
2682
|
+
return d.j[t].l ? n[$ || 0] : n;
|
|
2676
2683
|
}
|
|
2677
|
-
function
|
|
2684
|
+
function w(d, t) {
|
|
2678
2685
|
if (B(d, t)) d = p(d, t);
|
|
2679
2686
|
else d: {
|
|
2680
2687
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
@@ -2688,22 +2695,22 @@ const W2 = (y) => {
|
|
|
2688
2695
|
}
|
|
2689
2696
|
return d;
|
|
2690
2697
|
}
|
|
2691
|
-
function
|
|
2692
|
-
return
|
|
2698
|
+
function P(d, t) {
|
|
2699
|
+
return i1(d, t) || [];
|
|
2693
2700
|
}
|
|
2694
2701
|
function K(d, t) {
|
|
2695
2702
|
return d.j[t].l ? B(d, t) ? d.h[t].length : 0 : B(d, t) ? 1 : 0;
|
|
2696
2703
|
}
|
|
2697
|
-
function
|
|
2704
|
+
function M(d, t, $) {
|
|
2698
2705
|
d.h[t] = $, d.g && (d.g[t] = $);
|
|
2699
2706
|
}
|
|
2700
|
-
function
|
|
2707
|
+
function S1(d, t, $) {
|
|
2701
2708
|
d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
|
|
2702
2709
|
}
|
|
2703
|
-
function
|
|
2704
|
-
var $ = [],
|
|
2705
|
-
for (
|
|
2706
|
-
return new
|
|
2710
|
+
function n1(d, t) {
|
|
2711
|
+
var $ = [], n;
|
|
2712
|
+
for (n in t) n != 0 && $.push(new L(n, t[n]));
|
|
2713
|
+
return new h2(d, $);
|
|
2707
2714
|
}
|
|
2708
2715
|
function s1() {
|
|
2709
2716
|
}
|
|
@@ -2711,83 +2718,83 @@ const W2 = (y) => {
|
|
|
2711
2718
|
throw new d.h(), Error("Unimplemented");
|
|
2712
2719
|
}, s1.prototype.h = function(d, t) {
|
|
2713
2720
|
if (d.h == 11 || d.h == 10) return t instanceof R ? t : this.g(d.s.prototype.m(), t);
|
|
2714
|
-
if (d.h == 14) return typeof t == "string" &&
|
|
2721
|
+
if (d.h == 14) return typeof t == "string" && w1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
2715
2722
|
if (!d.o) return t;
|
|
2716
2723
|
if (d = d.s, d === String) {
|
|
2717
2724
|
if (typeof t == "number") return String(t);
|
|
2718
|
-
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" ||
|
|
2725
|
+
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || w1.test(t))) return Number(t);
|
|
2719
2726
|
return t;
|
|
2720
2727
|
};
|
|
2721
|
-
var
|
|
2728
|
+
var w1 = /^-?[0-9]+$/;
|
|
2722
2729
|
function p1() {
|
|
2723
2730
|
}
|
|
2724
|
-
|
|
2731
|
+
i(p1, s1), p1.prototype.g = function(d, t) {
|
|
2725
2732
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
2726
2733
|
};
|
|
2727
2734
|
function q() {
|
|
2728
2735
|
}
|
|
2729
|
-
|
|
2736
|
+
i(q, p1), q.prototype.h = function(d, t) {
|
|
2730
2737
|
return d.h == 8 ? !!t : s1.prototype.h.apply(this, arguments);
|
|
2731
2738
|
}, q.prototype.g = function(d, t) {
|
|
2732
2739
|
return q.ma.g.call(this, d, t);
|
|
2733
2740
|
};
|
|
2734
|
-
function
|
|
2741
|
+
function A(d, t) {
|
|
2735
2742
|
d != null && this.g.apply(this, arguments);
|
|
2736
2743
|
}
|
|
2737
|
-
|
|
2744
|
+
A.prototype.h = "", A.prototype.set = function(d) {
|
|
2738
2745
|
this.h = "" + d;
|
|
2739
|
-
},
|
|
2740
|
-
if (this.h += String(d), t != null) for (let
|
|
2746
|
+
}, A.prototype.g = function(d, t, $) {
|
|
2747
|
+
if (this.h += String(d), t != null) for (let n = 1; n < arguments.length; n++) this.h += arguments[n];
|
|
2741
2748
|
return this;
|
|
2742
2749
|
};
|
|
2743
2750
|
function k(d) {
|
|
2744
2751
|
d.h = "";
|
|
2745
2752
|
}
|
|
2746
|
-
|
|
2753
|
+
A.prototype.toString = function() {
|
|
2747
2754
|
return this.h;
|
|
2748
2755
|
};
|
|
2749
2756
|
function z() {
|
|
2750
2757
|
R.call(this);
|
|
2751
2758
|
}
|
|
2752
|
-
|
|
2753
|
-
var
|
|
2754
|
-
function
|
|
2759
|
+
i(z, R);
|
|
2760
|
+
var b1 = null;
|
|
2761
|
+
function N() {
|
|
2755
2762
|
R.call(this);
|
|
2756
2763
|
}
|
|
2757
|
-
|
|
2758
|
-
var
|
|
2764
|
+
i(N, R);
|
|
2765
|
+
var L1 = null;
|
|
2759
2766
|
function Z() {
|
|
2760
2767
|
R.call(this);
|
|
2761
2768
|
}
|
|
2762
|
-
|
|
2763
|
-
var
|
|
2769
|
+
i(Z, R);
|
|
2770
|
+
var N1 = null;
|
|
2764
2771
|
z.prototype.m = function() {
|
|
2772
|
+
var d = b1;
|
|
2773
|
+
return d || (b1 = d = n1(z, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
|
|
2774
|
+
}, z.m = z.prototype.m, N.prototype.m = function() {
|
|
2765
2775
|
var d = L1;
|
|
2766
|
-
return d || (L1 = d =
|
|
2767
|
-
},
|
|
2776
|
+
return d || (L1 = d = n1(N, { 0: { name: "PhoneNumberDesc", ia: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", aa: !0, i: 5, type: Number }, 10: { name: "possible_length_local_only", aa: !0, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } })), d;
|
|
2777
|
+
}, N.m = N.prototype.m, Z.prototype.m = function() {
|
|
2768
2778
|
var d = N1;
|
|
2769
|
-
return d || (N1 = d =
|
|
2770
|
-
}, L.m = L.prototype.m, Z.prototype.m = function() {
|
|
2771
|
-
var d = T1;
|
|
2772
|
-
return d || (T1 = d = i1(Z, {
|
|
2779
|
+
return d || (N1 = d = n1(Z, {
|
|
2773
2780
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2774
|
-
1: { name: "general_desc", i: 11, type:
|
|
2775
|
-
2: { name: "fixed_line", i: 11, type:
|
|
2776
|
-
3: { name: "mobile", i: 11, type:
|
|
2777
|
-
4: { name: "toll_free", i: 11, type:
|
|
2778
|
-
5: { name: "premium_rate", i: 11, type:
|
|
2779
|
-
6: { name: "shared_cost", i: 11, type:
|
|
2780
|
-
7: { name: "personal_number", i: 11, type:
|
|
2781
|
-
8: { name: "voip", i: 11, type:
|
|
2782
|
-
21: { name: "pager", i: 11, type:
|
|
2783
|
-
25: { name: "uan", i: 11, type:
|
|
2784
|
-
27: { name: "emergency", i: 11, type:
|
|
2785
|
-
28: { name: "voicemail", i: 11, type:
|
|
2786
|
-
29: { name: "short_code", i: 11, type:
|
|
2787
|
-
30: { name: "standard_rate", i: 11, type:
|
|
2788
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
2789
|
-
33: { name: "sms_services", i: 11, type:
|
|
2790
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
2781
|
+
1: { name: "general_desc", i: 11, type: N },
|
|
2782
|
+
2: { name: "fixed_line", i: 11, type: N },
|
|
2783
|
+
3: { name: "mobile", i: 11, type: N },
|
|
2784
|
+
4: { name: "toll_free", i: 11, type: N },
|
|
2785
|
+
5: { name: "premium_rate", i: 11, type: N },
|
|
2786
|
+
6: { name: "shared_cost", i: 11, type: N },
|
|
2787
|
+
7: { name: "personal_number", i: 11, type: N },
|
|
2788
|
+
8: { name: "voip", i: 11, type: N },
|
|
2789
|
+
21: { name: "pager", i: 11, type: N },
|
|
2790
|
+
25: { name: "uan", i: 11, type: N },
|
|
2791
|
+
27: { name: "emergency", i: 11, type: N },
|
|
2792
|
+
28: { name: "voicemail", i: 11, type: N },
|
|
2793
|
+
29: { name: "short_code", i: 11, type: N },
|
|
2794
|
+
30: { name: "standard_rate", i: 11, type: N },
|
|
2795
|
+
31: { name: "carrier_specific", i: 11, type: N },
|
|
2796
|
+
33: { name: "sms_services", i: 11, type: N },
|
|
2797
|
+
24: { name: "no_international_dialling", i: 11, type: N },
|
|
2791
2798
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
2792
2799
|
10: { name: "country_code", i: 5, type: Number },
|
|
2793
2800
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -2810,11 +2817,11 @@ const W2 = (y) => {
|
|
|
2810
2817
|
function H() {
|
|
2811
2818
|
R.call(this);
|
|
2812
2819
|
}
|
|
2813
|
-
|
|
2814
|
-
var
|
|
2820
|
+
i(H, R);
|
|
2821
|
+
var T1 = null, f2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
2815
2822
|
H.prototype.m = function() {
|
|
2816
|
-
var d =
|
|
2817
|
-
return d || (
|
|
2823
|
+
var d = T1;
|
|
2824
|
+
return d || (T1 = d = n1(H, { 0: { name: "PhoneNumber", ia: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: !0, i: 5, type: Number }, 2: { name: "national_number", required: !0, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: f2 }, 7: {
|
|
2818
2825
|
name: "preferred_domestic_carrier_code",
|
|
2819
2826
|
i: 9,
|
|
2820
2827
|
type: String
|
|
@@ -3036,7 +3043,7 @@ const W2 = (y) => {
|
|
|
3036
3043
|
995: ["GE"],
|
|
3037
3044
|
996: ["KG"],
|
|
3038
3045
|
998: ["UZ"]
|
|
3039
|
-
},
|
|
3046
|
+
}, A1 = {
|
|
3040
3047
|
AC: [, [
|
|
3041
3048
|
,
|
|
3042
3049
|
,
|
|
@@ -8250,64 +8257,64 @@ const W2 = (y) => {
|
|
|
8250
8257
|
X: "9",
|
|
8251
8258
|
Y: "9",
|
|
8252
8259
|
Z: "9"
|
|
8253
|
-
}, C2 = RegExp("[++]+"), Q = RegExp("^[++]+"),
|
|
8260
|
+
}, C2 = RegExp("[++]+"), Q = RegExp("^[++]+"), E1 = RegExp("([0-90-9٠-٩۰-۹])"), m2 = RegExp("[++0-90-9٠-٩۰-۹]"), y2 = /[\\\/] *x/, _2 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), I2 = /(?:.*?[A-Za-z]){3}.*/, v2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), S2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
|
|
8254
8261
|
function J(d) {
|
|
8255
8262
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8256
8263
|
}
|
|
8257
8264
|
function M1() {
|
|
8258
8265
|
return ";ext=" + J("20") + "|[ \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[ \\t,-]*" + (J("20") + "#?|[ \\t,]*(?:[xx##~~]|int|int)[:\\..]?[ \\t,-]*") + (J("9") + "#?|[- ]+") + (J("6") + "#|[ \\t]*(?:,{2}|;)[:\\..]?[ \\t,-]*") + (J("15") + "#?|[ \\t]*(?:,)+[:\\..]?[ \\t,-]*") + (J("9") + "#?");
|
|
8259
8266
|
}
|
|
8260
|
-
var
|
|
8261
|
-
function
|
|
8267
|
+
var D1 = new RegExp("(?:" + M1() + ")$", "i"), w2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + M1() + ")?$", "i"), b2 = /(\$\d)/, L2 = /^\(?\$1\)?$/;
|
|
8268
|
+
function P1(d) {
|
|
8262
8269
|
return 2 > d.length ? !1 : U(w2, d);
|
|
8263
8270
|
}
|
|
8264
|
-
function
|
|
8271
|
+
function x1(d) {
|
|
8265
8272
|
return U(I2, d) ? r1(d, g2) : r1(d, g1);
|
|
8266
8273
|
}
|
|
8267
|
-
function
|
|
8268
|
-
var t =
|
|
8274
|
+
function R1(d) {
|
|
8275
|
+
var t = x1(d.toString());
|
|
8269
8276
|
k(d), d.g(t);
|
|
8270
8277
|
}
|
|
8271
|
-
function
|
|
8272
|
-
return d != null && (K(d, 9) != 1 ||
|
|
8278
|
+
function B1(d) {
|
|
8279
|
+
return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
|
|
8273
8280
|
}
|
|
8274
8281
|
function r1(d, t) {
|
|
8275
|
-
for (var $ = new
|
|
8282
|
+
for (var $ = new A(), n, r = d.length, u = 0; u < r; ++u) n = d.charAt(u), n = t[n.toUpperCase()], n != null && $.g(n);
|
|
8276
8283
|
return $.toString();
|
|
8277
8284
|
}
|
|
8278
|
-
function
|
|
8285
|
+
function k1(d) {
|
|
8279
8286
|
return d.length == 0 || L2.test(d);
|
|
8280
8287
|
}
|
|
8281
8288
|
function o1(d) {
|
|
8282
|
-
return d != null && isNaN(d) && d.toUpperCase() in
|
|
8289
|
+
return d != null && isNaN(d) && d.toUpperCase() in A1;
|
|
8283
8290
|
}
|
|
8284
8291
|
D.prototype.format = function(d, t) {
|
|
8285
8292
|
if (p(d, 2) == 0 && B(d, 5)) {
|
|
8286
|
-
var $ =
|
|
8293
|
+
var $ = w(d, 5);
|
|
8287
8294
|
if (0 < $.length) return $;
|
|
8288
8295
|
}
|
|
8289
|
-
$ =
|
|
8290
|
-
var
|
|
8291
|
-
if (t == 0) return
|
|
8292
|
-
if (!($ in X)) return
|
|
8296
|
+
$ = w(d, 1);
|
|
8297
|
+
var n = t1(d);
|
|
8298
|
+
if (t == 0) return O1($, 0, n, "");
|
|
8299
|
+
if (!($ in X)) return n;
|
|
8293
8300
|
var r = d1(this, $, e1($));
|
|
8294
|
-
d = B(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : B(r, 13) ? p(r, 13) +
|
|
8301
|
+
d = B(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : B(r, 13) ? p(r, 13) + w(d, 3) : " ext. " + w(d, 3) : "";
|
|
8295
8302
|
d: {
|
|
8296
|
-
r =
|
|
8303
|
+
r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
|
|
8297
8304
|
for (var u, l = r.length, h = 0; h < l; ++h) {
|
|
8298
8305
|
u = r[h];
|
|
8299
|
-
var
|
|
8300
|
-
if ((
|
|
8306
|
+
var _ = K(u, 3);
|
|
8307
|
+
if ((_ == 0 || n.search(p(u, 3, _ - 1)) == 0) && (_ = new RegExp(p(u, 1)), U(_, n))) {
|
|
8301
8308
|
r = u;
|
|
8302
8309
|
break d;
|
|
8303
8310
|
}
|
|
8304
8311
|
}
|
|
8305
8312
|
r = null;
|
|
8306
8313
|
}
|
|
8307
|
-
return r != null && (l = r, r =
|
|
8314
|
+
return r != null && (l = r, r = w(l, 2), u = new RegExp(p(l, 1)), w(
|
|
8308
8315
|
l,
|
|
8309
8316
|
5
|
|
8310
|
-
), l =
|
|
8317
|
+
), l = w(l, 4), n = t == 2 && l != null && 0 < l.length ? n.replace(u, r.replace(b2, l)) : n.replace(u, r), t == 3 && (n = n.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), n = n.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), O1($, t, n, d);
|
|
8311
8318
|
};
|
|
8312
8319
|
function d1(d, t, $) {
|
|
8313
8320
|
return $ == "001" ? j(d, "" + t) : j(d, $);
|
|
@@ -8315,18 +8322,18 @@ const W2 = (y) => {
|
|
|
8315
8322
|
function t1(d) {
|
|
8316
8323
|
if (!B(d, 2)) return "";
|
|
8317
8324
|
var t = "" + p(d, 2);
|
|
8318
|
-
return B(d, 4) && p(d, 4) && 0 <
|
|
8325
|
+
return B(d, 4) && p(d, 4) && 0 < w(d, 8) ? Array(w(d, 8) + 1).join("0") + t : t;
|
|
8319
8326
|
}
|
|
8320
|
-
function
|
|
8327
|
+
function O1(d, t, $, n) {
|
|
8321
8328
|
switch (t) {
|
|
8322
8329
|
case 0:
|
|
8323
|
-
return "+" + d + $ +
|
|
8330
|
+
return "+" + d + $ + n;
|
|
8324
8331
|
case 1:
|
|
8325
|
-
return "+" + d + " " + $ +
|
|
8332
|
+
return "+" + d + " " + $ + n;
|
|
8326
8333
|
case 3:
|
|
8327
|
-
return "tel:+" + d + "-" + $ +
|
|
8334
|
+
return "tel:+" + d + "-" + $ + n;
|
|
8328
8335
|
default:
|
|
8329
|
-
return $ +
|
|
8336
|
+
return $ + n;
|
|
8330
8337
|
}
|
|
8331
8338
|
}
|
|
8332
8339
|
function u1(d, t) {
|
|
@@ -8356,48 +8363,48 @@ const W2 = (y) => {
|
|
|
8356
8363
|
return p(d, 1);
|
|
8357
8364
|
}
|
|
8358
8365
|
}
|
|
8359
|
-
function
|
|
8360
|
-
var $ =
|
|
8361
|
-
return d = d1(d,
|
|
8366
|
+
function G1(d, t) {
|
|
8367
|
+
var $ = F1(d, t);
|
|
8368
|
+
return d = d1(d, w(t, 1), $), d == null ? -1 : (t = t1(t), C1(t, d));
|
|
8362
8369
|
}
|
|
8363
8370
|
function C1(d, t) {
|
|
8364
|
-
return
|
|
8371
|
+
return F(d, p(t, 1)) ? F(d, p(t, 5)) ? 4 : F(d, p(t, 4)) ? 3 : F(d, p(t, 6)) ? 5 : F(d, p(t, 8)) ? 6 : F(d, p(t, 7)) ? 7 : F(d, p(t, 21)) ? 8 : F(d, p(t, 25)) ? 9 : F(d, p(t, 28)) ? 10 : F(d, p(t, 2)) ? p(t, 18) || F(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && F(d, p(t, 3)) ? 1 : -1 : -1;
|
|
8365
8372
|
}
|
|
8366
8373
|
function j(d, t) {
|
|
8367
8374
|
if (t == null) return null;
|
|
8368
8375
|
t = t.toUpperCase();
|
|
8369
8376
|
var $ = d.g[t];
|
|
8370
8377
|
if ($ == null) {
|
|
8371
|
-
if ($ =
|
|
8378
|
+
if ($ = A1[t], $ == null) return null;
|
|
8372
8379
|
$ = new q().g(Z.m(), $), d.g[t] = $;
|
|
8373
8380
|
}
|
|
8374
8381
|
return $;
|
|
8375
8382
|
}
|
|
8376
|
-
function
|
|
8383
|
+
function F(d, t) {
|
|
8377
8384
|
var $ = d.length;
|
|
8378
|
-
return 0 < K(t, 9) &&
|
|
8385
|
+
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(w(t, 2), d);
|
|
8379
8386
|
}
|
|
8380
8387
|
function N2(d, t) {
|
|
8381
|
-
var $ =
|
|
8382
|
-
return r == null || $ != "001" &&
|
|
8388
|
+
var $ = F1(d, t), n = w(t, 1), r = d1(d, n, $);
|
|
8389
|
+
return r == null || $ != "001" && n != U1(d, $) ? r = !1 : (d = t1(t), r = C1(d, r) != -1), r;
|
|
8383
8390
|
}
|
|
8384
|
-
function
|
|
8391
|
+
function F1(d, t) {
|
|
8385
8392
|
if (t == null) return null;
|
|
8386
|
-
var $ =
|
|
8393
|
+
var $ = w(t, 1);
|
|
8387
8394
|
if ($ = X[$], $ == null) d = null;
|
|
8388
8395
|
else if ($.length == 1) d = $[0];
|
|
8389
8396
|
else d: {
|
|
8390
8397
|
t = t1(t);
|
|
8391
|
-
for (var
|
|
8392
|
-
|
|
8393
|
-
var l = j(d,
|
|
8398
|
+
for (var n, r = $.length, u = 0; u < r; u++) {
|
|
8399
|
+
n = $[u];
|
|
8400
|
+
var l = j(d, n);
|
|
8394
8401
|
if (B(l, 23)) {
|
|
8395
8402
|
if (t.search(p(l, 23)) == 0) {
|
|
8396
|
-
d =
|
|
8403
|
+
d = n;
|
|
8397
8404
|
break d;
|
|
8398
8405
|
}
|
|
8399
8406
|
} else if (C1(t, l) != -1) {
|
|
8400
|
-
d =
|
|
8407
|
+
d = n;
|
|
8401
8408
|
break d;
|
|
8402
8409
|
}
|
|
8403
8410
|
}
|
|
@@ -8408,67 +8415,67 @@ const W2 = (y) => {
|
|
|
8408
8415
|
function e1(d) {
|
|
8409
8416
|
return d = X[d], d == null ? "ZZ" : d[0];
|
|
8410
8417
|
}
|
|
8411
|
-
function
|
|
8418
|
+
function U1(d, t) {
|
|
8412
8419
|
if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8413
|
-
return
|
|
8420
|
+
return w(d, 10);
|
|
8414
8421
|
}
|
|
8415
|
-
function l1(d, t, $,
|
|
8416
|
-
var r = u1($,
|
|
8417
|
-
if (r =
|
|
8422
|
+
function l1(d, t, $, n) {
|
|
8423
|
+
var r = u1($, n), u = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
|
|
8424
|
+
if (r = P(r, 10), n == 2) if (B1(u1($, 0))) d = u1($, 1), B1(d) && (u = u.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), u.sort(), r.length == 0 ? r = P(d, 10) : (r = r.concat(P(d, 10)), r.sort()));
|
|
8418
8425
|
else return l1(d, t, $, 1);
|
|
8419
8426
|
return u[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
|
|
8420
8427
|
}
|
|
8421
8428
|
function a1(d, t, $) {
|
|
8422
|
-
var
|
|
8423
|
-
return t =
|
|
8429
|
+
var n = t1(t);
|
|
8430
|
+
return t = w(t, 1), t in X ? (t = d1(d, t, e1(t)), l1(d, n, t, $)) : 1;
|
|
8424
8431
|
}
|
|
8425
|
-
function
|
|
8432
|
+
function V1(d, t) {
|
|
8426
8433
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8427
|
-
for (var $,
|
|
8434
|
+
for (var $, n = d.length, r = 1; 3 >= r && r <= n; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in X) return t.g(d.substring(r)), $;
|
|
8428
8435
|
return 0;
|
|
8429
8436
|
}
|
|
8430
|
-
function
|
|
8437
|
+
function K1(d, t, $, n, r, u) {
|
|
8431
8438
|
if (t.length == 0) return 0;
|
|
8432
|
-
t = new
|
|
8439
|
+
t = new A(t);
|
|
8433
8440
|
var l;
|
|
8434
8441
|
$ != null && (l = p($, 11)), l == null && (l = "NonMatch");
|
|
8435
8442
|
var h = t.toString();
|
|
8436
8443
|
if (h.length == 0) l = 20;
|
|
8437
|
-
else if (Q.test(h)) h = h.replace(Q, ""), k(t), t.g(
|
|
8444
|
+
else if (Q.test(h)) h = h.replace(Q, ""), k(t), t.g(x1(h)), l = 1;
|
|
8438
8445
|
else {
|
|
8439
|
-
if (h = new RegExp(l),
|
|
8446
|
+
if (h = new RegExp(l), R1(t), l = t.toString(), l.search(h) == 0) {
|
|
8440
8447
|
h = l.match(h)[0].length;
|
|
8441
|
-
var
|
|
8442
|
-
|
|
8448
|
+
var _ = l.substring(h).match(E1);
|
|
8449
|
+
_ && _[1] != null && 0 < _[1].length && r1(_[1], g1) == "0" ? l = !1 : (k(t), t.g(l.substring(h)), l = !0);
|
|
8443
8450
|
} else l = !1;
|
|
8444
8451
|
l = l ? 5 : 20;
|
|
8445
8452
|
}
|
|
8446
|
-
if (r &&
|
|
8453
|
+
if (r && M(u, 6, l), l != 20) {
|
|
8447
8454
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
8448
|
-
if (d =
|
|
8455
|
+
if (d = V1(t, n), d != 0) return M(u, 1, d), d;
|
|
8449
8456
|
throw Error("Invalid country calling code");
|
|
8450
8457
|
}
|
|
8451
|
-
return $ != null && (l =
|
|
8458
|
+
return $ != null && (l = w($, 10), h = "" + l, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new A(_.substring(h.length)), _ = p($, 1), _ = new RegExp(w(_, 2)), H1(h, $, null), h = h.toString(), !U(_, t.toString()) && U(_, h) || l1(d, t.toString(), $, -1) == 3)) ? (n.g(h), r && M(u, 6, 10), M(u, 1, l), l) : (M(u, 1, 0), 0);
|
|
8452
8459
|
}
|
|
8453
|
-
function
|
|
8454
|
-
var
|
|
8460
|
+
function H1(d, t, $) {
|
|
8461
|
+
var n = d.toString(), r = n.length, u = p(t, 15);
|
|
8455
8462
|
if (r != 0 && u != null && u.length != 0) {
|
|
8456
8463
|
var l = new RegExp("^(?:" + u + ")");
|
|
8457
|
-
if (r = l.exec(
|
|
8458
|
-
u = new RegExp(
|
|
8459
|
-
var h = U(u,
|
|
8460
|
-
t = p(t, 16), t == null || t.length == 0 || r[
|
|
8464
|
+
if (r = l.exec(n)) {
|
|
8465
|
+
u = new RegExp(w(p(t, 1), 2));
|
|
8466
|
+
var h = U(u, n), _ = r.length - 1;
|
|
8467
|
+
t = p(t, 16), t == null || t.length == 0 || r[_] == null || r[_].length == 0 ? (!h || U(u, n.substring(r[0].length))) && ($ != null && 0 < _ && r[_] != null && $.g(r[1]), d.set(n.substring(r[0].length))) : (n = n.replace(l, t), (!h || U(u, n)) && ($ != null && 0 < _ && $.g(r[1]), d.set(n)));
|
|
8461
8468
|
}
|
|
8462
8469
|
}
|
|
8463
8470
|
}
|
|
8464
8471
|
function Y(d, t, $) {
|
|
8465
8472
|
if (!o1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
8466
|
-
return
|
|
8473
|
+
return j1(d, t, $, !0);
|
|
8467
8474
|
}
|
|
8468
|
-
function
|
|
8475
|
+
function j1(d, t, $, n) {
|
|
8469
8476
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
8470
8477
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
8471
|
-
var r = new
|
|
8478
|
+
var r = new A(), u = t.indexOf(";phone-context=");
|
|
8472
8479
|
if (u === -1) u = null;
|
|
8473
8480
|
else if (u += 15, u >= t.length) u = "";
|
|
8474
8481
|
else {
|
|
@@ -8476,80 +8483,80 @@ const W2 = (y) => {
|
|
|
8476
8483
|
u = l !== -1 ? t.substring(u, l) : t.substring(u);
|
|
8477
8484
|
}
|
|
8478
8485
|
var h = u;
|
|
8479
|
-
if (h == null ? l = !0 : h.length === 0 ? l = !1 : (l = v2.exec(h), h = S2.exec(h), l = l !== null || h !== null), !l || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, l = t ?? "", h = l.search(m2), 0 <= h ? (l = l.substring(h), l = l.replace(_2, ""), h = l.search(y2), 0 <= h && (l = l.substring(0, h))) : l = "", u.call(r, l)), u = r.toString(), l = u.indexOf(";isub="), 0 < l && (k(r), r.g(u.substring(0, l))), !
|
|
8486
|
+
if (h == null ? l = !0 : h.length === 0 ? l = !1 : (l = v2.exec(h), h = S2.exec(h), l = l !== null || h !== null), !l || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, l = t ?? "", h = l.search(m2), 0 <= h ? (l = l.substring(h), l = l.replace(_2, ""), h = l.search(y2), 0 <= h && (l = l.substring(0, h))) : l = "", u.call(r, l)), u = r.toString(), l = u.indexOf(";isub="), 0 < l && (k(r), r.g(u.substring(0, l))), !P1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
8480
8487
|
if (u = r.toString(), !(o1($) || u != null && 0 < u.length && Q.test(u))) throw Error("Invalid country calling code");
|
|
8481
|
-
u = new H(),
|
|
8488
|
+
u = new H(), n && M(u, 5, t);
|
|
8482
8489
|
d: {
|
|
8483
|
-
if (t = r.toString(), l = t.search(
|
|
8484
|
-
h = t.match(
|
|
8485
|
-
for (var
|
|
8490
|
+
if (t = r.toString(), l = t.search(D1), 0 <= l && P1(t.substring(0, l))) {
|
|
8491
|
+
h = t.match(D1);
|
|
8492
|
+
for (var _ = h.length, V = 1; V < _; ++V) if (h[V] != null && 0 < h[V].length) {
|
|
8486
8493
|
k(r), r.g(t.substring(0, l)), t = h[V];
|
|
8487
8494
|
break d;
|
|
8488
8495
|
}
|
|
8489
8496
|
}
|
|
8490
8497
|
t = "";
|
|
8491
8498
|
}
|
|
8492
|
-
0 < t.length &&
|
|
8499
|
+
0 < t.length && M(u, 3, t), l = j(d, $), t = new A(), h = 0, _ = r.toString();
|
|
8493
8500
|
try {
|
|
8494
|
-
h =
|
|
8501
|
+
h = K1(d, _, l, t, n, u);
|
|
8495
8502
|
} catch (_1) {
|
|
8496
|
-
if (_1.message == "Invalid country calling code" && Q.test(
|
|
8497
|
-
if (
|
|
8503
|
+
if (_1.message == "Invalid country calling code" && Q.test(_)) {
|
|
8504
|
+
if (_ = _.replace(Q, ""), h = K1(d, _, l, t, n, u), h == 0) throw _1;
|
|
8498
8505
|
} else throw _1;
|
|
8499
8506
|
}
|
|
8500
|
-
if (h != 0 ? (r = e1(h), r != $ && (l = d1(d, h, r))) : (
|
|
8507
|
+
if (h != 0 ? (r = e1(h), r != $ && (l = d1(d, h, r))) : (R1(r), t.g(r.toString()), $ != null ? (h = w(l, 10), M(
|
|
8501
8508
|
u,
|
|
8502
8509
|
1,
|
|
8503
8510
|
h
|
|
8504
|
-
)) :
|
|
8511
|
+
)) : n && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (l != null && ($ = new A(), r = new A(t.toString()), H1(r, l, $), d = l1(d, r.toString(), l, -1), d != 2 && d != 4 && d != 5 && (t = r, n && 0 < $.toString().length && M(u, 7, $.toString()))), n = t.toString(), d = n.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
8505
8512
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8506
|
-
if (1 <
|
|
8507
|
-
for (
|
|
8508
|
-
d != 1 &&
|
|
8513
|
+
if (1 < n.length && n.charAt(0) == "0") {
|
|
8514
|
+
for (M(u, 4, !0), d = 1; d < n.length - 1 && n.charAt(d) == "0"; ) d++;
|
|
8515
|
+
d != 1 && M(u, 8, d);
|
|
8509
8516
|
}
|
|
8510
|
-
return
|
|
8517
|
+
return M(u, 2, parseInt(n, 10)), u;
|
|
8511
8518
|
}
|
|
8512
8519
|
function U(d, t) {
|
|
8513
8520
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
8514
8521
|
}
|
|
8515
8522
|
function T2(d) {
|
|
8516
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
8523
|
+
this.fa = RegExp(" "), this.ja = "", this.v = new A(), this.da = "", this.s = new A(), this.ba = new A(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = D.g(), this.$ = 0, this.h = new A(), this.ha = !1, this.o = "", this.g = new A(), this.j = [], this.ka = d, this.l = Z1(this, this.ka);
|
|
8517
8524
|
}
|
|
8518
|
-
var
|
|
8519
|
-
|
|
8520
|
-
var A2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"),
|
|
8521
|
-
function
|
|
8525
|
+
var W1 = new Z();
|
|
8526
|
+
M(W1, 11, "NA");
|
|
8527
|
+
var A2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), z1 = /[- ]/;
|
|
8528
|
+
function Z1(d, t) {
|
|
8522
8529
|
var $ = d.ga;
|
|
8523
|
-
return t = o1(t) ?
|
|
8530
|
+
return t = o1(t) ? U1($, t) : 0, d = j(d.ga, e1(t)), d ?? W1;
|
|
8524
8531
|
}
|
|
8525
|
-
function
|
|
8532
|
+
function Y1(d) {
|
|
8526
8533
|
for (var t = d.j.length, $ = 0; $ < t; ++$) {
|
|
8527
|
-
var
|
|
8534
|
+
var n = d.j[$], r = w(n, 1);
|
|
8528
8535
|
if (d.da == r) return !1;
|
|
8529
|
-
var u = d, l =
|
|
8536
|
+
var u = d, l = n, h = w(l, 1);
|
|
8530
8537
|
k(u.v);
|
|
8531
|
-
var
|
|
8532
|
-
l =
|
|
8538
|
+
var _ = u;
|
|
8539
|
+
l = w(l, 2);
|
|
8533
8540
|
var V = "999999999999999".match(h)[0];
|
|
8534
|
-
if (V.length <
|
|
8541
|
+
if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), l), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (u.v.g(_), u = !0) : u = !1, u) return d.da = r, d.ha = z1.test(p(n, 4)), d.$ = 0, !0;
|
|
8535
8542
|
}
|
|
8536
8543
|
return d.u = !1;
|
|
8537
8544
|
}
|
|
8538
|
-
function
|
|
8539
|
-
for (var $ = [],
|
|
8545
|
+
function J1(d, t) {
|
|
8546
|
+
for (var $ = [], n = t.length - 3, r = d.j.length, u = 0; u < r; ++u) {
|
|
8540
8547
|
var l = d.j[u];
|
|
8541
|
-
K(l, 3) == 0 ? $.push(d.j[u]) : (l = p(l, 3, Math.min(
|
|
8548
|
+
K(l, 3) == 0 ? $.push(d.j[u]) : (l = p(l, 3, Math.min(n, K(l, 3) - 1)), t.search(l) == 0 && $.push(d.j[u]));
|
|
8542
8549
|
}
|
|
8543
8550
|
d.j = $;
|
|
8544
8551
|
}
|
|
8545
8552
|
function E2(d, t) {
|
|
8546
8553
|
d.s.g(t);
|
|
8547
8554
|
var $ = t;
|
|
8548
|
-
if (
|
|
8555
|
+
if (E1.test($) || d.s.h.length == 1 && C2.test($) ? (t == "+" ? ($ = t, d.ba.g(t)) : ($ = g1[t], d.ba.g($), d.g.g($)), t = $) : (d.u = !1, d.la = !0), !d.u) {
|
|
8549
8556
|
if (!d.la) {
|
|
8550
|
-
if (
|
|
8551
|
-
if (
|
|
8552
|
-
} else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), k(d.h), d.h.g(t.substring(0, $))), d.o !=
|
|
8557
|
+
if (t2(d)) {
|
|
8558
|
+
if (e2(d)) return q1(d);
|
|
8559
|
+
} else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), k(d.h), d.h.g(t.substring(0, $))), d.o != d2(d)) return d.h.g(" "), q1(d);
|
|
8553
8560
|
}
|
|
8554
8561
|
return d.s.toString();
|
|
8555
8562
|
}
|
|
@@ -8559,19 +8566,19 @@ const W2 = (y) => {
|
|
|
8559
8566
|
case 2:
|
|
8560
8567
|
return d.s.toString();
|
|
8561
8568
|
case 3:
|
|
8562
|
-
if (
|
|
8563
|
-
else return d.o =
|
|
8569
|
+
if (t2(d)) d.ea = !0;
|
|
8570
|
+
else return d.o = d2(d), m1(d);
|
|
8564
8571
|
default:
|
|
8565
|
-
return d.ea ? (
|
|
8572
|
+
return d.ea ? (e2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = $2(d, t), $ = X1(d), 0 < $.length ? $ : (J1(d, d.g.toString()), Y1(d) ? Q1(d) : d.u ? h1(d, t) : d.s.toString())) : m1(d);
|
|
8566
8573
|
}
|
|
8567
8574
|
}
|
|
8568
|
-
function
|
|
8575
|
+
function q1(d) {
|
|
8569
8576
|
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, k(d.v), d.da = "", m1(d);
|
|
8570
8577
|
}
|
|
8571
|
-
function
|
|
8572
|
-
for (var t = d.g.toString(), $ = d.j.length,
|
|
8573
|
-
var r = d.j[
|
|
8574
|
-
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha =
|
|
8578
|
+
function X1(d) {
|
|
8579
|
+
for (var t = d.g.toString(), $ = d.j.length, n = 0; n < $; ++n) {
|
|
8580
|
+
var r = d.j[n], u = w(r, 1);
|
|
8581
|
+
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = z1.test(p(r, 4)), r = t.replace(new RegExp(u, "g"), p(r, 2)), r = h1(d, r), r1(r, p2) == d.ba)) return r;
|
|
8575
8582
|
}
|
|
8576
8583
|
return "";
|
|
8577
8584
|
}
|
|
@@ -8582,42 +8589,42 @@ const W2 = (y) => {
|
|
|
8582
8589
|
function m1(d) {
|
|
8583
8590
|
var t = d.g.toString();
|
|
8584
8591
|
if (3 <= t.length) {
|
|
8585
|
-
for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ?
|
|
8592
|
+
for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), n = $.length, r = 0; r < n; ++r) {
|
|
8586
8593
|
var u = $[r];
|
|
8587
|
-
0 < d.o.length &&
|
|
8594
|
+
0 < d.o.length && k1(w(u, 4)) && !p(u, 6) && !B(u, 5) || (d.o.length != 0 || d.ca || k1(w(u, 4)) || p(u, 6)) && A2.test(w(u, 2)) && d.j.push(u);
|
|
8588
8595
|
}
|
|
8589
|
-
return
|
|
8596
|
+
return J1(d, t), t = X1(d), 0 < t.length ? t : Y1(d) ? Q1(d) : d.s.toString();
|
|
8590
8597
|
}
|
|
8591
8598
|
return h1(d, t);
|
|
8592
8599
|
}
|
|
8593
|
-
function
|
|
8600
|
+
function Q1(d) {
|
|
8594
8601
|
var t = d.g.toString(), $ = t.length;
|
|
8595
8602
|
if (0 < $) {
|
|
8596
|
-
for (var
|
|
8597
|
-
return d.u ? h1(d,
|
|
8603
|
+
for (var n = "", r = 0; r < $; r++) n = $2(d, t.charAt(r));
|
|
8604
|
+
return d.u ? h1(d, n) : d.s.toString();
|
|
8598
8605
|
}
|
|
8599
8606
|
return d.h.toString();
|
|
8600
8607
|
}
|
|
8601
|
-
function
|
|
8608
|
+
function d2(d) {
|
|
8602
8609
|
var t = d.g.toString(), $ = 0;
|
|
8603
|
-
if (p(d.l, 10) != 1) var
|
|
8604
|
-
else
|
|
8605
|
-
return
|
|
8610
|
+
if (p(d.l, 10) != 1) var n = !1;
|
|
8611
|
+
else n = d.g.toString(), n = n.charAt(0) == "1" && n.charAt(1) != "0" && n.charAt(1) != "1";
|
|
8612
|
+
return n ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (n = new RegExp("^(?:" + p(d.l, 15) + ")"), n = t.match(n), n != null && n[0] != null && 0 < n[0].length && (d.ca = !0, $ = n[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
|
|
8606
8613
|
}
|
|
8607
|
-
function
|
|
8614
|
+
function t2(d) {
|
|
8608
8615
|
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8609
8616
|
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, k(d.g), d.g.g(t.substring($)), k(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8610
8617
|
}
|
|
8611
|
-
function
|
|
8618
|
+
function e2(d) {
|
|
8612
8619
|
if (d.g.h.length == 0) return !1;
|
|
8613
|
-
var t = new
|
|
8614
|
-
return $ == 0 ? !1 : (k(d.g), d.g.g(t.toString()), t = e1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l =
|
|
8620
|
+
var t = new A(), $ = V1(d.g, t);
|
|
8621
|
+
return $ == 0 ? !1 : (k(d.g), d.g.g(t.toString()), t = e1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = Z1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
|
|
8615
8622
|
}
|
|
8616
|
-
function
|
|
8623
|
+
function $2(d, t) {
|
|
8617
8624
|
var $ = d.v.toString();
|
|
8618
8625
|
if (0 <= $.substring(d.$).search(d.fa)) {
|
|
8619
|
-
var
|
|
8620
|
-
return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ =
|
|
8626
|
+
var n = $.search(d.fa);
|
|
8627
|
+
return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = n, t.substring(0, d.$ + 1);
|
|
8621
8628
|
}
|
|
8622
8629
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8623
8630
|
}
|
|
@@ -8626,9 +8633,9 @@ const W2 = (y) => {
|
|
|
8626
8633
|
}, y1 = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
|
|
8627
8634
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
8628
8635
|
try {
|
|
8629
|
-
const $ = d.replace(/[^+0-9]/g, ""),
|
|
8636
|
+
const $ = d.replace(/[^+0-9]/g, ""), n = new T2(t);
|
|
8630
8637
|
t = "";
|
|
8631
|
-
for (let r = 0; r < $.length; r++)
|
|
8638
|
+
for (let r = 0; r < $.length; r++) n.ja = E2(n, $.charAt(r)), t = n.ja;
|
|
8632
8639
|
return t;
|
|
8633
8640
|
} catch {
|
|
8634
8641
|
return d;
|
|
@@ -8636,21 +8643,21 @@ const W2 = (y) => {
|
|
|
8636
8643
|
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
|
|
8637
8644
|
try {
|
|
8638
8645
|
const r = D.g(), u = Y(r, d, t);
|
|
8639
|
-
var
|
|
8640
|
-
return
|
|
8646
|
+
var n = a1(r, u, -1);
|
|
8647
|
+
return n == 0 || n == 4 ? r.format(u, typeof $ > "u" ? 0 : $) : d;
|
|
8641
8648
|
} catch {
|
|
8642
8649
|
return d;
|
|
8643
8650
|
}
|
|
8644
|
-
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $,
|
|
8651
|
+
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, n) => {
|
|
8645
8652
|
try {
|
|
8646
|
-
const
|
|
8653
|
+
const _ = D.g();
|
|
8647
8654
|
d: {
|
|
8648
|
-
var r =
|
|
8655
|
+
var r = _;
|
|
8649
8656
|
if (o1(d)) {
|
|
8650
8657
|
var u = u1(j(r, d), $);
|
|
8651
8658
|
try {
|
|
8652
8659
|
if (B(u, 6)) {
|
|
8653
|
-
var l = p(u, 6), h =
|
|
8660
|
+
var l = p(u, 6), h = j1(r, l, d, !1);
|
|
8654
8661
|
break d;
|
|
8655
8662
|
}
|
|
8656
8663
|
} catch {
|
|
@@ -8658,7 +8665,7 @@ const W2 = (y) => {
|
|
|
8658
8665
|
}
|
|
8659
8666
|
h = null;
|
|
8660
8667
|
}
|
|
8661
|
-
return
|
|
8668
|
+
return _.format(h, n ? 0 : t ? 2 : 1);
|
|
8662
8669
|
} catch {
|
|
8663
8670
|
return "";
|
|
8664
8671
|
}
|
|
@@ -8670,26 +8677,26 @@ const W2 = (y) => {
|
|
|
8670
8677
|
}
|
|
8671
8678
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8672
8679
|
try {
|
|
8673
|
-
const $ = D.g(),
|
|
8674
|
-
return
|
|
8680
|
+
const $ = D.g(), n = Y($, d, t);
|
|
8681
|
+
return G1($, n);
|
|
8675
8682
|
} catch {
|
|
8676
8683
|
return -99;
|
|
8677
8684
|
}
|
|
8678
8685
|
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
8679
8686
|
if (!t) return 1;
|
|
8680
8687
|
try {
|
|
8681
|
-
const $ = D.g(),
|
|
8682
|
-
return a1($,
|
|
8688
|
+
const $ = D.g(), n = Y($, d, t);
|
|
8689
|
+
return a1($, n, -1);
|
|
8683
8690
|
} catch ($) {
|
|
8684
8691
|
return $.message === "Invalid country calling code" ? 1 : 3 >= d.length || $.message === "Phone number too short after IDD" || $.message === "The string supplied is too short to be a phone number" ? 2 : $.message === "The string supplied is too long to be a phone number" ? 3 : -99;
|
|
8685
8692
|
}
|
|
8686
8693
|
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
|
|
8687
8694
|
try {
|
|
8688
|
-
const
|
|
8695
|
+
const n = D.g(), r = Y(n, d, t), u = N2(n, r);
|
|
8689
8696
|
if ($) {
|
|
8690
8697
|
i2($);
|
|
8691
8698
|
const l = $.map((h) => y1[h]);
|
|
8692
|
-
return u && l.includes(
|
|
8699
|
+
return u && l.includes(G1(n, r));
|
|
8693
8700
|
}
|
|
8694
8701
|
return u;
|
|
8695
8702
|
} catch {
|
|
@@ -8697,13 +8704,13 @@ const W2 = (y) => {
|
|
|
8697
8704
|
}
|
|
8698
8705
|
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
|
|
8699
8706
|
try {
|
|
8700
|
-
const
|
|
8707
|
+
const n = D.g(), r = Y(n, d, t);
|
|
8701
8708
|
if ($) {
|
|
8702
8709
|
i2($);
|
|
8703
|
-
for (let u of $) if (a1(
|
|
8710
|
+
for (let u of $) if (a1(n, r, y1[u]) === 0) return !0;
|
|
8704
8711
|
return !1;
|
|
8705
8712
|
}
|
|
8706
|
-
return a1(
|
|
8713
|
+
return a1(n, r, -1) === 0;
|
|
8707
8714
|
} catch {
|
|
8708
8715
|
return !1;
|
|
8709
8716
|
}
|
|
@@ -8715,12 +8722,12 @@ const W2 = (y) => {
|
|
|
8715
8722
|
}
|
|
8716
8723
|
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", y1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
8717
8724
|
})();
|
|
8718
|
-
const
|
|
8719
|
-
delete
|
|
8720
|
-
|
|
8725
|
+
const a2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, z2 = a2.intlTelInputUtilsTemp;
|
|
8726
|
+
delete a2.intlTelInputUtilsTemp;
|
|
8727
|
+
y.utils = z2;
|
|
8721
8728
|
const Y2 = {
|
|
8722
8729
|
__name: "IntlTelInputWithUtils",
|
|
8723
|
-
props: /* @__PURE__ */
|
|
8730
|
+
props: /* @__PURE__ */ n2({
|
|
8724
8731
|
disabled: {
|
|
8725
8732
|
type: Boolean,
|
|
8726
8733
|
default: !1
|
|
@@ -8744,45 +8751,45 @@ const Y2 = {
|
|
|
8744
8751
|
},
|
|
8745
8752
|
modelModifiers: {}
|
|
8746
8753
|
}),
|
|
8747
|
-
emits: /* @__PURE__ */
|
|
8754
|
+
emits: /* @__PURE__ */ n2([
|
|
8748
8755
|
"changeNumber",
|
|
8749
8756
|
"changeCountry",
|
|
8750
8757
|
"changeValidity",
|
|
8751
8758
|
"changeErrorCode"
|
|
8752
8759
|
], ["update:modelValue"]),
|
|
8753
|
-
setup(
|
|
8754
|
-
const s =
|
|
8755
|
-
let
|
|
8756
|
-
f.value !==
|
|
8760
|
+
setup(I, { expose: e, emit: i }) {
|
|
8761
|
+
const s = M2(I, "modelValue"), o = I, a = i, c = I1(), g = I1(), f = I1(!1), v = () => g.value ? o.options.strictMode ? g.value.isValidNumberPrecise() : g.value.isValidNumber() : null, b = () => {
|
|
8762
|
+
let C = v();
|
|
8763
|
+
f.value !== C && (f.value = C, a("changeValidity", !!C), a(
|
|
8757
8764
|
"changeErrorCode",
|
|
8758
|
-
|
|
8765
|
+
C ? null : g.value.getValidationError()
|
|
8759
8766
|
));
|
|
8760
|
-
},
|
|
8761
|
-
var
|
|
8762
|
-
a("changeNumber", ((
|
|
8763
|
-
},
|
|
8764
|
-
var
|
|
8765
|
-
a("changeCountry", ((
|
|
8767
|
+
}, S = () => {
|
|
8768
|
+
var C;
|
|
8769
|
+
a("changeNumber", ((C = g.value) == null ? void 0 : C.getNumber()) ?? ""), b();
|
|
8770
|
+
}, L = () => {
|
|
8771
|
+
var C;
|
|
8772
|
+
a("changeCountry", ((C = g.value) == null ? void 0 : C.getSelectedCountryData().iso2) ?? ""), S(), b();
|
|
8766
8773
|
};
|
|
8767
|
-
return
|
|
8768
|
-
c.value && (g.value =
|
|
8774
|
+
return D2(() => {
|
|
8775
|
+
c.value && (g.value = y(c.value, o.options), o.value && g.value.setNumber(o.value), o.disabled && g.value.setDisabled(o.disabled), f.value = v());
|
|
8769
8776
|
}), P2(
|
|
8770
8777
|
() => o.disabled,
|
|
8771
|
-
(
|
|
8772
|
-
var
|
|
8773
|
-
return (
|
|
8778
|
+
(C) => {
|
|
8779
|
+
var m;
|
|
8780
|
+
return (m = g.value) == null ? void 0 : m.setDisabled(C);
|
|
8774
8781
|
}
|
|
8775
8782
|
), x2(() => {
|
|
8776
|
-
var
|
|
8777
|
-
return (
|
|
8778
|
-
}), e({ instance: g, input: c }), (
|
|
8783
|
+
var C;
|
|
8784
|
+
return (C = g.value) == null ? void 0 : C.destroy();
|
|
8785
|
+
}), e({ instance: g, input: c }), (C, m) => R2((k2(), B2("input", O2({
|
|
8779
8786
|
ref_key: "input",
|
|
8780
8787
|
ref: c,
|
|
8781
|
-
"onUpdate:modelValue":
|
|
8788
|
+
"onUpdate:modelValue": m[0] || (m[0] = (x) => s.value = x),
|
|
8782
8789
|
type: "tel",
|
|
8783
|
-
onCountrychange:
|
|
8784
|
-
onInput:
|
|
8785
|
-
},
|
|
8790
|
+
onCountrychange: L,
|
|
8791
|
+
onInput: S
|
|
8792
|
+
}, I.inputProps), null, 16)), [
|
|
8786
8793
|
[
|
|
8787
8794
|
G2,
|
|
8788
8795
|
s.value,
|