@riverty/web-components 5.7.0 → 5.8.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/custom-elements.json +28 -3
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/r-alert.cjs.entry.js +24 -8
  5. package/dist/cjs/r-button.cjs.entry.js +1 -1
  6. package/dist/cjs/r-checkbox-group.cjs.entry.js +27 -13
  7. package/dist/cjs/r-checkbox.cjs.entry.js +25 -10
  8. package/dist/cjs/r-icon-button.cjs.entry.js +1 -1
  9. package/dist/cjs/r-icon.cjs.entry.js +1 -1
  10. package/dist/cjs/r-input-code.cjs.entry.js +29 -16
  11. package/dist/cjs/r-input-date.cjs.entry.js +85 -15
  12. package/dist/cjs/r-input-password.cjs.entry.js +20 -7
  13. package/dist/cjs/r-input-phone-number.cjs.entry.js +27 -14
  14. package/dist/cjs/r-input.cjs.entry.js +24 -11
  15. package/dist/cjs/r-pagination.cjs.entry.js +1 -1
  16. package/dist/cjs/r-popover-action.cjs.entry.js +1 -1
  17. package/dist/cjs/r-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/r-radio-group.cjs.entry.js +20 -16
  19. package/dist/cjs/r-select.cjs.entry.js +112 -18
  20. package/dist/cjs/r-textarea.cjs.entry.js +18 -5
  21. package/dist/cjs/r-toast.cjs.entry.js +50 -19
  22. package/dist/cjs/web-components.cjs.js +1 -1
  23. package/dist/collection/components/alert/alert.css +52 -12
  24. package/dist/collection/components/alert/alert.js +48 -11
  25. package/dist/collection/components/alert/exports.js +1 -1
  26. package/dist/collection/components/button/button.css +6 -7
  27. package/dist/collection/components/checkbox/checkbox.js +45 -10
  28. package/dist/collection/components/checkbox-group/checkbox-group.js +47 -13
  29. package/dist/collection/components/icon/bundled-icons/riverty-kit.json +1 -1
  30. package/dist/collection/components/icon/riverty-kit.js +1 -1
  31. package/dist/collection/components/icon-button/icon-button.css +0 -7
  32. package/dist/collection/components/input/input.js +44 -11
  33. package/dist/collection/components/input-code/input-code.js +49 -16
  34. package/dist/collection/components/input-date/input-date.js +235 -16
  35. package/dist/collection/components/input-password/input-password.js +40 -7
  36. package/dist/collection/components/input-phone-number/input-phone-number.js +47 -14
  37. package/dist/collection/components/pagination/pagination.css +23 -23
  38. package/dist/collection/components/popover/popover.css +11 -3
  39. package/dist/collection/components/popover-action/popover-action.css +3 -5
  40. package/dist/collection/components/radio-group/radio-group.js +21 -17
  41. package/dist/collection/components/select/select.js +193 -21
  42. package/dist/collection/components/textarea/textarea.js +38 -5
  43. package/dist/collection/components/toast/toast.css +22 -14
  44. package/dist/collection/components/toast/toast.js +94 -20
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/r-alert.entry.js +24 -8
  47. package/dist/esm/r-button.entry.js +1 -1
  48. package/dist/esm/r-checkbox-group.entry.js +27 -13
  49. package/dist/esm/r-checkbox.entry.js +25 -10
  50. package/dist/esm/r-icon-button.entry.js +1 -1
  51. package/dist/esm/r-icon.entry.js +1 -1
  52. package/dist/esm/r-input-code.entry.js +29 -16
  53. package/dist/esm/r-input-date.entry.js +85 -15
  54. package/dist/esm/r-input-password.entry.js +20 -7
  55. package/dist/esm/r-input-phone-number.entry.js +27 -14
  56. package/dist/esm/r-input.entry.js +24 -11
  57. package/dist/esm/r-pagination.entry.js +1 -1
  58. package/dist/esm/r-popover-action.entry.js +1 -1
  59. package/dist/esm/r-popover.entry.js +1 -1
  60. package/dist/esm/r-radio-group.entry.js +20 -16
  61. package/dist/esm/r-select.entry.js +112 -18
  62. package/dist/esm/r-textarea.entry.js +18 -5
  63. package/dist/esm/r-toast.entry.js +50 -19
  64. package/dist/esm/web-components.js +1 -1
  65. package/dist/types/components/alert/alert.d.ts +3 -0
  66. package/dist/types/components/alert/exports.d.ts +1 -1
  67. package/dist/types/components/checkbox/checkbox.d.ts +5 -0
  68. package/dist/types/components/checkbox-group/checkbox-group.d.ts +6 -0
  69. package/dist/types/components/input/input.d.ts +5 -0
  70. package/dist/types/components/input-code/input-code.d.ts +5 -0
  71. package/dist/types/components/input-date/input-date.d.ts +30 -0
  72. package/dist/types/components/input-password/input-password.d.ts +5 -0
  73. package/dist/types/components/input-phone-number/input-phone-number.d.ts +5 -0
  74. package/dist/types/components/radio-group/radio-group.d.ts +1 -2
  75. package/dist/types/components/select/select.d.ts +34 -2
  76. package/dist/types/components/textarea/textarea.d.ts +5 -0
  77. package/dist/types/components/toast/toast.d.ts +10 -2
  78. package/dist/types/components.d.ts +143 -8
  79. package/dist/web-components/bundled-icons/riverty-kit.json +1 -1
  80. package/dist/web-components/p-15ac0fdd.entry.js +1 -0
  81. package/dist/web-components/p-1c956370.entry.js +1 -0
  82. package/dist/web-components/p-2a512983.entry.js +1 -0
  83. package/dist/web-components/p-2e18e762.entry.js +1 -0
  84. package/dist/web-components/{p-72c0c0d8.entry.js → p-3078b2b8.entry.js} +1 -1
  85. package/dist/web-components/p-56da04d8.entry.js +1 -0
  86. package/dist/web-components/p-5744d75c.entry.js +1 -0
  87. package/dist/web-components/p-5bbd6e3c.entry.js +1 -0
  88. package/dist/web-components/p-5e6aabd8.entry.js +1 -0
  89. package/dist/web-components/p-656229de.entry.js +1 -0
  90. package/dist/web-components/p-6a4f3836.entry.js +1 -0
  91. package/dist/web-components/p-7775228c.entry.js +1 -0
  92. package/dist/web-components/p-8563a1ab.entry.js +1 -0
  93. package/dist/web-components/p-ad9b2a48.entry.js +1 -0
  94. package/dist/web-components/p-b87ad83b.entry.js +1 -0
  95. package/dist/web-components/{p-77155630.entry.js → p-b98ab649.entry.js} +1 -1
  96. package/dist/web-components/p-dbe579e8.entry.js +1 -0
  97. package/dist/web-components/p-f2577a3c.entry.js +1 -0
  98. package/dist/web-components/web-components.esm.js +1 -1
  99. package/package.json +1 -1
  100. package/dist/web-components/p-289eb4b0.entry.js +0 -1
  101. package/dist/web-components/p-2b8e12ae.entry.js +0 -1
  102. package/dist/web-components/p-2e2c8a5b.entry.js +0 -1
  103. package/dist/web-components/p-3a39932b.entry.js +0 -1
  104. package/dist/web-components/p-44be9992.entry.js +0 -1
  105. package/dist/web-components/p-4652635a.entry.js +0 -1
  106. package/dist/web-components/p-63474b32.entry.js +0 -1
  107. package/dist/web-components/p-74d2a563.entry.js +0 -1
  108. package/dist/web-components/p-8028c2a9.entry.js +0 -1
  109. package/dist/web-components/p-96ddeb7f.entry.js +0 -1
  110. package/dist/web-components/p-9d898089.entry.js +0 -1
  111. package/dist/web-components/p-9eb1f262.entry.js +0 -1
  112. package/dist/web-components/p-c300c22f.entry.js +0 -1
  113. package/dist/web-components/p-d93c240d.entry.js +0 -1
  114. package/dist/web-components/p-f770e22b.entry.js +0 -1
  115. package/dist/web-components/p-f952161b.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as n,h as a,H as o,g as t}from"./p-Da7qOBFr.js";import{a as h}from"./p-DvLT8-y3.js";var i,_={},l={};function r(){return i||(i=1,Object.defineProperty(l,"__esModule",{value:!0}),l.default=[{alpha2:"US",alpha3:"USA",country_code:"1",country_name:"United States",mobile_begin_with:["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","220","223","224","225","227","228","229","231","234","239","240","248","251","252","253","254","256","260","262","267","269","270","272","274","276","278","281","283","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","327","329","330","331","332","334","336","337","339","341","346","347","351","352","353","360","361","364","369","380","385","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","424","425","430","432","434","435","440","441","442","443","445","447","458","463","464","469","470","472","475","478","479","480","484","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","531","534","539","540","541","551","557","559","561","562","563","564","567","570","571","572","573","574","575","580","582","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","627","628","629","630","631","636","640","641","645","646","650","651","656","657","659","660","661","662","667","669","678","679","680","681","682","689","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","720","724","725","726","727","728","730","731","732","734","737","740","743","747","752","754","757","760","762","763","764","765","769","770","771","772","773","774","775","779","781","785","786","787","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","820","828","830","831","832","835","838","840","843","845","847","848","850","854","856","857","858","859","860","862","863","864","865","870","872","878","901","903","904","906","907","908","909","910","912","913","914","915","916","917","918","919","920","925","927","928","929","930","931","934","935","936","937","938","939","940","941","945","947","949","951","952","954","956","957","959","970","971","972","973","975","978","979","980","984","985","986","989","888","800","833","844","855","866","877","279","340","983","448","943","363","326","839","826","948","924"],phone_number_lengths:[10]},{alpha2:"AW",alpha3:"ABW",country_code:"297",country_name:"Aruba",mobile_begin_with:["56","59","64","73","74","99"],phone_number_lengths:[7]},{alpha2:"AF",alpha3:"AFG",country_code:"93",country_name:"Afghanistan",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"AO",alpha3:"AGO",country_code:"244",country_name:"Angola",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"AI",alpha3:"AIA",country_code:"1",country_name:"Anguilla",mobile_begin_with:["2642","2644","2645","2647"],phone_number_lengths:[10]},{alpha2:"AX",alpha3:"ALA",country_code:"358",country_name:"Åland Islands",mobile_begin_with:["18"],phone_number_lengths:[6,7,8]},{alpha2:"AL",alpha3:"ALB",country_code:"355",country_name:"Albania",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"AD",alpha3:"AND",country_code:"376",country_name:"Andorra",mobile_begin_with:["3","4","6"],phone_number_lengths:[6]},{alpha2:"BQ",alpha3:"BES",country_code:"599",country_name:"Caribbean Netherlands",mobile_begin_with:["3","416","700","701","795"],phone_number_lengths:[7]},{alpha2:"AE",alpha3:"ARE",country_code:"971",country_name:"United Arab Emirates",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"AR",alpha3:"ARG",country_code:"54",country_name:"Argentina",mobile_begin_with:["1","2","3"],phone_number_lengths:[8,9,10,11,12]},{alpha2:"AM",alpha3:"ARM",country_code:"374",country_name:"Armenia",mobile_begin_with:["3","4","5","7","9"],phone_number_lengths:[8]},{alpha2:"AS",alpha3:"ASM",country_code:"1",country_name:"American Samoa",mobile_begin_with:["684733","684258"],phone_number_lengths:[10]},{alpha2:"AG",alpha3:"ATG",country_code:"1",country_name:"Antigua and Barbuda",mobile_begin_with:["2687"],phone_number_lengths:[10]},{alpha2:"AU",alpha3:"AUS",country_code:"61",country_name:"Australia",mobile_begin_with:["4"],phone_number_lengths:[9]},{alpha2:"AT",alpha3:"AUT",country_code:"43",country_name:"Austria",mobile_begin_with:["6"],phone_number_lengths:[10,11,12,13,14]},{alpha2:"AZ",alpha3:"AZE",country_code:"994",country_name:"Azerbaijan",mobile_begin_with:["10","50","51","55","60","70","77","99"],phone_number_lengths:[9]},{alpha2:"BI",alpha3:"BDI",country_code:"257",country_name:"Burundi",mobile_begin_with:["71","72","75","76","77","79","29","61","68","69"],phone_number_lengths:[8]},{alpha2:"BE",alpha3:"BEL",country_code:"32",country_name:"Belgium",mobile_begin_with:["4","3"],phone_number_lengths:[9,8]},{alpha2:"BJ",alpha3:"BEN",country_code:"229",country_name:"Benin",mobile_begin_with:["4","6","9"],phone_number_lengths:[8]},{alpha2:"BF",alpha3:"BFA",country_code:"226",country_name:"Burkina Faso",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"BD",alpha3:"BGD",country_code:"880",country_name:"Bangladesh",mobile_begin_with:["1"],phone_number_lengths:[8,9,10]},{alpha2:"BG",alpha3:"BGR",country_code:"359",country_name:"Bulgaria",mobile_begin_with:["87","88","89","98","99","43"],phone_number_lengths:[8,9]},{alpha2:"BH",alpha3:"BHR",country_code:"973",country_name:"Bahrain",mobile_begin_with:["3"],phone_number_lengths:[8]},{alpha2:"BS",alpha3:"BHS",country_code:"1",country_name:"Bahamas",mobile_begin_with:["242"],phone_number_lengths:[10]},{alpha2:"BA",alpha3:"BIH",country_code:"387",country_name:"Bosnia and Herzegovina",mobile_begin_with:["6"],phone_number_lengths:[8,9]},{alpha2:"BY",alpha3:"BLR",country_code:"375",country_name:"Belarus",mobile_begin_with:["25","29","33","44"],phone_number_lengths:[9]},{alpha2:"BZ",alpha3:"BLZ",country_code:"501",country_name:"Belize",mobile_begin_with:["6"],phone_number_lengths:[7]},{alpha2:"BM",alpha3:"BMU",country_code:"1",country_name:"Bermuda",mobile_begin_with:["4413","4415","4417"],phone_number_lengths:[10]},{alpha2:"BO",alpha3:"BOL",country_code:"591",country_name:"Bolivia",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"BR",alpha3:"BRA",country_code:"55",country_name:"Brazil",mobile_begin_with:["119","129","139","149","159","169","179","189","199","219","229","249","279","289","319","329","339","349","359","379","389","419","429","439","449","459","469","479","489","499","519","539","549","559","619","629","639","649","659","669","679","689","699","719","739","749","759","779","799","819","829","839","849","859","869","879","889","899","919","929","939","949","959","969","979","989","999"],phone_number_lengths:[10,11]},{alpha2:"BB",alpha3:"BRB",country_code:"1",country_name:"Barbados",mobile_begin_with:["246"],phone_number_lengths:[10]},{alpha2:"BN",alpha3:"BRN",country_code:"673",country_name:"Brunei Darussalam",mobile_begin_with:["7","8"],phone_number_lengths:[7]},{alpha2:"BT",alpha3:"BTN",country_code:"975",country_name:"Bhutan",mobile_begin_with:["17"],phone_number_lengths:[8]},{alpha2:"BW",alpha3:"BWA",country_code:"267",country_name:"Botswana",mobile_begin_with:["71","72","73","74","75","76","77","78","79"],phone_number_lengths:[8]},{alpha2:"CF",alpha3:"CAF",country_code:"236",country_name:"Central African Republic",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"CA",alpha3:"CAN",country_code:"1",country_name:"Canada",mobile_begin_with:["204","226","236","249","250","263","289","306","343","354","365","367","368","403","416","418","431","437","438","450","468","474","506","514","519","548","579","581","584","587","600","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905","428","382","942"],phone_number_lengths:[10]},{alpha2:"CH",alpha3:"CHE",country_code:"41",country_name:"Switzerland",mobile_begin_with:["74","75","76","77","78","79"],phone_number_lengths:[9]},{alpha2:"CL",alpha3:"CHL",country_code:"56",country_name:"Chile",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"CN",alpha3:"CHN",country_code:"86",country_name:"China",mobile_begin_with:["13","14","15","17","18","19","16"],phone_number_lengths:[11]},{alpha2:"CI",alpha3:"CIV",country_code:"225",country_name:"Côte D'Ivoire",mobile_begin_with:["0","4","5","6","7","8"],phone_number_lengths:[10]},{alpha2:"CM",alpha3:"CMR",country_code:"237",country_name:"Cameroon",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"CD",alpha3:"COD",country_code:"243",country_name:"Congo, The Democratic Republic Of The",mobile_begin_with:["8","9"],phone_number_lengths:[9]},{alpha2:"CG",alpha3:"COG",country_code:"242",country_name:"Congo",mobile_begin_with:["0"],phone_number_lengths:[9]},{alpha2:"CK",alpha3:"COK",country_code:"682",country_name:"Cook Islands",mobile_begin_with:["5","7"],phone_number_lengths:[5]},{alpha2:"CO",alpha3:"COL",country_code:"57",country_name:"Colombia",mobile_begin_with:["3"],phone_number_lengths:[10]},{alpha2:"CW",alpha3:"CUW",country_code:"599",country_name:"Curaçao",mobile_begin_with:["95","96"],phone_number_lengths:[8]},{alpha2:"KM",alpha3:"COM",country_code:"269",country_name:"Comoros",mobile_begin_with:["3","76"],phone_number_lengths:[7]},{alpha2:"CV",alpha3:"CPV",country_code:"238",country_name:"Cape Verde",mobile_begin_with:["5","9"],phone_number_lengths:[7]},{alpha2:"CR",alpha3:"CRI",country_code:"506",country_name:"Costa Rica",mobile_begin_with:["5","6","7","8"],phone_number_lengths:[8]},{alpha2:"CU",alpha3:"CUB",country_code:"53",country_name:"Cuba",mobile_begin_with:["5","6"],phone_number_lengths:[8]},{alpha2:"KY",alpha3:"CYM",country_code:"1",country_name:"Cayman Islands",mobile_begin_with:["345"],phone_number_lengths:[10]},{alpha2:"CY",alpha3:"CYP",country_code:"357",country_name:"Cyprus",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"CZ",alpha3:"CZE",country_code:"420",country_name:"Czech Republic",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"DE",alpha3:"DEU",country_code:"49",country_name:"Germany",mobile_begin_with:["15","16","17"],phone_number_lengths:[10,11]},{alpha2:"DJ",alpha3:"DJI",country_code:"253",country_name:"Djibouti",mobile_begin_with:["77"],phone_number_lengths:[8]},{alpha2:"DM",alpha3:"DMA",country_code:"1",country_name:"Dominica",mobile_begin_with:["767"],phone_number_lengths:[10]},{alpha2:"DK",alpha3:"DNK",country_code:"45",country_name:"Denmark",mobile_begin_with:["2","30","31","40","41","42","50","51","52","53","60","61","71","81","91","92","93","342","344","345","346","347","348","349","356","357","359","362","365","366","389","398","431","441","462","466","468","472","474","476","478","485","486","488","489","493","494","495","496","498","499","542","543","545","551","552","556","571","572","573","574","577","579","584","586","587","589","597","598","627","629","641","649","658","662","663","664","665","667","692","693","694","697","771","772","782","783","785","786","788","789","826","827","829"],phone_number_lengths:[8]},{alpha2:"DO",alpha3:"DOM",country_code:"1",country_name:"Dominican Republic",mobile_begin_with:["809","829","849"],phone_number_lengths:[10]},{alpha2:"DZ",alpha3:"DZA",country_code:"213",country_name:"Algeria",mobile_begin_with:["5","6","7"],phone_number_lengths:[9]},{alpha2:"EC",alpha3:"ECU",country_code:"593",country_name:"Ecuador",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"EG",alpha3:"EGY",country_code:"20",country_name:"Egypt",mobile_begin_with:["1"],phone_number_lengths:[10,8]},{alpha2:"ER",alpha3:"ERI",country_code:"291",country_name:"Eritrea",mobile_begin_with:["1","7","8"],phone_number_lengths:[7]},{alpha2:"ES",alpha3:"ESP",country_code:"34",country_name:"Spain",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"EE",alpha3:"EST",country_code:"372",country_name:"Estonia",mobile_begin_with:["5","81","82","83"],phone_number_lengths:[7,8]},{alpha2:"ET",alpha3:"ETH",country_code:"251",country_name:"Ethiopia",mobile_begin_with:["7","9"],phone_number_lengths:[9]},{alpha2:"FI",alpha3:"FIN",country_code:"358",country_name:"Finland",mobile_begin_with:["4","5"],phone_number_lengths:[6,7,9,10]},{alpha2:"FJ",alpha3:"FJI",country_code:"679",country_name:"Fiji",mobile_begin_with:["2","7","8","9"],phone_number_lengths:[7]},{alpha2:"FK",alpha3:"FLK",country_code:"500",country_name:"Falkland Islands (Malvinas)",mobile_begin_with:["5","6"],phone_number_lengths:[5]},{alpha2:"FR",alpha3:"FRA",country_code:"33",country_name:"France",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"FO",alpha3:"FRO",country_code:"298",country_name:"Faroe Islands",mobile_begin_with:[],phone_number_lengths:[6]},{alpha2:"FM",alpha3:"FSM",country_code:"691",country_name:"Micronesia, Federated States Of",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"GA",alpha3:"GAB",country_code:"241",country_name:"Gabon",mobile_begin_with:["2","3","4","5","6","7"],phone_number_lengths:[7]},{alpha2:"GB",alpha3:"GBR",country_code:"44",country_name:"United Kingdom",mobile_begin_with:["7"],phone_number_lengths:[10]},{alpha2:"GE",alpha3:"GEO",country_code:"995",country_name:"Georgia",mobile_begin_with:["5","7"],phone_number_lengths:[9]},{alpha2:"GH",alpha3:"GHA",country_code:"233",country_name:"Ghana",mobile_begin_with:["2","5"],phone_number_lengths:[9]},{alpha2:"GI",alpha3:"GIB",country_code:"350",country_name:"Gibraltar",mobile_begin_with:["5"],phone_number_lengths:[8]},{alpha2:"GN",alpha3:"GIN",country_code:"224",country_name:"Guinea",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"GP",alpha3:"GLP",country_code:"590",country_name:"Guadeloupe",mobile_begin_with:["690","691"],phone_number_lengths:[9]},{alpha2:"GM",alpha3:"GMB",country_code:"220",country_name:"Gambia",mobile_begin_with:["7","9"],phone_number_lengths:[7]},{alpha2:"GW",alpha3:"GNB",country_code:"245",country_name:"Guinea-Bissau",mobile_begin_with:["5","6","7"],phone_number_lengths:[7]},{alpha2:"GQ",alpha3:"GNQ",country_code:"240",country_name:"Equatorial Guinea",mobile_begin_with:["222","551"],phone_number_lengths:[9]},{alpha2:"GR",alpha3:"GRC",country_code:"30",country_name:"Greece",mobile_begin_with:["6"],phone_number_lengths:[10]},{alpha2:"GD",alpha3:"GRD",country_code:"1",country_name:"Grenada",mobile_begin_with:["473"],phone_number_lengths:[10]},{alpha2:"GL",alpha3:"GRL",country_code:"299",country_name:"Greenland",mobile_begin_with:["2","4","5"],phone_number_lengths:[6]},{alpha2:"GT",alpha3:"GTM",country_code:"502",country_name:"Guatemala",mobile_begin_with:["3","4","5"],phone_number_lengths:[8]},{alpha2:"GF",alpha3:"GUF",country_code:"594",country_name:"French Guiana",mobile_begin_with:["694"],phone_number_lengths:[9]},{alpha2:"GU",alpha3:"GUM",country_code:"1",country_name:"Guam",mobile_begin_with:["671"],phone_number_lengths:[10]},{alpha2:"GY",alpha3:"GUY",country_code:"592",country_name:"Guyana",mobile_begin_with:["6"],phone_number_lengths:[7]},{alpha2:"HK",alpha3:"HKG",country_code:"852",country_name:"Hong Kong",mobile_begin_with:["4","5","6","70","71","72","73","81","82","83","84","85","86","87","88","89","9"],phone_number_lengths:[8]},{alpha2:"HN",alpha3:"HND",country_code:"504",country_name:"Honduras",mobile_begin_with:["3","7","8","9"],phone_number_lengths:[8]},{alpha2:"HR",alpha3:"HRV",country_code:"385",country_name:"Croatia",mobile_begin_with:["9"],phone_number_lengths:[8,9]},{alpha2:"HT",alpha3:"HTI",country_code:"509",country_name:"Haiti",mobile_begin_with:["3","4"],phone_number_lengths:[8]},{alpha2:"HU",alpha3:"HUN",country_code:"36",country_name:"Hungary",mobile_begin_with:["20","30","31","50","70"],phone_number_lengths:[9]},{alpha2:"ID",alpha3:"IDN",country_code:"62",country_name:"Indonesia",mobile_begin_with:["8"],phone_number_lengths:[9,10,11,12]},{alpha2:"IN",alpha3:"IND",country_code:"91",country_name:"India",mobile_begin_with:["6","7","8","9"],phone_number_lengths:[10]},{alpha2:"IE",alpha3:"IRL",country_code:"353",country_name:"Ireland",mobile_begin_with:["82","83","84","85","86","87","88","89"],phone_number_lengths:[9]},{alpha2:"IR",alpha3:"IRN",country_code:"98",country_name:"Iran, Islamic Republic Of",mobile_begin_with:["9"],phone_number_lengths:[10]},{alpha2:"IQ",alpha3:"IRQ",country_code:"964",country_name:"Iraq",mobile_begin_with:["7"],phone_number_lengths:[10]},{alpha2:"IS",alpha3:"ISL",country_code:"354",country_name:"Iceland",mobile_begin_with:["6","7","8"],phone_number_lengths:[7]},{alpha2:"IL",alpha3:"ISR",country_code:"972",country_name:"Israel",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"IT",alpha3:"ITA",country_code:"39",country_name:"Italy",mobile_begin_with:["3"],phone_number_lengths:[9,10]},{alpha2:"JM",alpha3:"JAM",country_code:"1",country_name:"Jamaica",mobile_begin_with:["876"],phone_number_lengths:[10]},{alpha2:"JO",alpha3:"JOR",country_code:"962",country_name:"Jordan",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"JP",alpha3:"JPN",country_code:"81",country_name:"Japan",mobile_begin_with:["70","80","90"],phone_number_lengths:[10]},{alpha2:"KZ",alpha3:"KAZ",country_code:"7",country_name:"Kazakhstan",mobile_begin_with:["70","74","77"],phone_number_lengths:[10]},{alpha2:"KE",alpha3:"KEN",country_code:"254",country_name:"Kenya",mobile_begin_with:["7","1"],phone_number_lengths:[9]},{alpha2:"KG",alpha3:"KGZ",country_code:"996",country_name:"Kyrgyzstan",mobile_begin_with:["20","22","31258","312973","5","600","7","88","912","99"],phone_number_lengths:[9]},{alpha2:"KH",alpha3:"KHM",country_code:"855",country_name:"Cambodia",mobile_begin_with:["1","6","7","8","9"],phone_number_lengths:[8,9]},{alpha2:"KI",alpha3:"KIR",country_code:"686",country_name:"Kiribati",mobile_begin_with:["9","30"],phone_number_lengths:[5]},{alpha2:"KN",alpha3:"KNA",country_code:"1",country_name:"Saint Kitts And Nevis",mobile_begin_with:["869"],phone_number_lengths:[10]},{alpha2:"KR",alpha3:"KOR",country_code:"82",country_name:"Korea, Republic of",mobile_begin_with:["1"],phone_number_lengths:[9,10]},{alpha2:"XK",alpha3:"XKX",country_code:"383",country_name:"Kosovo, Republic of",mobile_begin_with:["43","44","45","46","47","48","49"],phone_number_lengths:[8]},{alpha2:"KW",alpha3:"KWT",country_code:"965",country_name:"Kuwait",mobile_begin_with:["5","6","9"],phone_number_lengths:[8]},{alpha2:"LA",alpha3:"LAO",country_code:"856",country_name:"Lao People's Democratic Republic",mobile_begin_with:["20"],phone_number_lengths:[10]},{alpha2:"LB",alpha3:"LBN",country_code:"961",country_name:"Lebanon",mobile_begin_with:["3","7","8"],phone_number_lengths:[7,8]},{alpha2:"LR",alpha3:"LBR",country_code:"231",country_name:"Liberia",mobile_begin_with:["4","5","6","7"],phone_number_lengths:[7,8]},{alpha2:"LY",alpha3:"LBY",country_code:"218",country_name:"Libyan Arab Jamahiriya",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"LC",alpha3:"LCA",country_code:"1",country_name:"Saint Lucia",mobile_begin_with:["758"],phone_number_lengths:[10]},{alpha2:"LI",alpha3:"LIE",country_code:"423",country_name:"Liechtenstein",mobile_begin_with:["7"],phone_number_lengths:[7]},{alpha2:"LK",alpha3:"LKA",country_code:"94",country_name:"Sri Lanka",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"LS",alpha3:"LSO",country_code:"266",country_name:"Lesotho",mobile_begin_with:["5","6"],phone_number_lengths:[8]},{alpha2:"LT",alpha3:"LTU",country_code:"370",country_name:"Lithuania",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"LU",alpha3:"LUX",country_code:"352",country_name:"Luxembourg",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"LV",alpha3:"LVA",country_code:"371",country_name:"Latvia",mobile_begin_with:["2"],phone_number_lengths:[8]},{alpha2:"MO",alpha3:"MAC",country_code:"853",country_name:"Macao",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"MA",alpha3:"MAR",country_code:"212",country_name:"Morocco",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"MC",alpha3:"MCO",country_code:"377",country_name:"Monaco",mobile_begin_with:["4","6"],phone_number_lengths:[8,9]},{alpha2:"MD",alpha3:"MDA",country_code:"373",country_name:"Moldova, Republic of",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"MG",alpha3:"MDG",country_code:"261",country_name:"Madagascar",mobile_begin_with:["3"],phone_number_lengths:[9]},{alpha2:"MV",alpha3:"MDV",country_code:"960",country_name:"Maldives",mobile_begin_with:["7","9"],phone_number_lengths:[7]},{alpha2:"MX",alpha3:"MEX",country_code:"52",country_name:"Mexico",mobile_begin_with:[""],phone_number_lengths:[10,11]},{alpha2:"MH",alpha3:"MHL",country_code:"692",country_name:"Marshall Islands",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"MK",alpha3:"MKD",country_code:"389",country_name:"Macedonia, the Former Yugoslav Republic Of",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"ML",alpha3:"MLI",country_code:"223",country_name:"Mali",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"MT",alpha3:"MLT",country_code:"356",country_name:"Malta",mobile_begin_with:["7","9"],phone_number_lengths:[8]},{alpha2:"MM",alpha3:"MMR",country_code:"95",country_name:"Myanmar",mobile_begin_with:["9"],phone_number_lengths:[8,9,10]},{alpha2:"ME",alpha3:"MNE",country_code:"382",country_name:"Montenegro",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"MN",alpha3:"MNG",country_code:"976",country_name:"Mongolia",mobile_begin_with:["5","8","9"],phone_number_lengths:[8]},{alpha2:"MP",alpha3:"MNP",country_code:"1",country_name:"Northern Mariana Islands",mobile_begin_with:["670"],phone_number_lengths:[10]},{alpha2:"MZ",alpha3:"MOZ",country_code:"258",country_name:"Mozambique",mobile_begin_with:["8"],phone_number_lengths:[9]},{alpha2:"MR",alpha3:"MRT",country_code:"222",country_name:"Mauritania",mobile_begin_with:[],phone_number_lengths:[8]},{alpha2:"MS",alpha3:"MSR",country_code:"1",country_name:"Montserrat",mobile_begin_with:["664"],phone_number_lengths:[10]},{alpha2:"MQ",alpha3:"MTQ",country_code:"596",country_name:"Martinique",mobile_begin_with:["696","697"],phone_number_lengths:[9]},{alpha2:"MU",alpha3:"MUS",country_code:"230",country_name:"Mauritius",mobile_begin_with:["5"],phone_number_lengths:[8]},{alpha2:"MW",alpha3:"MWI",country_code:"265",country_name:"Malawi",mobile_begin_with:["77","88","99"],phone_number_lengths:[9]},{alpha2:"MY",alpha3:"MYS",country_code:"60",country_name:"Malaysia",mobile_begin_with:["1","6"],phone_number_lengths:[9,10,8]},{alpha2:"YT",alpha3:"MYT",country_code:"262",country_name:"Mayotte",mobile_begin_with:["639"],phone_number_lengths:[9]},{alpha2:"NA",alpha3:"NAM",country_code:"264",country_name:"Namibia",mobile_begin_with:["60","81","82","85"],phone_number_lengths:[9]},{alpha2:"NC",alpha3:"NCL",country_code:"687",country_name:"New Caledonia",mobile_begin_with:["5","7","8","9"],phone_number_lengths:[6]},{alpha2:"NE",alpha3:"NER",country_code:"227",country_name:"Niger",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"NF",alpha3:"NFK",country_code:"672",country_name:"Norfolk Island",mobile_begin_with:["5","8"],phone_number_lengths:[5]},{alpha2:"NG",alpha3:"NGA",country_code:"234",country_name:"Nigeria",mobile_begin_with:["70","80","81","90","91"],phone_number_lengths:[10]},{alpha2:"NI",alpha3:"NIC",country_code:"505",country_name:"Nicaragua",mobile_begin_with:["7","8"],phone_number_lengths:[8]},{alpha2:"NU",alpha3:"NIU",country_code:"683",country_name:"Niue",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"NL",alpha3:"NLD",country_code:"31",country_name:"Netherlands",mobile_begin_with:["6","97"],phone_number_lengths:[9,11]},{alpha2:"NO",alpha3:"NOR",country_code:"47",country_name:"Norway",mobile_begin_with:["4","9"],phone_number_lengths:[8]},{alpha2:"NP",alpha3:"NPL",country_code:"977",country_name:"Nepal",mobile_begin_with:["97","98"],phone_number_lengths:[10]},{alpha2:"NR",alpha3:"NRU",country_code:"674",country_name:"Nauru",mobile_begin_with:["555"],phone_number_lengths:[7]},{alpha2:"NZ",alpha3:"NZL",country_code:"64",country_name:"New Zealand",mobile_begin_with:["2"],phone_number_lengths:[8,9,10]},{alpha2:"OM",alpha3:"OMN",country_code:"968",country_name:"Oman",mobile_begin_with:["7","9"],phone_number_lengths:[8]},{alpha2:"PK",alpha3:"PAK",country_code:"92",country_name:"Pakistan",mobile_begin_with:["3"],phone_number_lengths:[10]},{alpha2:"PA",alpha3:"PAN",country_code:"507",country_name:"Panama",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"PE",alpha3:"PER",country_code:"51",country_name:"Peru",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PH",alpha3:"PHL",country_code:"63",country_name:"Philippines",mobile_begin_with:["9"],phone_number_lengths:[10]},{alpha2:"PW",alpha3:"PLW",country_code:"680",country_name:"Palau",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"PG",alpha3:"PNG",country_code:"675",country_name:"Papua New Guinea",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"PL",alpha3:"POL",country_code:"48",country_name:"Poland",mobile_begin_with:["4","5","6","7","8"],phone_number_lengths:[9]},{alpha2:"PR",alpha3:"PRI",country_code:"1",country_name:"Puerto Rico",mobile_begin_with:["787","939"],phone_number_lengths:[10]},{alpha2:"PT",alpha3:"PRT",country_code:"351",country_name:"Portugal",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PY",alpha3:"PRY",country_code:"595",country_name:"Paraguay",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PS",alpha3:"PSE",country_code:"970",country_name:"Palestinian Territory, Occupied",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"PF",alpha3:"PYF",country_code:"689",country_name:"French Polynesia",mobile_begin_with:["8"],phone_number_lengths:[8]},{alpha2:"QA",alpha3:"QAT",country_code:"974",country_name:"Qatar",mobile_begin_with:["3","5","6","7"],phone_number_lengths:[8]},{alpha2:"RE",alpha3:"REU",country_code:"262",country_name:"Réunion",mobile_begin_with:["692","693"],phone_number_lengths:[9]},{alpha2:"RO",alpha3:"ROU",country_code:"40",country_name:"Romania",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"RU",alpha3:"RUS",country_code:"7",country_name:"Russian Federation",mobile_begin_with:["9","495","498","499","835"],phone_number_lengths:[10]},{alpha2:"RW",alpha3:"RWA",country_code:"250",country_name:"Rwanda",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SA",alpha3:"SAU",country_code:"966",country_name:"Saudi Arabia",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"SD",alpha3:"SDN",country_code:"249",country_name:"Sudan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SS",alpha3:"SSD",country_code:"211",country_name:"South Sudan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SN",alpha3:"SEN",country_code:"221",country_name:"Senegal",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SG",alpha3:"SGP",country_code:"65",country_name:"Singapore",mobile_begin_with:["8","9"],phone_number_lengths:[8]},{alpha2:"SH",alpha3:"SHN",country_code:"290",country_name:"Saint Helena",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"SJ",alpha3:"SJM",country_code:"47",country_name:"Svalbard And Jan Mayen",mobile_begin_with:["79"],phone_number_lengths:[8]},{alpha2:"SB",alpha3:"SLB",country_code:"677",country_name:"Solomon Islands",mobile_begin_with:["7","8"],phone_number_lengths:[7]},{alpha2:"SL",alpha3:"SLE",country_code:"232",country_name:"Sierra Leone",mobile_begin_with:["21","25","30","33","34","40","44","50","55","76","77","78","79","88"],phone_number_lengths:[8]},{alpha2:"SV",alpha3:"SLV",country_code:"503",country_name:"El Salvador",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"SM",alpha3:"SMR",country_code:"378",country_name:"San Marino",mobile_begin_with:["3","6"],phone_number_lengths:[10]},{alpha2:"SO",alpha3:"SOM",country_code:"252",country_name:"Somalia",mobile_begin_with:["61","62","63","65","66","68","69","71","90"],phone_number_lengths:[9]},{alpha2:"SX",alpha3:"SXM",country_code:"1",country_name:"Sint Maarten",mobile_begin_with:["721"],phone_number_lengths:[10]},{alpha2:"PM",alpha3:"SPM",country_code:"508",country_name:"Saint Pierre And Miquelon",mobile_begin_with:["55","41"],phone_number_lengths:[6]},{alpha2:"RS",alpha3:"SRB",country_code:"381",country_name:"Serbia",mobile_begin_with:["6"],phone_number_lengths:[8,9]},{alpha2:"ST",alpha3:"STP",country_code:"239",country_name:"Sao Tome and Principe",mobile_begin_with:["98","99"],phone_number_lengths:[7]},{alpha2:"SR",alpha3:"SUR",country_code:"597",country_name:"Suriname",mobile_begin_with:["6","7","8"],phone_number_lengths:[7]},{alpha2:"SK",alpha3:"SVK",country_code:"421",country_name:"Slovakia",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SI",alpha3:"SVN",country_code:"386",country_name:"Slovenia",mobile_begin_with:["3","4","5","6","7"],phone_number_lengths:[8]},{alpha2:"SE",alpha3:"SWE",country_code:"46",country_name:"Sweden",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SZ",alpha3:"SWZ",country_code:"268",country_name:"Swaziland",mobile_begin_with:["76","77","78","79"],phone_number_lengths:[8]},{alpha2:"SC",alpha3:"SYC",country_code:"248",country_name:"Seychelles",mobile_begin_with:["2"],phone_number_lengths:[7]},{alpha2:"SY",alpha3:"SYR",country_code:"963",country_name:"Syrian Arab Republic",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TC",alpha3:"TCA",country_code:"1",country_name:"Turks and Caicos Islands",mobile_begin_with:["6492","6493","6494"],phone_number_lengths:[10]},{alpha2:"TD",alpha3:"TCD",country_code:"235",country_name:"Chad",mobile_begin_with:["6","7","9"],phone_number_lengths:[8]},{alpha2:"TG",alpha3:"TGO",country_code:"228",country_name:"Togo",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"TH",alpha3:"THA",country_code:"66",country_name:"Thailand",mobile_begin_with:["6","8","9"],phone_number_lengths:[9]},{alpha2:"TJ",alpha3:"TJK",country_code:"992",country_name:"Tajikistan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TK",alpha3:"TKL",country_code:"690",country_name:"Tokelau",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"TM",alpha3:"TKM",country_code:"993",country_name:"Turkmenistan",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"TL",alpha3:"TLS",country_code:"670",country_name:"Timor-Leste",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"TO",alpha3:"TON",country_code:"676",country_name:"Tonga",mobile_begin_with:[],phone_number_lengths:[5]},{alpha2:"TT",alpha3:"TTO",country_code:"1",country_name:"Trinidad and Tobago",mobile_begin_with:["868"],phone_number_lengths:[10]},{alpha2:"TN",alpha3:"TUN",country_code:"216",country_name:"Tunisia",mobile_begin_with:["2","4","5","9"],phone_number_lengths:[8]},{alpha2:"TR",alpha3:"TUR",country_code:"90",country_name:"Turkey",mobile_begin_with:["5"],phone_number_lengths:[10]},{alpha2:"TV",alpha3:"TUV",country_code:"688",country_name:"Tuvalu",mobile_begin_with:[],phone_number_lengths:[5]},{alpha2:"TW",alpha3:"TWN",country_code:"886",country_name:"Taiwan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TZ",alpha3:"TZA",country_code:"255",country_name:"Tanzania, United Republic of",mobile_begin_with:["7","6"],phone_number_lengths:[9]},{alpha2:"UG",alpha3:"UGA",country_code:"256",country_name:"Uganda",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"UA",alpha3:"UKR",country_code:"380",country_name:"Ukraine",mobile_begin_with:["39","50","63","66","67","68","73","75","77","9"],phone_number_lengths:[9]},{alpha2:"UY",alpha3:"URY",country_code:"598",country_name:"Uruguay",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"UZ",alpha3:"UZB",country_code:"998",country_name:"Uzbekistan",mobile_begin_with:["9","88","33"],phone_number_lengths:[9]},{alpha2:"VC",alpha3:"VCT",country_code:"1",country_name:"Saint Vincent And The Grenedines",mobile_begin_with:["784"],phone_number_lengths:[10]},{alpha2:"VE",alpha3:"VEN",country_code:"58",country_name:"Venezuela, Bolivarian Republic of",mobile_begin_with:["4"],phone_number_lengths:[10]},{alpha2:"VG",alpha3:"VGB",country_code:"1",country_name:"Virgin Islands, British",mobile_begin_with:["284"],phone_number_lengths:[10]},{alpha2:"VI",alpha3:"VIR",country_code:"1",country_name:"Virgin Islands, U.S.",mobile_begin_with:["340"],phone_number_lengths:[10]},{alpha2:"VN",alpha3:"VNM",country_code:"84",country_name:"Viet Nam",mobile_begin_with:["8","9","3","7","5"],phone_number_lengths:[9]},{alpha2:"VU",alpha3:"VUT",country_code:"678",country_name:"Vanuatu",mobile_begin_with:["5","7"],phone_number_lengths:[7]},{alpha2:"WF",alpha3:"WLF",country_code:"681",country_name:"Wallis and Futuna",mobile_begin_with:[],phone_number_lengths:[6]},{alpha2:"WS",alpha3:"WSM",country_code:"685",country_name:"Samoa",mobile_begin_with:["7"],phone_number_lengths:[7]},{alpha2:"YE",alpha3:"YEM",country_code:"967",country_name:"Yemen",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"ZA",alpha3:"ZAF",country_code:"27",country_name:"South Africa",mobile_begin_with:["1","2","3","4","5","6","7","8"],phone_number_lengths:[9]},{alpha2:"ZM",alpha3:"ZMB",country_code:"260",country_name:"Zambia",mobile_begin_with:["9","7"],phone_number_lengths:[9]},{alpha2:"ZW",alpha3:"ZWE",country_code:"263",country_name:"Zimbabwe",mobile_begin_with:["71","73","77","78"],phone_number_lengths:[9]}]),l}var u,c,p={},b=function(){if(c)return _;c=1;var e=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.countryPhoneData=void 0,_.default=o,_.phone=o;const n=e(r());_.countryPhoneData=n.default;const a=function(){if(u)return p;u=1;var e=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.findCountryPhoneDataByCountry=function(e){return e?2===e.length?n.default.find((n=>e.toUpperCase()===n.alpha2))||null:3===e.length?n.default.find((n=>e.toUpperCase()===n.alpha3))||null:n.default.find((n=>e.toUpperCase()===n.country_name.toUpperCase()))||null:n.default.find((e=>"USA"===e.alpha3))||null},p.findExactCountryPhoneData=a,p.findPossibleCountryPhoneData=o,p.findCountryPhoneDataByPhoneNumber=function(e,t){let h,i;for(const _ of n.default)e.match(new RegExp("^"+_.country_code))&&(h||(h=a(e,t,_)),i||(i=o(e,t,_)));return{exactCountryPhoneData:h,possibleCountryPhoneData:i}},p.validatePhoneISO3166=function(e,n,a,o){if(!n.phone_number_lengths)return!1;const t=e.replace(new RegExp("^"+n.country_code),"");if(o&&n&&t.length===e.length)return!1;const h=n.mobile_begin_with,i=n.phone_number_lengths.some((e=>t.length===e)),_=!h.length||h.some((e=>t.match(new RegExp("^"+e))));return i&&(!a||_)};const n=e(r());function a(e,n,a){return a.phone_number_lengths.some((n=>a.country_code.length+n===e.length))?a.mobile_begin_with.length&&n?a.mobile_begin_with.some((n=>e.match(new RegExp("^"+a.country_code+n))))?a:null:a:null}function o(e,n,a){return a.phone_number_lengths.some((n=>a.country_code.length+n+1===e.length))?a.mobile_begin_with.length&&n?a.mobile_begin_with.some((n=>e.match(new RegExp("^"+a.country_code+"\\d?"+n))))?a:void 0:a:null}return p}();function o(e,{country:n="",validateMobilePrefix:o=!0,strictDetection:t=!1}={}){const h={isValid:!1,phoneNumber:null,countryIso2:null,countryIso3:null,countryCode:null};let i="string"!=typeof e?"":e.trim();const _="string"!=typeof n?"":n.trim(),l=Boolean(i.match(/^\+/));i=i.replace(/\D/g,"");let r=(0,a.findCountryPhoneDataByCountry)(_);if(!r)return h;let u=!1;if(_)["CIV","COG"].includes(r.alpha3)||(i=i.replace(/^0+/,"")),"RUS"===r.alpha3&&11===i.length&&null!==i.match(/^89/)&&(i=i.replace(/^8+/,"")),!l&&r.phone_number_lengths.includes(i.length)&&(i=`${r.country_code}${i}`);else if(l){const{exactCountryPhoneData:e,possibleCountryPhoneData:n}=(0,a.findCountryPhoneDataByPhoneNumber)(i,o);e?r=e:n&&!t?(r=n,i=r.country_code+i.replace(new RegExp(`^${r.country_code}\\d`),"")):r=null}else-1!==r.phone_number_lengths.indexOf(i.length)&&(i=`1${i}`,u=!0);if(!r)return h;let c=(0,a.validatePhoneISO3166)(i,r,o,l);return c||u&&(r=(0,a.findCountryPhoneDataByCountry)("CAN"),c=(0,a.validatePhoneISO3166)(i,r,o,l),c)?{isValid:!0,phoneNumber:`+${i}`,countryIso2:r.alpha2,countryIso3:r.alpha3,countryCode:`+${r.country_code}`}:h}return _}();const m=class{constructor(a){e(this,a),this.rInput=n(this,"rInput"),this.rChange=n(this,"rChange"),this.rValidate=n(this,"rValidate"),this.rReset=n(this,"rReset"),this.name="phone-number",this.inputLabel="Phone number without country code",this.countryCodeLabel="Country code",this.fullPhoneNumber="",this.phoneNumber="",this.validityState="",this.validityMessage="",this.uniqueId=`r-input-phone-number-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g,""),this.initial={},this.handleOnInput=e=>{if(this.readonly)return;this.phoneNumber=e.target.value,this.fullPhoneNumber=this.phoneNumber?this.countryCode+this.phoneNumber:"";const{host:n,phoneNumber:a,countryCode:o,value:t}=this;this.rInput.emit({element:n,value:t,countryCode:o,phoneNumber:a}),this.validateFormElement(this.nativeElement)},this.handleInputOnChange=e=>{this.readonly||(this.phoneNumber=e.target.value,this.handleValueChange())},this.handleValueChange=()=>{if(this.readonly)return;this.fullPhoneNumber=this.phoneNumber?this.countryCode+this.phoneNumber:"";const{host:e,phoneNumber:n,countryCode:a,value:o}=this;this.rChange.emit({element:e,value:o,countryCode:a,phoneNumber:n}),this.validateFormElement(this.nativeElement)},this.validateFormElement=e=>{if(this.readonly)return;if(null===e)return;if(this.isNoValidate)return;if(this.error)return;this.getValidityStateData();const n="valid"===this.validityState;this.valid=n,this.invalid=!n,this.rValidate.emit({state:this.validityState,message:this.validityMessage})},this.getValidityStateData=()=>{var e,n;if(this.required||(null===(e=this.phoneNumber)||void 0===e?void 0:e.length))return(null===(n=this.phoneNumber)||void 0===n?void 0:n.length)?this.countryCode&&this.getPhoneValidationResult(this.phoneNumber,this.countryCode).isValid?void(this.validityState="valid"):(this.validityState="invalid",void(this.validityMessage=this.customErrorMessage)):(this.validityState="valueMissing",void(this.validityMessage=this.valueMissingMessage));this.validityState="valid"},this.onSubmitForm=e=>{this.isNoValidate||(this.validateFormElement(this.nativeElement),this.invalid&&(e.preventDefault(),e.stopPropagation()))},this.contributeToFormData=e=>{h(this.nativeElement||this.host,e.formData)},this.onResetForm=()=>{var e;if(this.readonly)return;this.validityState=null,this.validityMessage=null,this.phoneNumber="",this.invalid=this.initial.invalid,this.valid=!this.invalid,null===(e=this.countryCodeElement)||void 0===e||e.reset(),this.updateValues(this.initial.value);const{host:n,value:a}=this;this.rReset.emit({element:n,value:a})}}async getValue(){return this.fullPhoneNumber}async setValue(e){this.updateValues(e)}async setCustomValidity(e){this.customErrorMessage=e,this.validateFormElement(this.nativeElement)}async reportValidity(){return this.validateFormElement(this.nativeElement),"valid"===this.validityState}async reset(){this.onResetForm()}watchValueChange(e){this.updateValues(e),this.validateFormElement(this.nativeElement)}handleDisabledChange(){this.setCountryCodeElementAttributes({disabled:`${!!this.disabled}`})}handleRequiredChange(){this.setCountryCodeElementAttributes({required:`${!!this.required}`})}handleReadonlyChange(){this.setCountryCodeElementAttributes({readonly:`${!!this.readonly}`})}handleLabelChange(){this.setCountryCodeElementAttributes({label:this.countryCodeLabel})}get parentFormEl(){return this.host.closest("form")||document.querySelector(`#${this.form}`)||null}get countryCodeElement(){return this.host.querySelector("r-select")}get countryCode(){return this.host.querySelector("r-select").value||""}get ariaDescribedBy(){const e=`${this.uniqueId}-message`;return this.hint?`${this.uniqueId}-hint ${e}`:e}get hasError(){var e;return this.invalid&&!!(null===(e=this.error)||void 0===e?void 0:e.length)}get hasValidationError(){var e;return"valid"!==this.validityState&&!!(null===(e=this.validityMessage)||void 0===e?void 0:e.length)}get hasMessage(){return this.hasError||this.hasValidationError}get errorMessage(){return this.hasError&&this.error||this.hasValidationError&&this.validityMessage}get isNoValidate(){var e;return(null===(e=this.parentFormEl)||void 0===e?void 0:e.hasAttribute("novalidate"))||this.novalidate||!1}updateValues(e){var n,a;if(this.fullPhoneNumber=e||"",!e)return null===(n=this.countryCodeElement)||void 0===n||n.reset(),void(this.phoneNumber="");if(!this.getPhoneValidationResult(e).isValid)return void console.error("Provided phone number is not valid");const o=this.getPhoneValidationResult(e).countryCode;this.phoneNumber=e.replace(o,""),null===(a=this.countryCodeElement)||void 0===a||a.setValue(o)}setCountryCodeElementAttributes(e){Object.entries(e||{}).forEach((([e,n])=>{var a,o;!1===n||null==n?null===(a=this.countryCodeElement)||void 0===a||a.removeAttribute(e):null===(o=this.countryCodeElement)||void 0===o||o.setAttribute(e,String(n))}))}getPhoneValidationResult(e,n=""){return b.phone(n+e,{validateMobilePrefix:!1})}connectEventListeners(){var e,n,a,o;null===(e=this.countryCodeElement)||void 0===e||e.addEventListener("rChange",this.handleValueChange),null===(n=this.parentFormEl)||void 0===n||n.addEventListener("formdata",this.contributeToFormData),null===(a=this.parentFormEl)||void 0===a||a.addEventListener("submit",this.onSubmitForm,{capture:!0}),null===(o=this.parentFormEl)||void 0===o||o.addEventListener("reset",this.onResetForm)}disconnectEventListeners(){var e,n,a,o;null===(e=this.countryCodeElement)||void 0===e||e.removeEventListener("rChange",this.handleValueChange),null===(n=this.parentFormEl)||void 0===n||n.removeEventListener("formdata",this.contributeToFormData),null===(a=this.parentFormEl)||void 0===a||a.removeEventListener("submit",this.onSubmitForm),null===(o=this.parentFormEl)||void 0===o||o.removeEventListener("reset",this.onResetForm)}componentWillLoad(){this.initial.value=this.value,this.initial.invalid=this.invalid,this.updateValues(this.value);const e={disabled:`${!!this.disabled}`,required:`${!!this.required}`,readonly:`${!!this.readonly}`,label:this.countryCodeLabel};this.setCountryCodeElementAttributes(Object.assign(Object.assign({},{"show-leading-icon":"true","leading-icon":"globe",placeholder:"+00",internal:"true"}),e))}componentDidLoad(){this.connectEventListeners()}disconnectedCallback(){this.disconnectEventListeners()}render(){const{label:e,fieldIndicator:n,hint:t,name:h,form:i,inputLabel:_,tooltip:l,tooltipIcon:r,tooltipIconColor:u,disabled:c,uniqueId:p,required:b,valid:m,invalid:s,novalidate:g,phoneNumber:y,fullPhoneNumber:d,fullWidth:w}=this,v=Object.assign({fieldIndicator:n},l?{tooltip:l,"tooltip-icon":r,"tooltip-icon-color":u}:{}),M={id:p,form:i,name:h,novalidate:g,required:b,disabled:c,"aria-describedby":this.ariaDescribedBy};return a(o,{key:"87f5720347e3627524f95f7110088b8eddef7f8f"},a("div",{key:"091e2048f011ff4167b35434567149de061954bd",class:"r-input-phone-number--label-container"},a("label",{key:"80994d1cfd1b6f2228fb231f64894e660bdb1a1c",id:`${p}-label`},e&&a("r-label",Object.assign({key:"36fa07371ee2c9d37645060a29f2d6f4ffe66342"},v),e)),a("slot",{key:"76034d24a4208a46ee92185221256b9b5e87f971",name:"popover"})),t&&a("r-hint",{key:"574a0ec6541310640594eed29e0c301f5f9a01f7",id:`${p}-hint`,role:"note"},t),a("div",{key:"63f37ce77a8e247091e0e6bf55632a834e19992d",class:"r-input-phone-number",role:"group","aria-labelledby":`${p}-label`,"aria-describedby":this.ariaDescribedBy},a("slot",{key:"36f3e834567d3ce77b6d89ae3e835eee630675b7"}),a("r-input",{key:"2f8dc7a95823b3107d8e24f90ae53791554c19af",label:_,value:y,internal:!0,valid:m,invalid:s,required:b,readonly:this.readonly,novalidate:!0,fullWidth:w,type:"tel",error:this.errorMessage||"",onRInput:this.handleOnInput,onRChange:this.handleInputOnChange,disabled:c},m&&y&&a("r-icon",{key:"4559b1d4c55e35b2ef9560554a62d4742bca875e",slot:"trailing",name:"circled-check",size:"s",color:"var(--r-status-success-regular)"}))),a("input",Object.assign({key:"c68a9255419c41e8b9fc02127d5f3b68cd14f40b",type:"hidden"},M,{readonly:this.readonly,value:d,ref:e=>this.nativeElement=e})),a("r-hint",{key:"43712e3a6b916945b1a00d3c6d8ace5f7bdcc1d7","aria-live":"polite","aria-atomic":"true",id:`${p}-message`,class:!this.hasMessage&&"visually-hidden",variant:"error"},this.hasMessage?this.hasError?this.error:this.validityMessage:""))}get host(){return t(this)}static get watchers(){return{value:["watchValueChange"],disabled:["handleDisabledChange"],required:["handleRequiredChange"],readonly:["handleReadonlyChange"],label:["handleLabelChange"]}}};m.style=":host{display:inline-flex;flex-direction:column;vertical-align:top;--r-input--container--margin-top:0;--r-input--container--margin-bottom:0}:host slot{display:contents}:host ::slotted(r-select){min-width:var(--r-input-phone-number--select--min-width, 7rem);width:var(--r-input-phone-number--select--width, fit-content)}:host r-input.focused{--r-input--container--border-style:solid}:host([full-width]:not([full-width=false])){width:100%}.r-input-phone-number{margin-top:var(--r-input-phone-number--margin-top, var(--r-spacing-025, 0.25rem));margin-bottom:var(--r-input-phone-number--margin-bottom, var(--r-spacing-025, 0.25rem));width:var(--r-input-phone-number--width, 100%);display:var(--r-input-phone-number--display, inline-flex);justify-content:var(--r-input-phone-number--justify-content, center);align-items:var(--r-input-phone-number--align-items, center);gap:var(--r-input-phone-number--gap, 0)}.r-input-phone-number--label-container{display:var(--r-input-phone-number--label-container--display, flex);gap:var(--r-input-phone-number--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-input-phone-number--label-container--align-items, center);justify-content:var(--r-input-phone-number--label-container--align-items, space-between)}.r-input-phone-number--label-container ::slotted([slot=popover]){display:var(--r-input-phone-number--popover--display, inline-flex);height:var(--r-input-phone-number--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-input-phone-number--popover--align-items, center);justify-content:var(--r-input-phone-number--popover--justify-content, center);margin-right:var(--r-input-phone-number--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-input-phone-number--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-input-phone-number--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-input-phone-number r-input{margin-left:-1px;flex:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";export{m as r_input_phone_number}
1
+ import{r as e,c as n,h as a,H as t,g as o}from"./p-Da7qOBFr.js";import{a as h}from"./p-DvLT8-y3.js";var i,_={},l={};function r(){return i||(i=1,Object.defineProperty(l,"__esModule",{value:!0}),l.default=[{alpha2:"US",alpha3:"USA",country_code:"1",country_name:"United States",mobile_begin_with:["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","220","223","224","225","227","228","229","231","234","239","240","248","251","252","253","254","256","260","262","267","269","270","272","274","276","278","281","283","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","327","329","330","331","332","334","336","337","339","341","346","347","351","352","353","360","361","364","369","380","385","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","424","425","430","432","434","435","440","441","442","443","445","447","458","463","464","469","470","472","475","478","479","480","484","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","531","534","539","540","541","551","557","559","561","562","563","564","567","570","571","572","573","574","575","580","582","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","627","628","629","630","631","636","640","641","645","646","650","651","656","657","659","660","661","662","667","669","678","679","680","681","682","689","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","720","724","725","726","727","728","730","731","732","734","737","740","743","747","752","754","757","760","762","763","764","765","769","770","771","772","773","774","775","779","781","785","786","787","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","820","828","830","831","832","835","838","840","843","845","847","848","850","854","856","857","858","859","860","862","863","864","865","870","872","878","901","903","904","906","907","908","909","910","912","913","914","915","916","917","918","919","920","925","927","928","929","930","931","934","935","936","937","938","939","940","941","945","947","949","951","952","954","956","957","959","970","971","972","973","975","978","979","980","984","985","986","989","888","800","833","844","855","866","877","279","340","983","448","943","363","326","839","826","948","924"],phone_number_lengths:[10]},{alpha2:"AW",alpha3:"ABW",country_code:"297",country_name:"Aruba",mobile_begin_with:["56","59","64","73","74","99"],phone_number_lengths:[7]},{alpha2:"AF",alpha3:"AFG",country_code:"93",country_name:"Afghanistan",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"AO",alpha3:"AGO",country_code:"244",country_name:"Angola",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"AI",alpha3:"AIA",country_code:"1",country_name:"Anguilla",mobile_begin_with:["2642","2644","2645","2647"],phone_number_lengths:[10]},{alpha2:"AX",alpha3:"ALA",country_code:"358",country_name:"Åland Islands",mobile_begin_with:["18"],phone_number_lengths:[6,7,8]},{alpha2:"AL",alpha3:"ALB",country_code:"355",country_name:"Albania",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"AD",alpha3:"AND",country_code:"376",country_name:"Andorra",mobile_begin_with:["3","4","6"],phone_number_lengths:[6]},{alpha2:"BQ",alpha3:"BES",country_code:"599",country_name:"Caribbean Netherlands",mobile_begin_with:["3","416","700","701","795"],phone_number_lengths:[7]},{alpha2:"AE",alpha3:"ARE",country_code:"971",country_name:"United Arab Emirates",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"AR",alpha3:"ARG",country_code:"54",country_name:"Argentina",mobile_begin_with:["1","2","3"],phone_number_lengths:[8,9,10,11,12]},{alpha2:"AM",alpha3:"ARM",country_code:"374",country_name:"Armenia",mobile_begin_with:["3","4","5","7","9"],phone_number_lengths:[8]},{alpha2:"AS",alpha3:"ASM",country_code:"1",country_name:"American Samoa",mobile_begin_with:["684733","684258"],phone_number_lengths:[10]},{alpha2:"AG",alpha3:"ATG",country_code:"1",country_name:"Antigua and Barbuda",mobile_begin_with:["2687"],phone_number_lengths:[10]},{alpha2:"AU",alpha3:"AUS",country_code:"61",country_name:"Australia",mobile_begin_with:["4"],phone_number_lengths:[9]},{alpha2:"AT",alpha3:"AUT",country_code:"43",country_name:"Austria",mobile_begin_with:["6"],phone_number_lengths:[10,11,12,13,14]},{alpha2:"AZ",alpha3:"AZE",country_code:"994",country_name:"Azerbaijan",mobile_begin_with:["10","50","51","55","60","70","77","99"],phone_number_lengths:[9]},{alpha2:"BI",alpha3:"BDI",country_code:"257",country_name:"Burundi",mobile_begin_with:["71","72","75","76","77","79","29","61","68","69"],phone_number_lengths:[8]},{alpha2:"BE",alpha3:"BEL",country_code:"32",country_name:"Belgium",mobile_begin_with:["4","3"],phone_number_lengths:[9,8]},{alpha2:"BJ",alpha3:"BEN",country_code:"229",country_name:"Benin",mobile_begin_with:["4","6","9"],phone_number_lengths:[8]},{alpha2:"BF",alpha3:"BFA",country_code:"226",country_name:"Burkina Faso",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"BD",alpha3:"BGD",country_code:"880",country_name:"Bangladesh",mobile_begin_with:["1"],phone_number_lengths:[8,9,10]},{alpha2:"BG",alpha3:"BGR",country_code:"359",country_name:"Bulgaria",mobile_begin_with:["87","88","89","98","99","43"],phone_number_lengths:[8,9]},{alpha2:"BH",alpha3:"BHR",country_code:"973",country_name:"Bahrain",mobile_begin_with:["3"],phone_number_lengths:[8]},{alpha2:"BS",alpha3:"BHS",country_code:"1",country_name:"Bahamas",mobile_begin_with:["242"],phone_number_lengths:[10]},{alpha2:"BA",alpha3:"BIH",country_code:"387",country_name:"Bosnia and Herzegovina",mobile_begin_with:["6"],phone_number_lengths:[8,9]},{alpha2:"BY",alpha3:"BLR",country_code:"375",country_name:"Belarus",mobile_begin_with:["25","29","33","44"],phone_number_lengths:[9]},{alpha2:"BZ",alpha3:"BLZ",country_code:"501",country_name:"Belize",mobile_begin_with:["6"],phone_number_lengths:[7]},{alpha2:"BM",alpha3:"BMU",country_code:"1",country_name:"Bermuda",mobile_begin_with:["4413","4415","4417"],phone_number_lengths:[10]},{alpha2:"BO",alpha3:"BOL",country_code:"591",country_name:"Bolivia",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"BR",alpha3:"BRA",country_code:"55",country_name:"Brazil",mobile_begin_with:["119","129","139","149","159","169","179","189","199","219","229","249","279","289","319","329","339","349","359","379","389","419","429","439","449","459","469","479","489","499","519","539","549","559","619","629","639","649","659","669","679","689","699","719","739","749","759","779","799","819","829","839","849","859","869","879","889","899","919","929","939","949","959","969","979","989","999"],phone_number_lengths:[10,11]},{alpha2:"BB",alpha3:"BRB",country_code:"1",country_name:"Barbados",mobile_begin_with:["246"],phone_number_lengths:[10]},{alpha2:"BN",alpha3:"BRN",country_code:"673",country_name:"Brunei Darussalam",mobile_begin_with:["7","8"],phone_number_lengths:[7]},{alpha2:"BT",alpha3:"BTN",country_code:"975",country_name:"Bhutan",mobile_begin_with:["17"],phone_number_lengths:[8]},{alpha2:"BW",alpha3:"BWA",country_code:"267",country_name:"Botswana",mobile_begin_with:["71","72","73","74","75","76","77","78","79"],phone_number_lengths:[8]},{alpha2:"CF",alpha3:"CAF",country_code:"236",country_name:"Central African Republic",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"CA",alpha3:"CAN",country_code:"1",country_name:"Canada",mobile_begin_with:["204","226","236","249","250","263","289","306","343","354","365","367","368","403","416","418","431","437","438","450","468","474","506","514","519","548","579","581","584","587","600","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905","428","382","942"],phone_number_lengths:[10]},{alpha2:"CH",alpha3:"CHE",country_code:"41",country_name:"Switzerland",mobile_begin_with:["74","75","76","77","78","79"],phone_number_lengths:[9]},{alpha2:"CL",alpha3:"CHL",country_code:"56",country_name:"Chile",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"CN",alpha3:"CHN",country_code:"86",country_name:"China",mobile_begin_with:["13","14","15","17","18","19","16"],phone_number_lengths:[11]},{alpha2:"CI",alpha3:"CIV",country_code:"225",country_name:"Côte D'Ivoire",mobile_begin_with:["0","4","5","6","7","8"],phone_number_lengths:[10]},{alpha2:"CM",alpha3:"CMR",country_code:"237",country_name:"Cameroon",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"CD",alpha3:"COD",country_code:"243",country_name:"Congo, The Democratic Republic Of The",mobile_begin_with:["8","9"],phone_number_lengths:[9]},{alpha2:"CG",alpha3:"COG",country_code:"242",country_name:"Congo",mobile_begin_with:["0"],phone_number_lengths:[9]},{alpha2:"CK",alpha3:"COK",country_code:"682",country_name:"Cook Islands",mobile_begin_with:["5","7"],phone_number_lengths:[5]},{alpha2:"CO",alpha3:"COL",country_code:"57",country_name:"Colombia",mobile_begin_with:["3"],phone_number_lengths:[10]},{alpha2:"CW",alpha3:"CUW",country_code:"599",country_name:"Curaçao",mobile_begin_with:["95","96"],phone_number_lengths:[8]},{alpha2:"KM",alpha3:"COM",country_code:"269",country_name:"Comoros",mobile_begin_with:["3","76"],phone_number_lengths:[7]},{alpha2:"CV",alpha3:"CPV",country_code:"238",country_name:"Cape Verde",mobile_begin_with:["5","9"],phone_number_lengths:[7]},{alpha2:"CR",alpha3:"CRI",country_code:"506",country_name:"Costa Rica",mobile_begin_with:["5","6","7","8"],phone_number_lengths:[8]},{alpha2:"CU",alpha3:"CUB",country_code:"53",country_name:"Cuba",mobile_begin_with:["5","6"],phone_number_lengths:[8]},{alpha2:"KY",alpha3:"CYM",country_code:"1",country_name:"Cayman Islands",mobile_begin_with:["345"],phone_number_lengths:[10]},{alpha2:"CY",alpha3:"CYP",country_code:"357",country_name:"Cyprus",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"CZ",alpha3:"CZE",country_code:"420",country_name:"Czech Republic",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"DE",alpha3:"DEU",country_code:"49",country_name:"Germany",mobile_begin_with:["15","16","17"],phone_number_lengths:[10,11]},{alpha2:"DJ",alpha3:"DJI",country_code:"253",country_name:"Djibouti",mobile_begin_with:["77"],phone_number_lengths:[8]},{alpha2:"DM",alpha3:"DMA",country_code:"1",country_name:"Dominica",mobile_begin_with:["767"],phone_number_lengths:[10]},{alpha2:"DK",alpha3:"DNK",country_code:"45",country_name:"Denmark",mobile_begin_with:["2","30","31","40","41","42","50","51","52","53","60","61","71","81","91","92","93","342","344","345","346","347","348","349","356","357","359","362","365","366","389","398","431","441","462","466","468","472","474","476","478","485","486","488","489","493","494","495","496","498","499","542","543","545","551","552","556","571","572","573","574","577","579","584","586","587","589","597","598","627","629","641","649","658","662","663","664","665","667","692","693","694","697","771","772","782","783","785","786","788","789","826","827","829"],phone_number_lengths:[8]},{alpha2:"DO",alpha3:"DOM",country_code:"1",country_name:"Dominican Republic",mobile_begin_with:["809","829","849"],phone_number_lengths:[10]},{alpha2:"DZ",alpha3:"DZA",country_code:"213",country_name:"Algeria",mobile_begin_with:["5","6","7"],phone_number_lengths:[9]},{alpha2:"EC",alpha3:"ECU",country_code:"593",country_name:"Ecuador",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"EG",alpha3:"EGY",country_code:"20",country_name:"Egypt",mobile_begin_with:["1"],phone_number_lengths:[10,8]},{alpha2:"ER",alpha3:"ERI",country_code:"291",country_name:"Eritrea",mobile_begin_with:["1","7","8"],phone_number_lengths:[7]},{alpha2:"ES",alpha3:"ESP",country_code:"34",country_name:"Spain",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"EE",alpha3:"EST",country_code:"372",country_name:"Estonia",mobile_begin_with:["5","81","82","83"],phone_number_lengths:[7,8]},{alpha2:"ET",alpha3:"ETH",country_code:"251",country_name:"Ethiopia",mobile_begin_with:["7","9"],phone_number_lengths:[9]},{alpha2:"FI",alpha3:"FIN",country_code:"358",country_name:"Finland",mobile_begin_with:["4","5"],phone_number_lengths:[6,7,9,10]},{alpha2:"FJ",alpha3:"FJI",country_code:"679",country_name:"Fiji",mobile_begin_with:["2","7","8","9"],phone_number_lengths:[7]},{alpha2:"FK",alpha3:"FLK",country_code:"500",country_name:"Falkland Islands (Malvinas)",mobile_begin_with:["5","6"],phone_number_lengths:[5]},{alpha2:"FR",alpha3:"FRA",country_code:"33",country_name:"France",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"FO",alpha3:"FRO",country_code:"298",country_name:"Faroe Islands",mobile_begin_with:[],phone_number_lengths:[6]},{alpha2:"FM",alpha3:"FSM",country_code:"691",country_name:"Micronesia, Federated States Of",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"GA",alpha3:"GAB",country_code:"241",country_name:"Gabon",mobile_begin_with:["2","3","4","5","6","7"],phone_number_lengths:[7]},{alpha2:"GB",alpha3:"GBR",country_code:"44",country_name:"United Kingdom",mobile_begin_with:["7"],phone_number_lengths:[10]},{alpha2:"GE",alpha3:"GEO",country_code:"995",country_name:"Georgia",mobile_begin_with:["5","7"],phone_number_lengths:[9]},{alpha2:"GH",alpha3:"GHA",country_code:"233",country_name:"Ghana",mobile_begin_with:["2","5"],phone_number_lengths:[9]},{alpha2:"GI",alpha3:"GIB",country_code:"350",country_name:"Gibraltar",mobile_begin_with:["5"],phone_number_lengths:[8]},{alpha2:"GN",alpha3:"GIN",country_code:"224",country_name:"Guinea",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"GP",alpha3:"GLP",country_code:"590",country_name:"Guadeloupe",mobile_begin_with:["690","691"],phone_number_lengths:[9]},{alpha2:"GM",alpha3:"GMB",country_code:"220",country_name:"Gambia",mobile_begin_with:["7","9"],phone_number_lengths:[7]},{alpha2:"GW",alpha3:"GNB",country_code:"245",country_name:"Guinea-Bissau",mobile_begin_with:["5","6","7"],phone_number_lengths:[7]},{alpha2:"GQ",alpha3:"GNQ",country_code:"240",country_name:"Equatorial Guinea",mobile_begin_with:["222","551"],phone_number_lengths:[9]},{alpha2:"GR",alpha3:"GRC",country_code:"30",country_name:"Greece",mobile_begin_with:["6"],phone_number_lengths:[10]},{alpha2:"GD",alpha3:"GRD",country_code:"1",country_name:"Grenada",mobile_begin_with:["473"],phone_number_lengths:[10]},{alpha2:"GL",alpha3:"GRL",country_code:"299",country_name:"Greenland",mobile_begin_with:["2","4","5"],phone_number_lengths:[6]},{alpha2:"GT",alpha3:"GTM",country_code:"502",country_name:"Guatemala",mobile_begin_with:["3","4","5"],phone_number_lengths:[8]},{alpha2:"GF",alpha3:"GUF",country_code:"594",country_name:"French Guiana",mobile_begin_with:["694"],phone_number_lengths:[9]},{alpha2:"GU",alpha3:"GUM",country_code:"1",country_name:"Guam",mobile_begin_with:["671"],phone_number_lengths:[10]},{alpha2:"GY",alpha3:"GUY",country_code:"592",country_name:"Guyana",mobile_begin_with:["6"],phone_number_lengths:[7]},{alpha2:"HK",alpha3:"HKG",country_code:"852",country_name:"Hong Kong",mobile_begin_with:["4","5","6","70","71","72","73","81","82","83","84","85","86","87","88","89","9"],phone_number_lengths:[8]},{alpha2:"HN",alpha3:"HND",country_code:"504",country_name:"Honduras",mobile_begin_with:["3","7","8","9"],phone_number_lengths:[8]},{alpha2:"HR",alpha3:"HRV",country_code:"385",country_name:"Croatia",mobile_begin_with:["9"],phone_number_lengths:[8,9]},{alpha2:"HT",alpha3:"HTI",country_code:"509",country_name:"Haiti",mobile_begin_with:["3","4"],phone_number_lengths:[8]},{alpha2:"HU",alpha3:"HUN",country_code:"36",country_name:"Hungary",mobile_begin_with:["20","30","31","50","70"],phone_number_lengths:[9]},{alpha2:"ID",alpha3:"IDN",country_code:"62",country_name:"Indonesia",mobile_begin_with:["8"],phone_number_lengths:[9,10,11,12]},{alpha2:"IN",alpha3:"IND",country_code:"91",country_name:"India",mobile_begin_with:["6","7","8","9"],phone_number_lengths:[10]},{alpha2:"IE",alpha3:"IRL",country_code:"353",country_name:"Ireland",mobile_begin_with:["82","83","84","85","86","87","88","89"],phone_number_lengths:[9]},{alpha2:"IR",alpha3:"IRN",country_code:"98",country_name:"Iran, Islamic Republic Of",mobile_begin_with:["9"],phone_number_lengths:[10]},{alpha2:"IQ",alpha3:"IRQ",country_code:"964",country_name:"Iraq",mobile_begin_with:["7"],phone_number_lengths:[10]},{alpha2:"IS",alpha3:"ISL",country_code:"354",country_name:"Iceland",mobile_begin_with:["6","7","8"],phone_number_lengths:[7]},{alpha2:"IL",alpha3:"ISR",country_code:"972",country_name:"Israel",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"IT",alpha3:"ITA",country_code:"39",country_name:"Italy",mobile_begin_with:["3"],phone_number_lengths:[9,10]},{alpha2:"JM",alpha3:"JAM",country_code:"1",country_name:"Jamaica",mobile_begin_with:["876"],phone_number_lengths:[10]},{alpha2:"JO",alpha3:"JOR",country_code:"962",country_name:"Jordan",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"JP",alpha3:"JPN",country_code:"81",country_name:"Japan",mobile_begin_with:["70","80","90"],phone_number_lengths:[10]},{alpha2:"KZ",alpha3:"KAZ",country_code:"7",country_name:"Kazakhstan",mobile_begin_with:["70","74","77"],phone_number_lengths:[10]},{alpha2:"KE",alpha3:"KEN",country_code:"254",country_name:"Kenya",mobile_begin_with:["7","1"],phone_number_lengths:[9]},{alpha2:"KG",alpha3:"KGZ",country_code:"996",country_name:"Kyrgyzstan",mobile_begin_with:["20","22","31258","312973","5","600","7","88","912","99"],phone_number_lengths:[9]},{alpha2:"KH",alpha3:"KHM",country_code:"855",country_name:"Cambodia",mobile_begin_with:["1","6","7","8","9"],phone_number_lengths:[8,9]},{alpha2:"KI",alpha3:"KIR",country_code:"686",country_name:"Kiribati",mobile_begin_with:["9","30"],phone_number_lengths:[5]},{alpha2:"KN",alpha3:"KNA",country_code:"1",country_name:"Saint Kitts And Nevis",mobile_begin_with:["869"],phone_number_lengths:[10]},{alpha2:"KR",alpha3:"KOR",country_code:"82",country_name:"Korea, Republic of",mobile_begin_with:["1"],phone_number_lengths:[9,10]},{alpha2:"XK",alpha3:"XKX",country_code:"383",country_name:"Kosovo, Republic of",mobile_begin_with:["43","44","45","46","47","48","49"],phone_number_lengths:[8]},{alpha2:"KW",alpha3:"KWT",country_code:"965",country_name:"Kuwait",mobile_begin_with:["5","6","9"],phone_number_lengths:[8]},{alpha2:"LA",alpha3:"LAO",country_code:"856",country_name:"Lao People's Democratic Republic",mobile_begin_with:["20"],phone_number_lengths:[10]},{alpha2:"LB",alpha3:"LBN",country_code:"961",country_name:"Lebanon",mobile_begin_with:["3","7","8"],phone_number_lengths:[7,8]},{alpha2:"LR",alpha3:"LBR",country_code:"231",country_name:"Liberia",mobile_begin_with:["4","5","6","7"],phone_number_lengths:[7,8]},{alpha2:"LY",alpha3:"LBY",country_code:"218",country_name:"Libyan Arab Jamahiriya",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"LC",alpha3:"LCA",country_code:"1",country_name:"Saint Lucia",mobile_begin_with:["758"],phone_number_lengths:[10]},{alpha2:"LI",alpha3:"LIE",country_code:"423",country_name:"Liechtenstein",mobile_begin_with:["7"],phone_number_lengths:[7]},{alpha2:"LK",alpha3:"LKA",country_code:"94",country_name:"Sri Lanka",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"LS",alpha3:"LSO",country_code:"266",country_name:"Lesotho",mobile_begin_with:["5","6"],phone_number_lengths:[8]},{alpha2:"LT",alpha3:"LTU",country_code:"370",country_name:"Lithuania",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"LU",alpha3:"LUX",country_code:"352",country_name:"Luxembourg",mobile_begin_with:["6"],phone_number_lengths:[9]},{alpha2:"LV",alpha3:"LVA",country_code:"371",country_name:"Latvia",mobile_begin_with:["2"],phone_number_lengths:[8]},{alpha2:"MO",alpha3:"MAC",country_code:"853",country_name:"Macao",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"MA",alpha3:"MAR",country_code:"212",country_name:"Morocco",mobile_begin_with:["6","7"],phone_number_lengths:[9]},{alpha2:"MC",alpha3:"MCO",country_code:"377",country_name:"Monaco",mobile_begin_with:["4","6"],phone_number_lengths:[8,9]},{alpha2:"MD",alpha3:"MDA",country_code:"373",country_name:"Moldova, Republic of",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"MG",alpha3:"MDG",country_code:"261",country_name:"Madagascar",mobile_begin_with:["3"],phone_number_lengths:[9]},{alpha2:"MV",alpha3:"MDV",country_code:"960",country_name:"Maldives",mobile_begin_with:["7","9"],phone_number_lengths:[7]},{alpha2:"MX",alpha3:"MEX",country_code:"52",country_name:"Mexico",mobile_begin_with:[""],phone_number_lengths:[10,11]},{alpha2:"MH",alpha3:"MHL",country_code:"692",country_name:"Marshall Islands",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"MK",alpha3:"MKD",country_code:"389",country_name:"Macedonia, the Former Yugoslav Republic Of",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"ML",alpha3:"MLI",country_code:"223",country_name:"Mali",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"MT",alpha3:"MLT",country_code:"356",country_name:"Malta",mobile_begin_with:["7","9"],phone_number_lengths:[8]},{alpha2:"MM",alpha3:"MMR",country_code:"95",country_name:"Myanmar",mobile_begin_with:["9"],phone_number_lengths:[8,9,10]},{alpha2:"ME",alpha3:"MNE",country_code:"382",country_name:"Montenegro",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"MN",alpha3:"MNG",country_code:"976",country_name:"Mongolia",mobile_begin_with:["5","8","9"],phone_number_lengths:[8]},{alpha2:"MP",alpha3:"MNP",country_code:"1",country_name:"Northern Mariana Islands",mobile_begin_with:["670"],phone_number_lengths:[10]},{alpha2:"MZ",alpha3:"MOZ",country_code:"258",country_name:"Mozambique",mobile_begin_with:["8"],phone_number_lengths:[9]},{alpha2:"MR",alpha3:"MRT",country_code:"222",country_name:"Mauritania",mobile_begin_with:[],phone_number_lengths:[8]},{alpha2:"MS",alpha3:"MSR",country_code:"1",country_name:"Montserrat",mobile_begin_with:["664"],phone_number_lengths:[10]},{alpha2:"MQ",alpha3:"MTQ",country_code:"596",country_name:"Martinique",mobile_begin_with:["696","697"],phone_number_lengths:[9]},{alpha2:"MU",alpha3:"MUS",country_code:"230",country_name:"Mauritius",mobile_begin_with:["5"],phone_number_lengths:[8]},{alpha2:"MW",alpha3:"MWI",country_code:"265",country_name:"Malawi",mobile_begin_with:["77","88","99"],phone_number_lengths:[9]},{alpha2:"MY",alpha3:"MYS",country_code:"60",country_name:"Malaysia",mobile_begin_with:["1","6"],phone_number_lengths:[9,10,8]},{alpha2:"YT",alpha3:"MYT",country_code:"262",country_name:"Mayotte",mobile_begin_with:["639"],phone_number_lengths:[9]},{alpha2:"NA",alpha3:"NAM",country_code:"264",country_name:"Namibia",mobile_begin_with:["60","81","82","85"],phone_number_lengths:[9]},{alpha2:"NC",alpha3:"NCL",country_code:"687",country_name:"New Caledonia",mobile_begin_with:["5","7","8","9"],phone_number_lengths:[6]},{alpha2:"NE",alpha3:"NER",country_code:"227",country_name:"Niger",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"NF",alpha3:"NFK",country_code:"672",country_name:"Norfolk Island",mobile_begin_with:["5","8"],phone_number_lengths:[5]},{alpha2:"NG",alpha3:"NGA",country_code:"234",country_name:"Nigeria",mobile_begin_with:["70","80","81","90","91"],phone_number_lengths:[10]},{alpha2:"NI",alpha3:"NIC",country_code:"505",country_name:"Nicaragua",mobile_begin_with:["7","8"],phone_number_lengths:[8]},{alpha2:"NU",alpha3:"NIU",country_code:"683",country_name:"Niue",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"NL",alpha3:"NLD",country_code:"31",country_name:"Netherlands",mobile_begin_with:["6","97"],phone_number_lengths:[9,11]},{alpha2:"NO",alpha3:"NOR",country_code:"47",country_name:"Norway",mobile_begin_with:["4","9"],phone_number_lengths:[8]},{alpha2:"NP",alpha3:"NPL",country_code:"977",country_name:"Nepal",mobile_begin_with:["97","98"],phone_number_lengths:[10]},{alpha2:"NR",alpha3:"NRU",country_code:"674",country_name:"Nauru",mobile_begin_with:["555"],phone_number_lengths:[7]},{alpha2:"NZ",alpha3:"NZL",country_code:"64",country_name:"New Zealand",mobile_begin_with:["2"],phone_number_lengths:[8,9,10]},{alpha2:"OM",alpha3:"OMN",country_code:"968",country_name:"Oman",mobile_begin_with:["7","9"],phone_number_lengths:[8]},{alpha2:"PK",alpha3:"PAK",country_code:"92",country_name:"Pakistan",mobile_begin_with:["3"],phone_number_lengths:[10]},{alpha2:"PA",alpha3:"PAN",country_code:"507",country_name:"Panama",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"PE",alpha3:"PER",country_code:"51",country_name:"Peru",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PH",alpha3:"PHL",country_code:"63",country_name:"Philippines",mobile_begin_with:["9"],phone_number_lengths:[10]},{alpha2:"PW",alpha3:"PLW",country_code:"680",country_name:"Palau",mobile_begin_with:[],phone_number_lengths:[7]},{alpha2:"PG",alpha3:"PNG",country_code:"675",country_name:"Papua New Guinea",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"PL",alpha3:"POL",country_code:"48",country_name:"Poland",mobile_begin_with:["4","5","6","7","8"],phone_number_lengths:[9]},{alpha2:"PR",alpha3:"PRI",country_code:"1",country_name:"Puerto Rico",mobile_begin_with:["787","939"],phone_number_lengths:[10]},{alpha2:"PT",alpha3:"PRT",country_code:"351",country_name:"Portugal",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PY",alpha3:"PRY",country_code:"595",country_name:"Paraguay",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"PS",alpha3:"PSE",country_code:"970",country_name:"Palestinian Territory, Occupied",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"PF",alpha3:"PYF",country_code:"689",country_name:"French Polynesia",mobile_begin_with:["8"],phone_number_lengths:[8]},{alpha2:"QA",alpha3:"QAT",country_code:"974",country_name:"Qatar",mobile_begin_with:["3","5","6","7"],phone_number_lengths:[8]},{alpha2:"RE",alpha3:"REU",country_code:"262",country_name:"Réunion",mobile_begin_with:["692","693"],phone_number_lengths:[9]},{alpha2:"RO",alpha3:"ROU",country_code:"40",country_name:"Romania",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"RU",alpha3:"RUS",country_code:"7",country_name:"Russian Federation",mobile_begin_with:["9","495","498","499","835"],phone_number_lengths:[10]},{alpha2:"RW",alpha3:"RWA",country_code:"250",country_name:"Rwanda",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SA",alpha3:"SAU",country_code:"966",country_name:"Saudi Arabia",mobile_begin_with:["5"],phone_number_lengths:[9]},{alpha2:"SD",alpha3:"SDN",country_code:"249",country_name:"Sudan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SS",alpha3:"SSD",country_code:"211",country_name:"South Sudan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SN",alpha3:"SEN",country_code:"221",country_name:"Senegal",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SG",alpha3:"SGP",country_code:"65",country_name:"Singapore",mobile_begin_with:["8","9"],phone_number_lengths:[8]},{alpha2:"SH",alpha3:"SHN",country_code:"290",country_name:"Saint Helena",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"SJ",alpha3:"SJM",country_code:"47",country_name:"Svalbard And Jan Mayen",mobile_begin_with:["79"],phone_number_lengths:[8]},{alpha2:"SB",alpha3:"SLB",country_code:"677",country_name:"Solomon Islands",mobile_begin_with:["7","8"],phone_number_lengths:[7]},{alpha2:"SL",alpha3:"SLE",country_code:"232",country_name:"Sierra Leone",mobile_begin_with:["21","25","30","33","34","40","44","50","55","76","77","78","79","88"],phone_number_lengths:[8]},{alpha2:"SV",alpha3:"SLV",country_code:"503",country_name:"El Salvador",mobile_begin_with:["6","7"],phone_number_lengths:[8]},{alpha2:"SM",alpha3:"SMR",country_code:"378",country_name:"San Marino",mobile_begin_with:["3","6"],phone_number_lengths:[10]},{alpha2:"SO",alpha3:"SOM",country_code:"252",country_name:"Somalia",mobile_begin_with:["61","62","63","65","66","68","69","71","90"],phone_number_lengths:[9]},{alpha2:"SX",alpha3:"SXM",country_code:"1",country_name:"Sint Maarten",mobile_begin_with:["721"],phone_number_lengths:[10]},{alpha2:"PM",alpha3:"SPM",country_code:"508",country_name:"Saint Pierre And Miquelon",mobile_begin_with:["55","41"],phone_number_lengths:[6]},{alpha2:"RS",alpha3:"SRB",country_code:"381",country_name:"Serbia",mobile_begin_with:["6"],phone_number_lengths:[8,9]},{alpha2:"ST",alpha3:"STP",country_code:"239",country_name:"Sao Tome and Principe",mobile_begin_with:["98","99"],phone_number_lengths:[7]},{alpha2:"SR",alpha3:"SUR",country_code:"597",country_name:"Suriname",mobile_begin_with:["6","7","8"],phone_number_lengths:[7]},{alpha2:"SK",alpha3:"SVK",country_code:"421",country_name:"Slovakia",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"SI",alpha3:"SVN",country_code:"386",country_name:"Slovenia",mobile_begin_with:["3","4","5","6","7"],phone_number_lengths:[8]},{alpha2:"SE",alpha3:"SWE",country_code:"46",country_name:"Sweden",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"SZ",alpha3:"SWZ",country_code:"268",country_name:"Swaziland",mobile_begin_with:["76","77","78","79"],phone_number_lengths:[8]},{alpha2:"SC",alpha3:"SYC",country_code:"248",country_name:"Seychelles",mobile_begin_with:["2"],phone_number_lengths:[7]},{alpha2:"SY",alpha3:"SYR",country_code:"963",country_name:"Syrian Arab Republic",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TC",alpha3:"TCA",country_code:"1",country_name:"Turks and Caicos Islands",mobile_begin_with:["6492","6493","6494"],phone_number_lengths:[10]},{alpha2:"TD",alpha3:"TCD",country_code:"235",country_name:"Chad",mobile_begin_with:["6","7","9"],phone_number_lengths:[8]},{alpha2:"TG",alpha3:"TGO",country_code:"228",country_name:"Togo",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"TH",alpha3:"THA",country_code:"66",country_name:"Thailand",mobile_begin_with:["6","8","9"],phone_number_lengths:[9]},{alpha2:"TJ",alpha3:"TJK",country_code:"992",country_name:"Tajikistan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TK",alpha3:"TKL",country_code:"690",country_name:"Tokelau",mobile_begin_with:[],phone_number_lengths:[4]},{alpha2:"TM",alpha3:"TKM",country_code:"993",country_name:"Turkmenistan",mobile_begin_with:["6"],phone_number_lengths:[8]},{alpha2:"TL",alpha3:"TLS",country_code:"670",country_name:"Timor-Leste",mobile_begin_with:["7"],phone_number_lengths:[8]},{alpha2:"TO",alpha3:"TON",country_code:"676",country_name:"Tonga",mobile_begin_with:[],phone_number_lengths:[5]},{alpha2:"TT",alpha3:"TTO",country_code:"1",country_name:"Trinidad and Tobago",mobile_begin_with:["868"],phone_number_lengths:[10]},{alpha2:"TN",alpha3:"TUN",country_code:"216",country_name:"Tunisia",mobile_begin_with:["2","4","5","9"],phone_number_lengths:[8]},{alpha2:"TR",alpha3:"TUR",country_code:"90",country_name:"Turkey",mobile_begin_with:["5"],phone_number_lengths:[10]},{alpha2:"TV",alpha3:"TUV",country_code:"688",country_name:"Tuvalu",mobile_begin_with:[],phone_number_lengths:[5]},{alpha2:"TW",alpha3:"TWN",country_code:"886",country_name:"Taiwan",mobile_begin_with:["9"],phone_number_lengths:[9]},{alpha2:"TZ",alpha3:"TZA",country_code:"255",country_name:"Tanzania, United Republic of",mobile_begin_with:["7","6"],phone_number_lengths:[9]},{alpha2:"UG",alpha3:"UGA",country_code:"256",country_name:"Uganda",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"UA",alpha3:"UKR",country_code:"380",country_name:"Ukraine",mobile_begin_with:["39","50","63","66","67","68","73","75","77","9"],phone_number_lengths:[9]},{alpha2:"UY",alpha3:"URY",country_code:"598",country_name:"Uruguay",mobile_begin_with:["9"],phone_number_lengths:[8]},{alpha2:"UZ",alpha3:"UZB",country_code:"998",country_name:"Uzbekistan",mobile_begin_with:["9","88","33"],phone_number_lengths:[9]},{alpha2:"VC",alpha3:"VCT",country_code:"1",country_name:"Saint Vincent And The Grenedines",mobile_begin_with:["784"],phone_number_lengths:[10]},{alpha2:"VE",alpha3:"VEN",country_code:"58",country_name:"Venezuela, Bolivarian Republic of",mobile_begin_with:["4"],phone_number_lengths:[10]},{alpha2:"VG",alpha3:"VGB",country_code:"1",country_name:"Virgin Islands, British",mobile_begin_with:["284"],phone_number_lengths:[10]},{alpha2:"VI",alpha3:"VIR",country_code:"1",country_name:"Virgin Islands, U.S.",mobile_begin_with:["340"],phone_number_lengths:[10]},{alpha2:"VN",alpha3:"VNM",country_code:"84",country_name:"Viet Nam",mobile_begin_with:["8","9","3","7","5"],phone_number_lengths:[9]},{alpha2:"VU",alpha3:"VUT",country_code:"678",country_name:"Vanuatu",mobile_begin_with:["5","7"],phone_number_lengths:[7]},{alpha2:"WF",alpha3:"WLF",country_code:"681",country_name:"Wallis and Futuna",mobile_begin_with:[],phone_number_lengths:[6]},{alpha2:"WS",alpha3:"WSM",country_code:"685",country_name:"Samoa",mobile_begin_with:["7"],phone_number_lengths:[7]},{alpha2:"YE",alpha3:"YEM",country_code:"967",country_name:"Yemen",mobile_begin_with:["7"],phone_number_lengths:[9]},{alpha2:"ZA",alpha3:"ZAF",country_code:"27",country_name:"South Africa",mobile_begin_with:["1","2","3","4","5","6","7","8"],phone_number_lengths:[9]},{alpha2:"ZM",alpha3:"ZMB",country_code:"260",country_name:"Zambia",mobile_begin_with:["9","7"],phone_number_lengths:[9]},{alpha2:"ZW",alpha3:"ZWE",country_code:"263",country_name:"Zimbabwe",mobile_begin_with:["71","73","77","78"],phone_number_lengths:[9]}]),l}var u,c,p={},b=function(){if(c)return _;c=1;var e=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.countryPhoneData=void 0,_.default=t,_.phone=t;const n=e(r());_.countryPhoneData=n.default;const a=function(){if(u)return p;u=1;var e=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.findCountryPhoneDataByCountry=function(e){return e?2===e.length?n.default.find((n=>e.toUpperCase()===n.alpha2))||null:3===e.length?n.default.find((n=>e.toUpperCase()===n.alpha3))||null:n.default.find((n=>e.toUpperCase()===n.country_name.toUpperCase()))||null:n.default.find((e=>"USA"===e.alpha3))||null},p.findExactCountryPhoneData=a,p.findPossibleCountryPhoneData=t,p.findCountryPhoneDataByPhoneNumber=function(e,o){let h,i;for(const _ of n.default)e.match(new RegExp("^"+_.country_code))&&(h||(h=a(e,o,_)),i||(i=t(e,o,_)));return{exactCountryPhoneData:h,possibleCountryPhoneData:i}},p.validatePhoneISO3166=function(e,n,a,t){if(!n.phone_number_lengths)return!1;const o=e.replace(new RegExp("^"+n.country_code),"");if(t&&n&&o.length===e.length)return!1;const h=n.mobile_begin_with,i=n.phone_number_lengths.some((e=>o.length===e)),_=!h.length||h.some((e=>o.match(new RegExp("^"+e))));return i&&(!a||_)};const n=e(r());function a(e,n,a){return a.phone_number_lengths.some((n=>a.country_code.length+n===e.length))?a.mobile_begin_with.length&&n?a.mobile_begin_with.some((n=>e.match(new RegExp("^"+a.country_code+n))))?a:null:a:null}function t(e,n,a){return a.phone_number_lengths.some((n=>a.country_code.length+n+1===e.length))?a.mobile_begin_with.length&&n?a.mobile_begin_with.some((n=>e.match(new RegExp("^"+a.country_code+"\\d?"+n))))?a:void 0:a:null}return p}();function t(e,{country:n="",validateMobilePrefix:t=!0,strictDetection:o=!1}={}){const h={isValid:!1,phoneNumber:null,countryIso2:null,countryIso3:null,countryCode:null};let i="string"!=typeof e?"":e.trim();const _="string"!=typeof n?"":n.trim(),l=Boolean(i.match(/^\+/));i=i.replace(/\D/g,"");let r=(0,a.findCountryPhoneDataByCountry)(_);if(!r)return h;let u=!1;if(_)["CIV","COG"].includes(r.alpha3)||(i=i.replace(/^0+/,"")),"RUS"===r.alpha3&&11===i.length&&null!==i.match(/^89/)&&(i=i.replace(/^8+/,"")),!l&&r.phone_number_lengths.includes(i.length)&&(i=`${r.country_code}${i}`);else if(l){const{exactCountryPhoneData:e,possibleCountryPhoneData:n}=(0,a.findCountryPhoneDataByPhoneNumber)(i,t);e?r=e:n&&!o?(r=n,i=r.country_code+i.replace(new RegExp(`^${r.country_code}\\d`),"")):r=null}else-1!==r.phone_number_lengths.indexOf(i.length)&&(i=`1${i}`,u=!0);if(!r)return h;let c=(0,a.validatePhoneISO3166)(i,r,t,l);return c||u&&(r=(0,a.findCountryPhoneDataByCountry)("CAN"),c=(0,a.validatePhoneISO3166)(i,r,t,l),c)?{isValid:!0,phoneNumber:`+${i}`,countryIso2:r.alpha2,countryIso3:r.alpha3,countryCode:`+${r.country_code}`}:h}return _}();const m=class{constructor(a){e(this,a),this.rInput=n(this,"rInput"),this.rChange=n(this,"rChange"),this.rValidate=n(this,"rValidate"),this.rReset=n(this,"rReset"),this.name="phone-number",this.inputLabel="Phone number without country code",this.countryCodeLabel="Country code",this.fullPhoneNumber="",this.phoneNumber="",this.validityState="",this.validityMessage="",this.uniqueId=`r-input-phone-number-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g,""),this.initial={},this.handleOnInput=e=>{if(this.readonly)return;this.phoneNumber=e.target.value,this.fullPhoneNumber=this.phoneNumber?this.countryCode+this.phoneNumber:"";const{host:n,phoneNumber:a,countryCode:t,value:o}=this;this.rInput.emit({element:n,value:o,countryCode:t,phoneNumber:a}),this.validateFormElement(this.nativeElement)},this.handleInputOnChange=e=>{this.readonly||(this.phoneNumber=e.target.value,this.handleValueChange())},this.handleValueChange=()=>{if(this.readonly)return;this.fullPhoneNumber=this.phoneNumber?this.countryCode+this.phoneNumber:"";const{host:e,phoneNumber:n,countryCode:a,value:t}=this;this.rChange.emit({element:e,value:t,countryCode:a,phoneNumber:n}),this.validateFormElement(this.nativeElement)},this.validateFormElement=e=>{if(this.readonly)return;if(null===e)return;if(this.isNoValidate)return;if(this.error)return;const{validityState:n,validityMessage:a}=this.getValidityStateData();this.validityState=n,this.validityMessage=a;const t="valid"===this.validityState;this.valid=t,this.invalid=!t,this.rValidate.emit({state:this.validityState,message:this.validityMessage})},this.getValidityStateData=()=>{var e,n;let a="",t="";return this.required||(null===(e=this.phoneNumber)||void 0===e?void 0:e.length)?(null===(n=this.phoneNumber)||void 0===n?void 0:n.length)?this.countryCode&&this.getPhoneValidationResult(this.phoneNumber,this.countryCode).isValid?(a="valid",{validityState:a,validityMessage:t}):(a="invalid",t=this.customErrorMessage,{validityState:a,validityMessage:t}):(a="valueMissing",t=this.valueMissingMessage,{validityState:a,validityMessage:t}):(a="valid",{validityState:a,validityMessage:t})},this.onSubmitForm=e=>{this.isNoValidate||(this.validateFormElement(this.nativeElement),this.invalid&&(e.preventDefault(),e.stopPropagation()))},this.contributeToFormData=e=>{h(this.nativeElement||this.host,e.formData)},this.onResetForm=()=>{var e;if(this.readonly)return;this.validityState=null,this.validityMessage=null,this.phoneNumber="",this.invalid=this.initial.invalid,this.valid=!this.invalid,null===(e=this.countryCodeElement)||void 0===e||e.reset(),this.updateValues(this.initial.value);const{host:n,value:a}=this;this.rReset.emit({element:n,value:a})}}async getValue(){return this.fullPhoneNumber}async setValue(e){this.updateValues(e)}async setCustomValidity(e){this.customErrorMessage=e,this.validateFormElement(this.nativeElement)}async checkValidity(){const{validityState:e}=this.getValidityStateData();return"valid"===e}async reportValidity(){return this.validateFormElement(this.nativeElement),"valid"===this.validityState}async reset(){this.onResetForm()}watchValueChange(e){this.updateValues(e),this.validateFormElement(this.nativeElement)}handleDisabledChange(){this.setCountryCodeElementAttributes({disabled:`${!!this.disabled}`})}handleRequiredChange(){this.setCountryCodeElementAttributes({required:`${!!this.required}`})}handleReadonlyChange(){this.setCountryCodeElementAttributes({readonly:`${!!this.readonly}`})}handleLabelChange(){this.setCountryCodeElementAttributes({label:this.countryCodeLabel})}get parentFormEl(){return this.host.closest("form")||document.querySelector(`#${this.form}`)||null}get countryCodeElement(){return this.host.querySelector("r-select")}get countryCode(){return this.host.querySelector("r-select").value||""}get ariaDescribedBy(){const e=`${this.uniqueId}-message`;return this.hint?`${this.uniqueId}-hint ${e}`:e}get hasError(){var e;return this.invalid&&!!(null===(e=this.error)||void 0===e?void 0:e.length)}get hasValidationError(){var e;return"valid"!==this.validityState&&!!(null===(e=this.validityMessage)||void 0===e?void 0:e.length)}get hasMessage(){return this.hasError||this.hasValidationError}get errorMessage(){return this.hasError&&this.error||this.hasValidationError&&this.validityMessage}get isNoValidate(){var e;return(null===(e=this.parentFormEl)||void 0===e?void 0:e.hasAttribute("novalidate"))||this.novalidate||!1}updateValues(e){var n,a;if(this.fullPhoneNumber=e||"",!e)return null===(n=this.countryCodeElement)||void 0===n||n.reset(),void(this.phoneNumber="");if(!this.getPhoneValidationResult(e).isValid)return void console.error("Provided phone number is not valid");const t=this.getPhoneValidationResult(e).countryCode;this.phoneNumber=e.replace(t,""),null===(a=this.countryCodeElement)||void 0===a||a.setValue(t)}setCountryCodeElementAttributes(e){Object.entries(e||{}).forEach((([e,n])=>{var a,t;!1===n||null==n?null===(a=this.countryCodeElement)||void 0===a||a.removeAttribute(e):null===(t=this.countryCodeElement)||void 0===t||t.setAttribute(e,String(n))}))}getPhoneValidationResult(e,n=""){return b.phone(n+e,{validateMobilePrefix:!1})}connectEventListeners(){var e,n,a,t;null===(e=this.countryCodeElement)||void 0===e||e.addEventListener("rChange",this.handleValueChange),null===(n=this.parentFormEl)||void 0===n||n.addEventListener("formdata",this.contributeToFormData),null===(a=this.parentFormEl)||void 0===a||a.addEventListener("submit",this.onSubmitForm,{capture:!0}),null===(t=this.parentFormEl)||void 0===t||t.addEventListener("reset",this.onResetForm)}disconnectEventListeners(){var e,n,a,t;null===(e=this.countryCodeElement)||void 0===e||e.removeEventListener("rChange",this.handleValueChange),null===(n=this.parentFormEl)||void 0===n||n.removeEventListener("formdata",this.contributeToFormData),null===(a=this.parentFormEl)||void 0===a||a.removeEventListener("submit",this.onSubmitForm),null===(t=this.parentFormEl)||void 0===t||t.removeEventListener("reset",this.onResetForm)}componentWillLoad(){this.initial.value=this.value,this.initial.invalid=this.invalid,this.updateValues(this.value);const e={disabled:`${!!this.disabled}`,required:`${!!this.required}`,readonly:`${!!this.readonly}`,label:this.countryCodeLabel};this.setCountryCodeElementAttributes(Object.assign(Object.assign({},{"show-leading-icon":"true","leading-icon":"globe",placeholder:"+00",internal:"true"}),e))}componentDidLoad(){this.connectEventListeners()}disconnectedCallback(){this.disconnectEventListeners()}render(){const{label:e,fieldIndicator:n,hint:o,name:h,form:i,inputLabel:_,tooltip:l,tooltipIcon:r,tooltipIconColor:u,disabled:c,uniqueId:p,required:b,valid:m,invalid:s,novalidate:g,phoneNumber:y,fullPhoneNumber:d,fullWidth:w}=this,v=Object.assign({fieldIndicator:n},l?{tooltip:l,"tooltip-icon":r,"tooltip-icon-color":u}:{}),M={id:p,form:i,name:h,novalidate:g,required:b,disabled:c,"aria-describedby":this.ariaDescribedBy};return a(t,{key:"4551070926e1974ddf3fcb8cc435570ddde50276"},a("div",{key:"a076fb01b4e0563ec2d30a5680a6ccd48b2f6895",class:"r-input-phone-number--label-container"},a("label",{key:"a8ad943efeca2ac3b5a63857ea0a52b19c32f09c",id:`${p}-label`},e&&a("r-label",Object.assign({key:"ac0d2a1c12cb85ec03e6596b9bb2e28328026eac"},v),e)),a("slot",{key:"cadd98a33c32bfb60be0a3448772eac483630bdf",name:"popover"})),o&&a("r-hint",{key:"23874cabee60dc0a5e620066eed92de809cac1eb",id:`${p}-hint`,role:"note"},o),a("div",{key:"800b3a389ce815c5e137077dd5766177c317a05d",class:"r-input-phone-number",role:"group","aria-labelledby":`${p}-label`,"aria-describedby":this.ariaDescribedBy},a("slot",{key:"6106007980212ef05cd11304da2a4d0cc28ddf4f"}),a("r-input",{key:"d65b4d9ca8761c7e6dd08359ff02f3c88c57aa66",label:_,value:y,internal:!0,valid:m,invalid:s,required:b,readonly:this.readonly,novalidate:!0,fullWidth:w,type:"tel",error:this.errorMessage||"",onRInput:this.handleOnInput,onRChange:this.handleInputOnChange,disabled:c},m&&y&&a("r-icon",{key:"09c721cb014d6d7ece724bcf7de9ec5928624dac",slot:"trailing",name:"circled-check",size:"s",color:"var(--r-status-success-regular)"}))),a("input",Object.assign({key:"e2eef2512f9125f0dd3d1b09120cbb77955350bd",type:"hidden"},M,{readonly:this.readonly,value:d,ref:e=>this.nativeElement=e})),a("r-hint",{key:"a12e9640bcf2df7b754de4e54b111e4ead2d023e","aria-live":"polite","aria-atomic":"true",id:`${p}-message`,class:!this.hasMessage&&"visually-hidden",variant:"error"},this.hasMessage?this.hasError?this.error:this.validityMessage:""))}get host(){return o(this)}static get watchers(){return{value:["watchValueChange"],disabled:["handleDisabledChange"],required:["handleRequiredChange"],readonly:["handleReadonlyChange"],label:["handleLabelChange"]}}};m.style=":host{display:inline-flex;flex-direction:column;vertical-align:top;--r-input--container--margin-top:0;--r-input--container--margin-bottom:0}:host slot{display:contents}:host ::slotted(r-select){min-width:var(--r-input-phone-number--select--min-width, 7rem);width:var(--r-input-phone-number--select--width, fit-content)}:host r-input.focused{--r-input--container--border-style:solid}:host([full-width]:not([full-width=false])){width:100%}.r-input-phone-number{margin-top:var(--r-input-phone-number--margin-top, var(--r-spacing-025, 0.25rem));margin-bottom:var(--r-input-phone-number--margin-bottom, var(--r-spacing-025, 0.25rem));width:var(--r-input-phone-number--width, 100%);display:var(--r-input-phone-number--display, inline-flex);justify-content:var(--r-input-phone-number--justify-content, center);align-items:var(--r-input-phone-number--align-items, center);gap:var(--r-input-phone-number--gap, 0)}.r-input-phone-number--label-container{display:var(--r-input-phone-number--label-container--display, flex);gap:var(--r-input-phone-number--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-input-phone-number--label-container--align-items, center);justify-content:var(--r-input-phone-number--label-container--align-items, space-between)}.r-input-phone-number--label-container ::slotted([slot=popover]){display:var(--r-input-phone-number--popover--display, inline-flex);height:var(--r-input-phone-number--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-input-phone-number--popover--align-items, center);justify-content:var(--r-input-phone-number--popover--justify-content, center);margin-right:var(--r-input-phone-number--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-input-phone-number--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-input-phone-number--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-input-phone-number r-input{margin-left:-1px;flex:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";export{m as r_input_phone_number}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,H as s,g as r}from"./p-Da7qOBFr.js";import{a}from"./p-DvLT8-y3.js";import{S as l}from"./p-4Uv3PpKT.js";const o=class{constructor(s){t(this,s),this.rValidate=e(this,"rValidate"),this.rChange=e(this,"rChange"),this.rReset=e(this,"rReset"),this.showValid=!1,this.fullWidth=!1,this.leadingIconSize="s",this.trailingIcon="angle-down",this.tralingIconSize="s",this.listboxPosition="bottom",this.toggleButtonAriaLabel="Toggle combobox",this.noResultsFound="No results found",this.validityState="",this.validityMessage="",this.isExpanded=!1,this.isReadonly=!1,this.currentValue="",this.valueToDisplay="",this.isInitializing=!1,this.isResetting=!1,this.focusedOption=null,this.isValueFocused=!1,this.isNoResultsFound=!1,this.touched=!1,this.dirty=!1,this.handleSlotChange=()=>{setTimeout((()=>{this.initialize(),this.defineHostWidth()}),0)},this.initial={},this.uniqueId=`r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g,""),this.getValidityStateData=t=>{let e="",i="";for(const s in t.validity)if(t.validity[s]){if(e=s,this[s+"Message"])return i=this[s+"Message"],{validityState:e,validityMessage:i};i=t.validationMessage}return{validityState:e,validityMessage:i}},this.validateFormElement=(t=null)=>{if(null===t)return;if(this.isNoValidate)return;if(this.error)return;const{validityState:e,validityMessage:i}=this.getValidityStateData(t);this.validityState=e,this.validityMessage=i;const s="valid"===this.validityState;this.valid=s,this.invalid=!s,this.rValidate.emit({state:this.validityState,message:this.validityMessage})},this.typeaheadBuffer="",this.typeaheadTimeout=null,this.lastTypeaheadIndex=-1,this.contributeToFormData=t=>{a(this.nativeElement,t.formData)},this.onValueClick=t=>{var e;this.disabled||(t.preventDefault(),t.stopPropagation(),this.touched=!0,this.toggle(),this.isExpanded&&(this.combobox&&(null===(e=this.valueElement)||void 0===e||e.focus()),this.defineListboxPositionState()))},this.keyboardEventHandlerFactory=(t,e=!1)=>{switch(t){case"Enter":return()=>{var t;if(this.isExpanded){const e=(null===(t=this.focusedOption)||void 0===t?void 0:t.value)||"";return e!==this.currentValue&&(this.dirty=!0),void this.setValueFromUserInteraction(e)}this.expand(),this.setOptionFocus(this.selectedElement)};case"Escape":return()=>{this.collapse(),this.reportValidity()};case"ArrowUp":return()=>{var t;if(this.isExpanded){if(this.focusedOption&&e){const e=(null===(t=this.focusedOption)||void 0===t?void 0:t.value)||"";return e!==this.currentValue&&(this.dirty=!0),void this.setValueFromUserInteraction(e)}(this.combobox||this.focusedOption!==this.optionElements[0])&&(this.focusedOption?this.focusPrevOption():this.setOptionFocus(this.selectedElement||this.optionElements[0]))}else this.expand(),this.setOptionFocus(this.selectedElement||this.optionElements[this.combobox?this.optionElements.length-1:0])};case"ArrowDown":return()=>{if(this.isExpanded)(this.combobox||this.focusedOption!==this.optionElements[this.optionElements.length-1])&&(this.focusedOption?this.focusNextOption():this.setOptionFocus(this.selectedElement||this.optionElements[0]));else{if(this.expand(),e)return;this.setOptionFocus(this.selectedElement||this.optionElements[0])}};case"Home":return()=>{if(!this.isExpanded)return this.expand(),void this.setOptionFocus(this.selectedElement||this.optionElements[0]);this.setOptionFocus(this.optionElements[0])};case"End":return()=>{if(!this.isExpanded)return this.expand(),void this.setOptionFocus(this.selectedElement||this.optionElements[this.optionElements.length-1]);this.setOptionFocus(this.optionElements[this.optionElements.length-1])};case"PageUp":return()=>{if(!this.isExpanded)return;if(null===this.focusedOption)return;const t=this.optionElementsArray.indexOf(this.focusedOption);-1!==t&&this.setOptionFocus(this.optionElements[t-10>=0?t-10:0])};case"PageDown":return()=>{if(!this.isExpanded)return;if(null===this.focusedOption)return;const t=this.optionElementsArray.indexOf(this.focusedOption);if(-1===t)return;const e=this.optionElements.length-1;this.setOptionFocus(this.optionElements[t+10<=e?t+10:e])};case"Tab":return()=>{var t;const e=(null===(t=this.focusedOption)||void 0===t?void 0:t.value)||"";e!==this.currentValue&&(this.dirty=!0),this.setValueFromUserInteraction(e)};default:return()=>{}}},this.onValueKeydown=t=>{if(t.stopPropagation(),["ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Space","Enter","Escape"].includes(t.code))t.preventDefault();else if(1===t.key.length&&!t.ctrlKey&&!t.metaKey&&!t.altKey)return this.isExpanded||this.expand(),void this.handleTypeahead(t.key);switch(t.code){case"Space":this.keyboardEventHandlerFactory("Enter")();break;case"Tab":if(null===this.focusedOption)break;this.keyboardEventHandlerFactory("Tab")();break;default:this.keyboardEventHandlerFactory(t.code,t.altKey)()}},this.onComboboxKeydown=t=>{switch(t.stopPropagation(),["ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter","Escape"].includes(t.code)&&t.preventDefault(),t.code){case"Tab":if(null===this.focusedOption){this.collapse();break}this.keyboardEventHandlerFactory("Tab")();break;case"Escape":if(this.isExpanded)return void this.keyboardEventHandlerFactory("Escape")();this.valueElement.value="";const e="";e!==this.currentValue&&(this.dirty=!0),this.setValueFromUserInteraction(e),this.reportValidity();break;default:this.keyboardEventHandlerFactory(t.code,t.altKey)()}},this.onValueBlur=()=>{this.isValueFocused=!1;const{isBusy:t,isExpanded:e}=this;t||e||this.reportValidity()},this.onValueFocus=()=>{this.isValueFocused=!0,this.touched=!0},this.filterOptionsListByComboboxValue=(t="")=>{const e=Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));e.forEach((e=>{var i,s;const r=-1!==(null===(s=null===(i=null==e?void 0:e.textContent)||void 0===i?void 0:i.trim())||void 0===s?void 0:s.toLowerCase()).search(t.toLowerCase());e.setAttribute("aria-hidden",`${!r}`)})),this.isNoResultsFound=e.every((t=>"true"===(null==t?void 0:t.getAttribute("aria-hidden")))),this.isNoResultsFound&&(this.statusElement.innerHTML=this.noResultsFound,setTimeout((()=>{this.statusElement.innerText=""}),1e3))},this.clearComboboxOptions=()=>{this.combobox&&this.filterOptionsListByComboboxValue()},this.onComboboxChange=t=>{this.filterOptionsListByComboboxValue(t.target.value)},this.onComboboxInput=t=>{this.filterOptionsListByComboboxValue(t.target.value),this.isExpanded||(this.expand(),this.defineListboxPositionState())},this.onSubmitForm=t=>{this.isNoValidate||(this.reportValidity(),this.invalid&&(t.preventDefault(),t.stopPropagation()))},this.onResetForm=()=>{this.resetValidation(),this.markAsPristine(),this.setValue(this.initial.value),this.rReset.emit({element:this.host,value:this.currentValue})},this.renderSelect=t=>{var e,s;return i("span",Object.assign({class:"r-select--value",role:"combobox"},t,{ref:t=>this.valueElement=t,onClick:this.isInteractive?this.onValueClick:null,onKeyDown:this.isInteractive?this.onValueKeydown:null,onBlur:this.isInteractive?this.onValueBlur:null,onFocus:this.isInteractive?this.onValueFocus:null}),i("span",{class:"r-select--value-display"},this.isLeadingSlotRendered?i("slot",{name:"leading"}):null,i("span",{class:"r-select--value-selected",innerHTML:(null===(s=null===(e=this.valueToDisplay)||void 0===e?void 0:e.trim)||void 0===s?void 0:s.call(e))||this.placeholder||""})),i("span",{class:"r-select--value-arrow"},i("r-icon",{class:"r-select--trailing-icon",name:"angle-down",size:"s"})))},this.renderCombobox=t=>{var e,s,r;return i("div",{class:"r-select--value",onClick:this.isInteractive?this.onValueClick:null,ref:t=>this.comboboxContainerElement=t},i("div",{class:"r-select--value-display"},this.isLeadingSlotRendered?i("slot",{name:"leading"}):null,i("input",Object.assign({role:"combobox",autocomplete:"off","aria-autocomplete":"list",disabled:this.disabled,readonly:this.readonly,type:"text"},t,{class:"r-select--input",ref:t=>this.valueElement=t,onKeyDown:this.isInteractive?this.onComboboxKeydown:null,onBlur:this.isInteractive?this.onValueBlur:null,onFocus:this.isInteractive?this.onValueFocus:null,onChange:this.isInteractive?this.onComboboxChange:null,onInput:this.isInteractive?this.onComboboxInput:null,placeholder:this.placeholder||"",value:(null===(r=null===(s=null===(e=this.selectedElement)||void 0===e?void 0:e.textContent)||void 0===s?void 0:s.trim)||void 0===r?void 0:r.call(s))||""}))),i("button",{"aria-label":this.toggleButtonAriaLabel,"aria-expanded":`${this.expanded||!1}`,"aria-controls":`${this.uniqueId}-list`,disabled:this.disabled,tabindex:"-1",class:"r-select--value-arrow-button r-select--value-arrow"},i("r-icon",{class:"r-select--trailing-icon",name:"angle-down",size:"s"})),i("div",{class:"visually-hidden",role:"status",ref:t=>this.statusElement=t}))}}async setReadonly(){this.collapse(),this.resetValidation(),this.isReadonly=!0}async clearReadonly(){this.isReadonly=!1}handleListboxPositionChange(){this.defineListboxPositionState()}handleExpandedChange(){this.expanded?this.expand():this.collapse()}handleReadonlyChange(){this.readonly?this.setReadonly():this.clearReadonly()}handleValueChange(t,e){this.isInitializing||void 0!==e&&e!==t&&(this._renderSelected(t,!1),this.clearComboboxOptions())}optionSelectAction(t){t.stopPropagation(),this.disabled||(t.target.value!==this.currentValue&&(this.dirty=!0),this.setValueFromUserInteraction(t.target.value))}tooltipFocusAction(){this.collapse(),this.reportValidity()}onMouseup(t){this.isExpanded&&(t.stopPropagation(),this.host.contains(t.target)||(this.collapse(),this.reportValidity()))}onKeyup(t){this.isExpanded&&(t.stopPropagation(),this.host.contains(t.target)||(this.collapse(),this.reportValidity()))}handleScrolling(){this.isExpanded&&this.defineListboxPositionState()}handleResizing(){this.isExpanded&&this.defineListboxPositionState()}async setValue(t=""){this.resetValidation(),this._renderSelected(t,!1),this.clearComboboxOptions()}setValueFromUserInteraction(t=""){this.resetValidation(),this._renderSelected(t,!0),this.clearComboboxOptions()}async getValue(){return this.currentValue||""}async reset(){if(this.resetValidation(),this.markAsPristine(),this.collapse(),this.clearComboboxOptions(),this.currentValue!==this.initial.value){if(""!==this.initial.value&&this.initiallySelectedElement)return this.isResetting=!0,this.setValue(this.initial.value),void(this.isResetting=!1);this.deselectOptions(),this.currentValue="",this.valueToDisplay=""}}async resetValidation(){this.validityMessage=null,this.validityState=null,this.invalid=this.initial.invalid,this.valid=!this.invalid}async isTouched(){return this.touched}async isDirty(){return this.dirty}async markAsPristine(){this.touched=!1,this.dirty=!1}async checkValidity(){const{validityState:t}=this.getValidityStateData(this.nativeElement);return"valid"===t}async reportValidity(){return this.validateFormElement(this.nativeElement),"valid"===this.validityState}async setFocus(){var t;null===(t=this.valueElement)||void 0===t||t.focus()}async setBlur(){var t;null===(t=this.valueElement)||void 0===t||t.blur()}async expand(){this.isExpanded=!0}async collapse(){this.isExpanded=!1,this.isBusy||(this.clearOptionsFocus(),this.setComboboxValueOnCollapse())}async getFocusedOption(){return this.host.querySelector('r-select-option[data-focused="true"]')||null}async setFocusedOption(t){return this.setOptionFocus(this.optionElements[t])}clearOptionsFocus(){var t;this.focusedOption=null;try{this.valueElement.ariaActiveDescendantElement=null}catch(e){null===(t=this.valueElement)||void 0===t||t.removeAttribute("aria-activedescendant")}this.focusedOptions.forEach((t=>t.setBlur()))}setComboboxValueOnCollapse(){var t,e,i;this.combobox&&(this.valueElement.value=(null===(i=null===(e=null===(t=this.selectedElement)||void 0===t?void 0:t.textContent)||void 0===e?void 0:e.trim)||void 0===i?void 0:i.call(e))||"",this.clearComboboxOptions())}get focusedOptions(){return Array.from(this.host.querySelectorAll('r-select-option[data-focused="true"]'))}toggle(){this.isExpanded=!this.isExpanded}get selectedElement(){return this.host.querySelector(`r-select-option[value="${this.currentValue}"]`)}get initiallySelectedElement(){return this.host.querySelector(`r-select-option[value="${this.initial.value}"]`)||null}get parentFormEl(){return this.host.closest("form")||document.querySelector(`#${this.form}`)||null}get isNoValidate(){var t;return(null===(t=this.parentFormEl)||void 0===t?void 0:t.hasAttribute("novalidate"))||this.novalidate||!1}get optionElements(){return this.host.querySelectorAll('r-select-option:not([disabled]:not([disabled="false"])):not([aria-hidden="true"])')||null}get optionElementsArray(){return Array.from(this.optionElements)}deselectOptions(){this.optionElements&&this.optionElements.forEach((t=>t.clearSelected()))}get isBusy(){return this.isInitializing||this.isResetting}_renderSelected(t="",e=!0){var i,s;this.currentValue=t,null===this.currentValue?this.host.removeAttribute("value"):this.host.setAttribute("value",this.currentValue);const r=this.host.querySelector(`r-select-option[value="${null===(i=this.currentValue)||void 0===i?void 0:i.trim()}"]`);this.valueToDisplay=(null==r?void 0:r.innerHTML)||(null==r?void 0:r.textContent)||this.currentValue||"",null===(s=this.optionElements)||void 0===s||s.forEach((e=>{e.value===t?e.setSelected():e.clearSelected()})),this._renderNativeOption(),this.isExpanded&&this.collapse(),this.isBusy||this.reportValidity(),e&&!this.isBusy&&this.dirty&&this.rChange.emit({element:this.host,value:t})}setOptionFocus(t=this.selectedElement){t&&null!==this.optionElements&&requestAnimationFrame((()=>{var e;this.clearOptionsFocus(),t.setFocus(),this.focusedOption=t;try{this.valueElement.ariaActiveDescendantElement=t}catch(i){null===(e=this.valueElement)||void 0===e||e.setAttribute("aria-activedescendant",t.id)}((t,e)=>{var i,s;if(!e)return;try{null===(i=t.scrollIntoView)||void 0===i||i.call(t,{block:"nearest",inline:"nearest"})}catch(e){null===(s=t.scrollIntoView)||void 0===s||s.call(t,!1)}const r=t.getBoundingClientRect(),a=e.getBoundingClientRect();(r.top<a.top||r.bottom>a.bottom)&&((t,e)=>{const i=t.offsetTop,s=i+t.offsetHeight,r=e.scrollTop,a=r+e.clientHeight;i<r?e.scrollTop=i:s>a&&(e.scrollTop=s-e.clientHeight)})(t,e)})(t,this.listboxElement)}))}focusPrevOption(t=this.focusedOption||this.selectedElement){if(null===this.optionElements)return;const e=this.optionElementsArray.indexOf(t)-1;this.setOptionFocus(e>=0?this.optionElements[e]:this.optionElements[this.optionElements.length-1])}focusNextOption(t=this.focusedOption||this.selectedElement){if(null===this.optionElements)return;const e=this.optionElementsArray.indexOf(t)+1;this.setOptionFocus(e<=this.optionElements.length-1?this.optionElements[e]:this.optionElements[0])}filterOptions(t,e){if(!e)return[];const i=e.toLowerCase();return t.filter((t=>!t.disabled&&(t.textContent||"").trim().toLowerCase().startsWith(i)))}getIndexByLetter(t,e,i=0){if(!t.length||!e)return-1;const s=[...t.slice(i),...t.slice(0,i)],r=this.filterOptions(s,e).sort(((t,e)=>(t.textContent||"").trim().toLowerCase().localeCompare((e.textContent||"").trim().toLowerCase()))),a=e.split("").every((t=>t===e[0]));if(r[0])return t.indexOf(r[0]);if(a){const i=this.filterOptions(s,e[0]);return i[0]?t.indexOf(i[0]):-1}return-1}handleTypeahead(t){clearTimeout(this.typeaheadTimeout);const e=this.optionElementsArray;let i;if(this.typeaheadBuffer+=t.toLowerCase(),this.typeaheadBuffer.split("").every((t=>t===this.typeaheadBuffer[0]))&&-1!==this.lastTypeaheadIndex)i=(this.lastTypeaheadIndex+1)%e.length;else{const t=e.indexOf(this.focusedOption||this.selectedElement);i=-1===t?0:(t+1)%e.length}const s=this.getIndexByLetter(e,this.typeaheadBuffer,i);if(-1!==s){this.lastTypeaheadIndex=s;const t=e[s];this.isExpanded||this.expand(),this.setOptionFocus(t)}this.typeaheadTimeout=setTimeout((()=>{this.typeaheadBuffer=""}),500)}connectFormEventListeners(){this.parentFormEl&&(this.parentFormEl.addEventListener("formdata",this.contributeToFormData),this.parentFormEl.addEventListener("submit",this.onSubmitForm,{capture:!0}),this.parentFormEl.addEventListener("reset",this.onResetForm))}disconnectFormEventListeners(){this.parentFormEl&&(this.parentFormEl.removeEventListener("formdata",this.contributeToFormData),this.parentFormEl.removeEventListener("submit",this.onSubmitForm),this.parentFormEl.removeEventListener("reset",this.onResetForm))}defineHostWidth(){if(this.fullWidth)return;const t=this.host.shadowRoot.querySelector(".r-select--native").getBoundingClientRect().width,e=(this.combobox?this.comboboxContainerElement:this.valueElement).getBoundingClientRect().width,i=this.listboxElement.getBoundingClientRect().width,s=Math.max(t,e,i);this.host.style.setProperty("--width",`${s}px`)}_renderNativeOption(){var t,e,i,s,r;const a=document.createElement("option"),l=document.createTextNode(null===(i=null===(e=null===(t=this.selectedElement)||void 0===t?void 0:t.textContent)||void 0===e?void 0:e.trim)||void 0===i?void 0:i.call(e));a.value=this.currentValue,a.selected=!0,a.appendChild(l),this.nativeElement&&(this.nativeElement.innerHTML="",null===(s=this.nativeElement)||void 0===s||s.appendChild(a),this.nativeElement.value=this.currentValue,null===(r=this.nativeElement)||void 0===r||r.setAttribute("value",this.currentValue))}notVisible(t){return"visible"!==getComputedStyle(t).overflow}findOverflowParent(t){var e,i;return(null===(e=t.parentNode)||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?this.findOverflowParent(null===(i=t.parentNode)||void 0===i?void 0:i.host):this.notVisible(t)?t:t.parentElement?this.findOverflowParent(t.parentElement):null}get ariaDescribedBy(){const t=`${this.uniqueId}-message`;return this.hint?`${this.uniqueId}-hint ${t}`:t}get overflowedParent(){return this.findOverflowParent(this.host.parentElement)}get top(){var t,e;return this.overflowedParent?Math.abs(this.overflowedParent.getBoundingClientRect().top-(null===(e=this.valueElement)||void 0===e?void 0:e.getBoundingClientRect().top)):null===(t=this.valueElement)||void 0===t?void 0:t.getBoundingClientRect().top}get bottom(){var t;function e(t){return window.innerHeight-t.getBoundingClientRect().top-t.getBoundingClientRect().height}const i=window.getComputedStyle(this.messageContainer),s=(null===(t=this.messageContainer)||void 0===t?void 0:t.getBoundingClientRect().height)+parseFloat(i.marginTop),r=e(this.host)+s;return this.overflowedParent?Math.abs(e(this.overflowedParent)-r):r+s}defineListboxPositionState(){var t,e;const i=(null===(t=this.listboxElement)||void 0===t?void 0:t.offsetHeight)<this.bottom,s=(null===(e=this.listboxElement)||void 0===e?void 0:e.offsetHeight)<this.top;if("top"===this.listboxPosition&&(s||!i)||"bottom"===this.listboxPosition&&(i||!s))this.listboxPositionState=this.listboxPosition;else switch(this.listboxPosition){case"top":this.listboxPositionState=s?"top":"bottom";break;case"bottom":this.listboxPositionState=i?"bottom":"top"}}initialize(){var t;const e=this.value||"";if(this.initial.value=this.value||"",this.initial.invalid=this.invalid||!1,this.listboxPositionState=this.listboxPosition,this.optionElementsArray.find((t=>t.value.trim()===e)))return this.isInitializing=!0,this.setValue(e),void(this.isInitializing=!1);if(this.placeholder)return;if(this.combobox)return;const i=null===(t=this.optionElements)||void 0===t?void 0:t[0];i&&(this.isInitializing=!0,this.setValue(null==i?void 0:i.value),this.isInitializing=!1)}initializeStyleObserver(){!this.listboxWidthObserver&&this.listboxElement&&(this.listboxWidthObserver=new l((()=>{this.listboxElement&&(this.listboxElement.getBoundingClientRect().width<=this.host.getBoundingClientRect().width||this.defineHostWidth())})),this.listboxWidthObserver.observe([this.listboxElement],["width"]))}get hasError(){var t;return this.invalid&&(null===(t=this.error)||void 0===t?void 0:t.length)>0}get hasValidationError(){var t;return"valid"!==this.validityState&&(null===(t=this.validityMessage)||void 0===t?void 0:t.length)>0}get hasValidationSuccess(){return this.valid&&this.validMessage&&this.showValid}get hasMessage(){return this.hasError||this.hasValidationError||this.hasValidationSuccess}get isInteractive(){return!this.disabled&&!this.isReadonly}get hasLeadingSlot(){return!!this.host.querySelector('[slot="leading"]')}get hasOptionIcon(){return!!this.optionElementsArray.find((t=>!!t.querySelector('[slot="icon"]')))}get isLeadingSlotRendered(){return this.hasLeadingSlot&&this.hasOptionIcon&&!this.currentValue}get isPlaceholder(){var t,e;const{placeholder:i}=this;return((null===(e=null===(t=this.valueToDisplay)||void 0===t?void 0:t.trim)||void 0===e?void 0:e.call(t))||i||"")===i}connectedCallback(){this.connectFormEventListeners()}disconnectedCallback(){this.disconnectFormEventListeners()}componentWillLoad(){this.isExpanded=this.expanded,this.isReadonly=this.readonly}componentDidLoad(){this.defineListboxPositionState(),this.initializeStyleObserver()}render(){var t;const{uniqueId:e,disabled:r,isExpanded:a,fieldIndicator:l,invalid:o,placeholder:n,required:h,hint:c,label:d,internal:v,tooltip:u,tooltipIcon:p,tooltipIconColor:b}=this,f=d?Object.assign({fieldIndicator:l},u&&!r?{tooltip:u,"tooltip-icon":p,"tooltip-icon-color":b}:{}):{},g=!!this.isInteractive&&!!h,m={id:`${e}-value`,tabindex:""+(r?-1:0),"aria-controls":`${e}-list`,"aria-describedby":this.ariaDescribedBy,"aria-disabled":`${r||!1}`,"aria-expanded":`${a||!1}`,"aria-invalid":`${o||!1}`,"aria-readonly":`${!this.isInteractive||!1}`,"aria-required":`${g}`,"aria-labelledby":`${e}-label`},y={"aria-label":d},w={placeholder:n,name:this.name,value:this.currentValue,"aria-hidden":"true",tabindex:"-1",invalid:o,disabled:r,required:g};return i(s,{key:"9c22bae93d955802f695b20f25d3ff5c79fcc7d8","data-value":this.currentValue,expanded:!this.disabled&&this.isExpanded,"data-listbox-position":this.listboxPositionState,"data-initial-value":this.initial.value,"data-is-placeholder":`${!!this.isPlaceholder}`,"data-value-focused":`${!!this.isValueFocused}`,"data-option-focused":`${!!this.focusedOption}`,"data-validity-state":`${this.validityState||""}`,"data-validity-message":`${this.validityMessage||""}`,"data-readonly":`${!!this.isReadonly}`,"data-touched":`${this.touched}`,"data-dirty":`${this.dirty}`},i("div",{key:"2e8de0d2041d00c4d90caf5aba2aeb50fcfc86e5",class:"r-select--label "+(v?"":"r-select--label__margin-bottom")},i("div",{key:"273524030b099899861c93e9bba205c6c820d425",class:v?"visually-hidden":"r-select--label-container"},i("label",{key:"f050500698aa5a48d6db101074129fae09899de3",id:`${e}-label`,onClick:this.isInteractive?this.onValueClick:null},i("r-label",Object.assign({key:"b5560ba5b8ee794eb775a555dec514f4d6e6546f"},f),d)),i("slot",{key:"bbbbe371702b95ac3d1636756eb673dc44c0dcb4",name:"popover"})),c&&i("r-hint",{key:"27585bacce2143f20bdb20a3e03b5700dbb87d9b",id:`${e}-hint`,class:"r-select--hint"},c)),i("div",{key:"92a69fbee0890d5ddab0353348cdb4d8eb772137",class:"r-select"},i("select",Object.assign({key:"bc2de60d73dcebf750a99e7b88eacc701a8c0b85",class:"r-select--native",ref:t=>this.nativeElement=t},w)),i("div",{key:"b561dee21bdf58abe51786564a18812a20a0e97f",class:"r-select--container"},this.combobox?this.renderCombobox(m):this.renderSelect(m),i("div",Object.assign({key:"06984ccf7f6740e2480ef61924676e99d40044d4",role:"listbox",tabindex:"-1",id:`${e}-list`,class:"r-select--options",ref:t=>this.listboxElement=t},y),(this.isNoResultsFound||!(null===(t=this.optionElements)||void 0===t?void 0:t.length))&&i("r-select-option",{key:"67888a456006e44869081876d35cdceca754942d","data-no-results":"true",value:"no_results"},this.noResultsFound),i("slot",{key:"4f404790887ad37d488183d814bb69f33c262688",onSlotchange:this.handleSlotChange})))),i("div",{key:"0b223f242cfc90ce38a0cf83d38dc0c81348b36d",id:`${e}-message`,"aria-live":"polite","aria-atomic":"true",ref:t=>this.messageContainer=t,class:this.hasMessage&&!v?"r-select--message":"visually-hidden"},this.hasMessage&&i("r-hint",{key:"57336df2dd79b8f91be950f7a4ca05258ec26184",variant:this.invalid?"error":"success"},this.hasError&&this.error,this.hasValidationError&&this.validityMessage,this.hasValidationSuccess&&this.validMessage)))}get host(){return r(this)}static get watchers(){return{listboxPosition:["handleListboxPositionChange"],expanded:["handleExpandedChange"],readonly:["handleReadonlyChange"],value:["handleValueChange"]}}};o.style=":host{display:inline-flex;flex-direction:column;width:var(--width, auto);transition:width 0.2s ease-out;max-width:none;opacity:1;outline:none}:host slot{display:contents}:host(:hover:not([disabled]:not([disabled=false]))){--r-select--container--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([expanded]:not([expanded=false])){--r-select--options--visibility:visible;--r-select--options--z-index:1;--r-select--background-color:var(--r-background-interactive-softest, #fff);--r-select--value--border-color:var(--r-border-soft, #686868);--r-select--value--background-color:var(--r-background-interactive-softest, #fff);--r-select--trailing-icon--transform:rotate(180deg)}:host([invalid]:not([invalid=false])){--r-select--container--background-color:var(--r-status-error-soft, #fef6f6);--r-select--value--border-color:var(--r-status-error-regular, #b00c15);--r-select--options--border-color:var(--r-status-error-regular, #b00c15)}:host([disabled]:not([disabled=false])){--r-select--opacity:0.4;--r-select--pointer-events:none;--r-select--cursor:not-allowed}:host([data-is-placeholder=true]){--r-select--value-diplay--color:var(--r-text-soft, #686868)}:host([data-max-width=set]){width:100%;--r-select--options--right:0}:host([full-width]){width:100%}:host([data-listbox-position=top]){--r-select--options--top:auto;--r-select--options--bottom:2.875em;--r-select--options--border-width:1px 1px 0 1px}:host([data-listbox-position=bottom]){--r-select--options--top:100%;--r-select--options--bottom:auto;--r-select--options--border-width:0 1px 1px 1px}:host([data-readonly=true]){--r-select--color:var(--r-text-soft, #686868);--r-select--value--background-color:var(--r-background-soft, #f3f1f0);--r-select--value--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-select--value--cursor:text;--r-select--value-arrow--visiblility:hidden}.r-select{display:var(--r-select--display, flex);flex-grow:var(--r-select--flex-grow, 1);flex-direction:var(--r-select--flex-direction, column);position:var(--r-select--position, relative);box-sizing:var(--r-select--box-sizing, border-box);max-width:var(--r-select--max-width, 100%);min-width:var(--r-select--min-width, fit-content);font-family:var(--r-select--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-select--font-weight, var(--r-font-weight-regular, 400));font-size:var(--r-select--font-size, var(--r-font-size-400, 1rem));text-align:var(--r-select--text-align, left);color:var(--r-select--color, var(--r-text-regular, #282828));opacity:var(--r-select--opacity, 1);pointer-events:var(--r-select--pointer-events, auto);cursor:var(--r-select--cursor, pointer)}.r-select--label__margin-bottom{margin-bottom:var(--r-select--label--margin-bottom, var(--r-spacing-025, 0.25rem))}.r-select--label-container{display:var(--r-select--label-container--display, flex);gap:var(--r-select--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-select--label-container--align-items, center);justify-content:var(--r-select--label-container--align-items, space-between)}.r-select--label-container ::slotted([slot=popover]){display:var(--r-select--popover--display, inline-flex);height:var(--r-select--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-select--popover--align-items, center);justify-content:var(--r-select--popover--justify-content, center);margin-right:var(--r-select--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-select--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-select--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-select--trailing-icon{transform:var(--r-select--trailing-icon--transform, rotate(0deg));transition:var(--r-select--trailing-icon--transition, transform 0.15s)}.r-select ::slotted([name=leading]){display:var(--r-select--value--leading-icon--display, flex);align-items:var(--r-select--value--leading-icon--align-items, center);color:var(--r-select--value--leading-icon--color, var(--r-icon-soft, #686868))}.r-select--container{background-color:var(--r-select--container--background-color, var(--r-background-softest, #fff));opacity:var(--r-select--container--opacity, 1);pointer-events:var(--r-select--container--pointer-events, auto)}.r-select--input{height:var(--r-select--input--height, 100%);width:var(--r-select--input--width, 100%);border:var(--r-select--input--border, none);outline:var(--r-select--input--outline, none);background-color:var(--r-select--input--background-color, inherit);color:var(--r-select--input--color, inherit);font-family:var(--r-select--input--font-family, inherit);font-size:var(--r-select--input--font-size, inherit);font-weight:var(--r-select--input--font-weight, inherit);padding:var(--r-select--input--padding, 0)}.r-select--native{position:var(--r-select--native--position, fixed);top:var(--r-select--native--top, -100vh);z-index:var(--r-select--native--z-index, -1);opacity:var(--r-select--native--opacity, 0);font-size:var(--r-select--native--font-size, 1rem);padding:var(--r-select--native--padding, 0 calc(48px + 0.75em) 0 0.75em)}.r-select--value:not([aria-readonly=true]):not(:has(input:read-only)):not(:has(input:disabled)):active{--r-select--value--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}.r-select--value[aria-disabled=false]:focus,.r-select--value:has(input:focus){outline:var(--r-select--value--outline, none);--r-select--value--z-index:2;--r-select--value--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-select--value--outline:2px solid var(--r-border-focused, #0071e3);--r-select--value--outline-offset:2px}.r-select--value{position:var(--r-select--value--position, relative);display:var(--r-select--value--display, inline-grid);grid-template-columns:var(--r-select--value--grid-template-columns, 1fr 1.75rem);box-sizing:var(--r-select--value--box-sizing, border-box);align-items:var(--r-select--value--align-items, center);justify-content:var(--r-select--value--justify-content, space-between);text-align:var(--r-select--value--text-align, left);min-width:var(--r-select--value--min-width, 100%);min-height:var(--r-select--value--min-height, var(--r-spacing-275, 2.75rem));padding:var(--r-select--value--padding, 0);white-space:var(--r-select--value--white-space, nowrap);background-color:var(--r-select--value--background-color, transparent);border-width:var(--r-select--value--border-width, 1px);border-style:var(--r-select--value--border-style, solid);border-color:var(--r-select--value--border-color, var(--r-border-soft, #686868));box-shadow:var(--r-select--value--box-shadow, none);outline:var(--r-select--value--outline, none);outline-offset:var(--r-select--value--outline-offset, 0);z-index:var(--r-select--value--z-index, 0);cursor:var(--r-select--value--cursor, inherit)}.r-select--value-display{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.5em);align-items:var(--r-select--value-diplay--align-tems, center);flex:var(--r-select--value-diplay--flex, 1);padding:var(--r-select--value-diplay--padding, 0 0.75em);overflow:var(--r-select--value-diplay--overflow, hidden);text-overflow:var(--r-select--value-diplay--text-overflow, ellipsis);color:var(--r-select--value-diplay--color, inherit);min-width:var(--r-select--value-diplay--min-width, fit-content);height:var(--r-select--value-diplay--height, 100%)}.r-select--value-selected{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.75em);align-items:var(--r-select--value-diplay--align-items, center)}.r-select--value-arrow{display:var(--r-select--value-arrow--display, flex);align-items:var(--r-select--value-arrow--align-items, center);justify-content:var(--r-select--value-arrow--justify-content, center);padding:var(--r-select--value-arrow--padding, 0 0.75em 0 0);visibility:var(--r-select--value-arrow--visiblility, visible)}.r-select--value-arrow-button{height:var(--r-select--value-arrow-button--height, 100%);background-color:var(--r-select--value-arrow-button--background-color, transparent);color:var(--r-select--value-arrow-button--color, inherit);border:var(--r-select--value-arrow-button--border, none);outline:var(--r-select--value-arrow-button--outline, none);cursor:var(--r-select--value-arrow-button--cursor, inherit)}.r-select--options{visibility:var(--r-select--options--visibility, hidden);position:var(--r-select--options--position, absolute);top:var(--r-select--options--top, 100%);right:var(--r-select--options--right, 0);bottom:var(--r-select--options--bottom, auto);left:var(--r-select--options--left, 0);margin:var(--r-select--options--margin, 0);padding:var(--r-select--options--padding, 0);list-style:var(--r-select--options--list-style, none);max-height:var(--r-select--options--max-height, 14.375em);min-width:var(--r-select--options--min-width, fit-content);overflow-y:var(--r-select--options--overflow-y, auto);background-color:var(--r-select--options--background-color, var(--r-background-interactive-softest, #fff));border-style:var(--r-select--options--border-style, solid);border-color:var(--r-select--options--border-color, var(--r-border-soft, #686868));border-width:var(--r-select--options--border-width, 0 1px 1px 1px);z-index:var(--r-select--options--z-index, -1)}.r-select--message{margin-top:var(--r-select--message--margin-top, var(--r-spacing-025, 0.25rem))}.hidden{display:none}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}@media (prefers-reduced-motion){:host{transition:none}}";export{o as r_select}
@@ -0,0 +1 @@
1
+ import{r as t,h as o,H as r,g as s}from"./p-Da7qOBFr.js";import{s as e,a as n}from"./p-B9rsR6cQ.js";import{f as a}from"./p-ky1yonnS.js";import"./p-4Uv3PpKT.js";const i=class{constructor(o){t(this,o),this.handleSlotChange=()=>{this.setButtonDefaults()}}connectedCallback(){this.setButtonDefaults();const t=this.host.closest("r-popover");e(this.host,t)}disconnectedCallback(){const t=this.host.closest("r-popover");n(this.host,t)}setButtonDefaults(){this.host.querySelectorAll("r-button").forEach((t=>{t.hasAttribute("size")||t.setAttribute("size","small"),t.hasAttribute("variant")||t.setAttribute("variant","text-inline")}))}async setFocus(){if(this.activeElement){if(!("setFocus"in this.activeElement)||"function"!=typeof this.activeElement.setFocus)return this.activeElement.focus(),this.activeElement;await this.activeElement.setFocus()}}async setBlur(){var t;null===(t=this.activeElement)||void 0===t||t.blur()}get activeElement(){return this.getActiveElements[0]||null}async getActiveElements(){return a(this.host)}render(){return o(r,{key:"573250bc4f9a1a8725e8808885854ca320b203bc",slot:"action"},o("slot",{key:"d753af20723fb9e2ae49f9977cda81fa1c3df8c6",onSlotchange:this.handleSlotChange}))}get host(){return s(this)}};i.style=":host slot{display:contents}::slotted(r-button){--r-button--color:var(--r-text-regular);--r-button--border-width:0;--r-button--background-color:rgba(0,0,0,0);--r-button--slot--position:relative;--r-button--slot--text-decoration:underline;--r-button--padding:10px 2px 18px 2px;--r-button--slot--text-underline-offset:9px}::slotted(r-button:hover:not([disabled]):not([disabled=false])){--r-button--background-color:var(--r-background-interactive-hovered)}::slotted(r-button:active:not([disabled]):not([disabled=false])){--r-button--background-color:var(--r-background-interactive-pressed)}";export{i as r_popover_action}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,F as r,H as n,g as a}from"./p-Da7qOBFr.js";import{a as s}from"./p-DvLT8-y3.js";function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,h,d={exports:{}},c=(u||(u=1,d.exports=function(){var t=6e4,i=36e5,e="millisecond",r="second",n="minute",a="hour",s="day",o="week",u="month",h="quarter",d="year",c="date",l="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var i=["th","st","nd","rd"],e=t%100;return"["+t+(i[(e-20)%10]||i[e]||i[0])+"]"}},g=function(t,i,e){var r=String(t);return!r||r.length>=i?t:""+Array(i+1-r.length).join(e)+t},m={s:g,z:function(t){var i=-t.utcOffset(),e=Math.abs(i),r=Math.floor(e/60),n=e%60;return(i<=0?"+":"-")+g(r,2,"0")+":"+g(n,2,"0")},m:function t(i,e){if(i.date()<e.date())return-t(e,i);var r=12*(e.year()-i.year())+(e.month()-i.month()),n=i.clone().add(r,u),a=e-n<0,s=i.clone().add(r+(a?-1:1),u);return+(-(r+(e-n)/(a?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:d,w:o,d:s,D:c,h:a,m:n,s:r,ms:e,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",y={};y[b]=v;var M="$isDayjsObject",D=function(t){return t instanceof S||!(!t||!t[M])},w=function t(i,e,r){var n;if(!i)return b;if("string"==typeof i){var a=i.toLowerCase();y[a]&&(n=a),e&&(y[a]=e,n=a);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var o=i.name;y[o]=i,n=o}return!r&&n&&(b=n),n||!r&&b},Y=function(t,i){if(D(t))return t.clone();var e="object"==typeof i?i:{};return e.date=t,e.args=arguments,new S(e)},k=m;k.l=w,k.i=D,k.w=function(t,i){return Y(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var S=function(){function v(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[M]=!0}var g=v.prototype;return g.parse=function(t){this.$d=function(t){var i=t.date,e=t.utc;if(null===i)return new Date(NaN);if(k.u(i))return new Date;if(i instanceof Date)return new Date(i);if("string"==typeof i&&!/Z$/i.test(i)){var r=i.match(f);if(r){var n=r[2]-1||0,a=(r[7]||"0").substring(0,3);return e?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(i)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return k},g.isValid=function(){return!(this.$d.toString()===l)},g.isSame=function(t,i){var e=Y(t);return this.startOf(i)<=e&&e<=this.endOf(i)},g.isAfter=function(t,i){return Y(t)<this.startOf(i)},g.isBefore=function(t,i){return this.endOf(i)<Y(t)},g.$g=function(t,i,e){return k.u(t)?this[i]:this.set(e,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,i){var e=this,h=!!k.u(i)||i,l=k.p(t),f=function(t,i){var r=k.w(e.$u?Date.UTC(e.$y,i,t):new Date(e.$y,i,t),e);return h?r:r.endOf(s)},p=function(t,i){return k.w(e.toDate()[t].apply(e.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(i)),e)},v=this.$W,g=this.$M,m=this.$D,b="set"+(this.$u?"UTC":"");switch(l){case d:return h?f(1,0):f(31,11);case u:return h?f(1,g):f(0,g+1);case o:var y=this.$locale().weekStart||0,M=(v<y?v+7:v)-y;return f(h?m-M:m+(6-M),g);case s:case c:return p(b+"Hours",0);case a:return p(b+"Minutes",1);case n:return p(b+"Seconds",2);case r:return p(b+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,i){var o,h=k.p(t),l="set"+(this.$u?"UTC":""),f=(o={},o[s]=l+"Date",o[c]=l+"Date",o[u]=l+"Month",o[d]=l+"FullYear",o[a]=l+"Hours",o[n]=l+"Minutes",o[r]=l+"Seconds",o[e]=l+"Milliseconds",o)[h],p=h===s?this.$D+(i-this.$W):i;if(h===u||h===d){var v=this.clone().set(c,1);v.$d[f](p),v.init(),this.$d=v.set(c,Math.min(this.$D,v.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},g.set=function(t,i){return this.clone().$set(t,i)},g.get=function(t){return this[k.p(t)]()},g.add=function(e,h){var c,l=this;e=Number(e);var f=k.p(h),p=function(t){var i=Y(l);return k.w(i.date(i.date()+Math.round(t*e)),l)};if(f===u)return this.set(u,this.$M+e);if(f===d)return this.set(d,this.$y+e);if(f===s)return p(1);if(f===o)return p(7);var v=(c={},c[n]=t,c[a]=i,c[r]=1e3,c)[f]||1,g=this.$d.getTime()+e*v;return k.w(g,this)},g.subtract=function(t,i){return this.add(-1*t,i)},g.format=function(t){var i=this,e=this.$locale();if(!this.isValid())return e.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=k.z(this),a=this.$H,s=this.$m,o=this.$M,u=e.weekdays,h=e.months,d=function(t,e,n,a){return t&&(t[e]||t(i,r))||n[e].slice(0,a)},c=function(t){return k.s(a%12||12,t,"0")},f=e.meridiem||function(t,i,e){var r=t<12?"AM":"PM";return e?r.toLowerCase():r};return r.replace(p,(function(t,r){return r||function(t){switch(t){case"YY":return String(i.$y).slice(-2);case"YYYY":return k.s(i.$y,4,"0");case"M":return o+1;case"MM":return k.s(o+1,2,"0");case"MMM":return d(e.monthsShort,o,h,3);case"MMMM":return d(h,o);case"D":return i.$D;case"DD":return k.s(i.$D,2,"0");case"d":return String(i.$W);case"dd":return d(e.weekdaysMin,i.$W,u,2);case"ddd":return d(e.weekdaysShort,i.$W,u,3);case"dddd":return u[i.$W];case"H":return String(a);case"HH":return k.s(a,2,"0");case"h":return c(1);case"hh":return c(2);case"a":return f(a,s,!0);case"A":return f(a,s,!1);case"m":return String(s);case"mm":return k.s(s,2,"0");case"s":return String(i.$s);case"ss":return k.s(i.$s,2,"0");case"SSS":return k.s(i.$ms,3,"0");case"Z":return n}return null}(t)||n.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(e,c,l){var f,p=this,v=k.p(c),g=Y(e),m=(g.utcOffset()-this.utcOffset())*t,b=this-g,y=function(){return k.m(p,g)};switch(v){case d:f=y()/12;break;case u:f=y();break;case h:f=y()/3;break;case o:f=(b-m)/6048e5;break;case s:f=(b-m)/864e5;break;case a:f=b/i;break;case n:f=b/t;break;case r:f=b/1e3;break;default:f=b}return l?f:k.a(f)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return y[this.$L]},g.locale=function(t,i){if(!t)return this.$L;var e=this.clone(),r=w(t,i,!0);return r&&(e.$L=r),e},g.clone=function(){return k.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},v}(),x=S.prototype;return Y.prototype=x,[["$ms",e],["$s",r],["$m",n],["$H",a],["$W",s],["$M",u],["$y",d],["$D",c]].forEach((function(t){x[t[1]]=function(i){return this.$g(i,t[0],t[1])}})),Y.extend=function(t,i){return t.$i||(t(i,S,Y),t.$i=!0),Y},Y.locale=w,Y.isDayjs=D,Y.unix=function(t){return Y(1e3*t)},Y.en=y[b],Y.Ls=y,Y.p={},Y}()),d.exports),l=o(c),f={exports:{}},p=(h||(h=1,f.exports=function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,e=/\d/,r=/\d\d/,n=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},o=function(t){return(t=+t)+(t>68?1900:2e3)},u=function(t){return function(i){this[t]=+i}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var i=t.match(/([+-]|\d\d)/g),e=60*i[1]+(+i[2]||0);return 0===e?0:"+"===i[0]?-e:e}(t)}],d=function(t){var i=s[t];return i&&(i.indexOf?i:i.s.concat(i.f))},c=function(t,i){var e,r=s.meridiem;if(r){for(var n=1;n<=24;n+=1)if(t.indexOf(r(n,0,i))>-1){e=n>12;break}}else e=t===(i?"pm":"PM");return e},l={A:[a,function(t){this.afternoon=c(t,!1)}],a:[a,function(t){this.afternoon=c(t,!0)}],Q:[e,function(t){this.month=3*(t-1)+1}],S:[e,function(t){this.milliseconds=100*+t}],SS:[r,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[n,u("seconds")],ss:[n,u("seconds")],m:[n,u("minutes")],mm:[n,u("minutes")],H:[n,u("hours")],h:[n,u("hours")],HH:[n,u("hours")],hh:[n,u("hours")],D:[n,u("day")],DD:[r,u("day")],Do:[a,function(t){var i=s.ordinal,e=t.match(/\d+/);if(this.day=e[0],i)for(var r=1;r<=31;r+=1)i(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],w:[n,u("week")],ww:[r,u("week")],M:[n,u("month")],MM:[r,u("month")],MMM:[a,function(t){var i=d("months"),e=(d("monthsShort")||i.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],MMMM:[a,function(t){var i=d("months").indexOf(t)+1;if(i<1)throw new Error;this.month=i%12||i}],Y:[/[+-]?\d+/,u("year")],YY:[r,function(t){this.year=o(t)}],YYYY:[/\d{4}/,u("year")],Z:h,ZZ:h};function f(e){var r;r=s&&s.formats;for(var n=(e=e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(i,e,n){var a=n&&n.toUpperCase();return e||r[n]||t[n]||r[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,i,e){return i||e.slice(1)}))}))).match(i),a=n.length,o=0;o<a;o+=1){var u=n[o],h=l[u],d=h&&h[1];n[o]=d?{regex:h&&h[0],parser:d}:u.replace(/^\[|\]$/g,"")}return function(t){for(var i={},e=0,r=0;e<a;e+=1){var s=n[e];if("string"==typeof s)r+=s.length;else{var o=s.regex,u=s.parser,h=t.slice(r),d=o.exec(h)[0];u.call(i,d),t=t.replace(d,"")}}return function(t){var i=t.afternoon;if(void 0!==i){var e=t.hours;i?e<12&&(t.hours+=12):12===e&&(t.hours=0),delete t.afternoon}}(i),i}}return function(t,i,e){e.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(o=t.parseTwoDigitYear);var r=i.prototype,n=r.parse;r.parse=function(t){var i=t.date,r=t.utc,a=t.args;this.$u=r;var o=a[1];if("string"==typeof o){var u=!0===a[2],h=!0===a[3],d=u||h,c=a[2];h&&(c=a[2]),s=this.$locale(),!u&&c&&(s=e.Ls[c]),this.$d=function(t,i,e,r){try{if(["x","X"].indexOf(i)>-1)return new Date(("X"===i?1e3:1)*t);var n=f(i)(t),a=n.year,s=n.month,o=n.day,u=n.hours,h=n.minutes,d=n.seconds,c=n.milliseconds,l=n.zone,p=n.week,v=new Date,g=o||(a||s?1:v.getDate()),m=a||v.getFullYear(),b=0;a&&!s||(b=s>0?s-1:v.getMonth());var y,M=u||0,D=h||0,w=d||0,Y=c||0;return l?new Date(Date.UTC(m,b,g,M,D,w,Y+60*l.offset*1e3)):e?new Date(Date.UTC(m,b,g,M,D,w,Y)):(y=new Date(m,b,g,M,D,w,Y),p&&(y=r(y).week(p).toDate()),y)}catch(t){return new Date("")}}(i,o,r,e),this.init(),c&&!0!==c&&(this.$L=this.locale(c).$L),d&&i!=this.format(o)&&(this.$d=new Date("")),s={}}else if(o instanceof Array)for(var l=o.length,p=1;p<=l;p+=1){a[1]=o[p-1];var v=e.apply(this,a);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===l&&(this.$d=new Date(""))}else n.call(this,t)}}}()),f.exports),v=o(p);const g=class{constructor(e){t(this,e),this.rValidate=i(this,"rValidate"),this.rInput=i(this,"rInput"),this.rChange=i(this,"rChange"),this.rReset=i(this,"rReset"),this.format="DD/MM/YYYY",this.value="",this.dayAriaLabel="Day",this.monthAriaLabel="Month",this.yearAriaLabel="Year",this.currentValues={},this.delimiter="/",this.validityState="",this.validityMessage="",this.touched=!1,this.dirty=!1,this.initial={},this.uniqueId=`r-input-date-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g,""),this.nativeElement=null,this.getDateComponent=t=>{switch(t.toUpperCase()){case"DD":return this.currentValues.day;case"MM":case"M":return this.currentValues.month;case"YYYY":case"YY":return this.currentValues.year;default:return""}},this.setDateComponent=(t,i)=>{switch(t.toUpperCase()){case"DD":this.currentValues.day=i;break;case"MM":case"M":this.currentValues.month=i;break;case"YYYY":case"YY":this.currentValues.year=i;break;default:return""}},this.getInputAttrs=t=>{const i=t.toUpperCase();return{placeholder:t,maxlength:t.length>2?t.length:2,size:t.length,inputmode:"numeric",disabled:this.disabled,required:this.required,readonly:this.readonly,"aria-label":(t=>{switch(t){case"DD":return this.dayAriaLabel;case"MM":case"M":return this.monthAriaLabel;case"YYYY":case"YY":return this.yearAriaLabel;default:return""}})(i),"data-date-type":i}},this.getDelimiter=t=>{var i;return(null===(i=t.replace(/[^.\-/]/g,""))||void 0===i?void 0:i.charAt(0))||"/"},this.updateValue=()=>{this.readonly||(this.delimiter=this.getDelimiter(this.format),this.value=this.value?this.inputOrder.map((t=>this.getDateComponent(t))).join(this.delimiter):"")},this.onHostClick=()=>{const t=this.firstEmptyInput||this.inputs[this.inputs.length-1];null==t||t.focus()},this.onInputClick=t=>{t.stopPropagation()},this.createKeyDownHandler=t=>i=>this.handleKeyDown(t,i),this.handleKeyDown=(t,i)=>{var e,r,n,a,s,o;if(!this.readonly){if("Enter"===i.code){if(this.touched=!0,this.validateFormElement(this.nativeElement),this.invalid&&!this.isNoValidate)return;const t=this.host.querySelector('[type="submit"]')||(null===(e=this.parentFormEl)||void 0===e?void 0:e.querySelector('[type="submit"]'));t&&"triggerClick"in t?null==t||t.triggerClick():null===(r=this.parentFormEl)||void 0===r||r.requestSubmit()}if("Backspace"===i.code&&0===(null===(n=this.inputs[t])||void 0===n?void 0:n.selectionStart)&&t>0&&(null===(a=this.inputs[t-1])||void 0===a||a.focus()),"ArrowLeft"===i.code){const i=this.inputs[t];if(0===(null==i?void 0:i.selectionStart)&&t>0){const i=this.inputs[t-1].value,e=null==i?void 0:i.length;null===(s=this.inputs[t-1])||void 0===s||s.focus(),e&&setTimeout((()=>{var i;null===(i=this.inputs[t-1])||void 0===i||i.setSelectionRange(e,e)}),0)}}if("ArrowRight"===i.code){const i=this.inputs[t],e=null==i?void 0:i.value;(!e||(null==i?void 0:i.selectionStart)===e.length)&&t<this.inputOrder.length-1&&(null===(o=this.inputs[t+1])||void 0===o||o.focus(),setTimeout((()=>{var i;null===(i=this.inputs[t+1])||void 0===i||i.setSelectionRange(0,0)}),0))}}},this.handlePaste=t=>{this.readonly||(this.value=t.clipboardData.getData("text"),this.touched=!0,this.dirty=!0,t.preventDefault())},this.createInputHandler=(t,i)=>e=>this.handleInput(t,i,e),this.handleInput=(t,i,e)=>{var r,n,a;if(this.readonly)return;const s=null===(r=e.target.value)||void 0===r?void 0:r.replace(/[^0-9]/g,"");e.target.value=s,this.setDateComponent(t,s),this.value=this.inputOrder.map((t=>this.getDateComponent(t))).join(this.delimiter),(null==s?void 0:s.length)===(null===(n=this.inputs[i])||void 0===n?void 0:n.maxLength)&&i<this.inputOrder.length-1&&(null===(a=this.inputs[i+1])||void 0===a||a.focus()),this.touched=!0,this.dirty=!0,this.rInput.emit({element:this.host,value:this.value}),this.validateFormElement(this.nativeElement)},this.createChangeHandler=t=>i=>this.handleChange(t,i),this.handleChange=(t,i)=>{var e;if(this.readonly)return;const r=null===(e=i.target.value)||void 0===e?void 0:e.replace(/[^0-9]/g,"");i.target.value=r,this.setDateComponent(t,r),this.value=this.inputOrder.map((t=>this.getDateComponent(t))).join(this.delimiter),this.touched=!0,this.dirty=!0,this.rChange.emit({element:this.host,value:this.value}),this.validateFormElement(this.nativeElement)},this.handleBlur=()=>{this.touched=!0,this.validateFormElement(this.nativeElement)},this.getValidityStateData=t=>{let i="",e="";if(this.required&&0===t.value.length)return i="valueMissing",e=this.valueMissingMessage,{validityState:i,validityMessage:e};const r=!this.value||l(this.value,this.format,!0).isValid();if(!r)return i="invalid",e=this.invalidDateMessage,{validityState:i,validityMessage:e};if(this.value&&r){const t=l(this.value,this.format,!0);if(this.min){const r=l(this.min,this.format,!0);if(r.isValid()&&t.isBefore(r,"day"))return i="rangeUnderflow",e=this.rangeUnderflowMessage,{validityState:i,validityMessage:e}}if(this.max){const r=l(this.max,this.format,!0);if(r.isValid()&&t.isAfter(r,"day"))return i="rangeOverflow",e=this.rangeOverflowMessage,{validityState:i,validityMessage:e}}}return i="valid",{validityState:i,validityMessage:e}},this.validateFormElement=t=>{if(null===t)return;if(this.isNoValidate)return;const{validityState:i,validityMessage:e}=this.getValidityStateData(t);this.validityState=i,this.validityMessage=e;const r="valid"===this.validityState;this.valid=r,this.invalid=!r,this.rValidate.emit({state:this.validityState,message:this.validityMessage})},this.onResetForm=async()=>{if(this.readonly)return;this.reset(),this.validityState=null,this.validityMessage=null,this.invalid=null,this.valid=null;const{host:t,value:i}=this;this.rReset.emit({element:t,value:i})},this.onSubmitForm=t=>{this.isNoValidate||this.disabled||(this.validateFormElement(this.nativeElement),this.invalid&&(t.preventDefault(),t.stopPropagation()))},this.contributeToFormData=t=>{s(this.nativeElement||this.host,t.formData)},this.setCurrentValues=()=>{var t;const i=this.getDelimiter(this.value),e=(null===(t=this.value)||void 0===t?void 0:t.split(i))||[];this.value=e.join(this.delimiter),this.inputOrder.forEach(((t,i)=>{this.setDateComponent(t,e[i]||"")}))}}handleFormatChange(){this.updateValue()}handleValueChange(){this.setCurrentValues(),this.touched&&this.validateFormElement(this.nativeElement)}async getValue(){return this.value}async setValue(t){this.nativeElement.value=t,this.value=t}async getFormat(){return this.format}async setFormat(t){this.format=t}async isTouched(){return this.touched}async isDirty(){return this.dirty}async markAsPristine(){this.touched=!1,this.dirty=!1}async reset(){this.readonly||(this.markAsPristine(),this.validityState=null,this.validityMessage=null,this.value=this.initial.value,this.invalid=this.initial.invalid,this.format=this.initial.format,this.valid=!this.invalid)}async checkValidity(){const{validityState:t}=this.getValidityStateData(this.nativeElement);return"valid"===t}get inputs(){return Array.from(this.host.shadowRoot.querySelectorAll("input[data-date-type]"))}get inputOrder(){return this.format.split(this.delimiter)}get message(){return this.invalid&&this.error?this.error:this.validityState&&"valid"!==this.validityState?this.customErrorMessage||this.validityMessage:null}get hasMessage(){return null!==this.message}get ariaDescribedBy(){const t=this.message?`${this.uniqueId}-message`:null;return this.hint?`${this.uniqueId}-hint ${t}`:t}get parentFormEl(){return this.host.closest("form")||document.querySelector(`#${this.form}`)||null}get isNoValidate(){var t;return(null===(t=this.parentFormEl)||void 0===t?void 0:t.hasAttribute("novalidate"))||this.novalidate||this.disabled||!1}get firstEmptyInput(){return this.inputs.find((t=>!t.value))||null}get hasTrailingSlot(){return!!this.host.querySelector('[slot="trailing"]')}componentWillLoad(){l.extend(v),this.delimiter=this.getDelimiter(this.format),this.initial.value=this.value,this.initial.invalid=this.invalid,this.initial.format=this.format,this.setCurrentValues()}connectFormEventListeners(){var t,i,e;null===(t=this.parentFormEl)||void 0===t||t.addEventListener("formdata",this.contributeToFormData),null===(i=this.parentFormEl)||void 0===i||i.addEventListener("submit",this.onSubmitForm,{capture:!0}),null===(e=this.parentFormEl)||void 0===e||e.addEventListener("reset",this.onResetForm)}disconnectFormEventListeners(){var t,i,e;null===(t=this.parentFormEl)||void 0===t||t.removeEventListener("formdata",this.contributeToFormData),null===(i=this.parentFormEl)||void 0===i||i.removeEventListener("submit",this.onSubmitForm),null===(e=this.parentFormEl)||void 0===e||e.removeEventListener("reset",this.onResetForm)}connectedCallback(){this.connectFormEventListeners()}disconnectedCallback(){this.disconnectFormEventListeners()}render(){const{form:t,name:i,required:a,disabled:s,label:o,fieldIndicator:u,hint:h,tooltip:d,tooltipIcon:c,tooltipIconColor:l,uniqueId:f,invalid:p,valid:v,readonly:g}=this,m={id:f,form:t,name:i,required:a,disabled:s,readonly:g,"aria-describedby":this.ariaDescribedBy},b=d?{tooltip:d,"tooltip-icon":c,"tooltip-icon-color":l}:{},y=o?{id:`${f}-label`,fieldIndicator:u}:{};return e(n,{key:"00e6bbea2dcaf1e88b4587fa9df6165a2c28c134",onClick:this.onHostClick,"data-touched":`${this.touched}`,"data-dirty":`${this.dirty}`},e("fieldset",Object.assign({key:"94d107ad0f00608263df3f47b0c2240d93a01c4e",class:"r-input-date"},{"aria-invalid":`${p||!1}`,"aria-describedby":this.ariaDescribedBy}),e("div",{key:"3ac5991c7b8754f2fa94c8053f60af17a99301e0",class:"r-input-date--legend-container"},e("legend",{key:"62fc7c2b6af2f7911c11f135432323621dd278b8",class:"r-input-date--legend"},e("label",{key:"d161f2b149ca1295c6e96746520c6ef1cf2e23ba",htmlFor:f},o?e("r-label",Object.assign({},y,b),o):e("slot",{name:"label"}))),e("slot",{key:"81c9e7753273c5e7d6db5d6a1f0fad8398a57c0a",name:"popover"})),h&&e("r-hint",{key:"0814c3ef100ed6a8512b2f15d5b59e01664bd811",id:`${f}-hint`,role:"note"},h),e("div",{key:"65247f18a297ef6a5751ab86e1123271ed8759f7",class:"r-input-date--container"},e("r-icon",{key:"fce4150b7c1b801752e1a67339b1a599728b0631",name:"calendar",size:"s",class:"r-input-date--calendar-icon"}),e("div",{key:"3b5e4776102b06acd9626477c702d2dc52ef681c",class:"r-input-date--inputs"},this.inputOrder.map(((t,i)=>e(r,null,e("input",Object.assign({class:"r-input-date--input"},this.getInputAttrs(t),{key:t,value:this.getDateComponent(t),onInput:this.createInputHandler(t,i),onChange:this.createChangeHandler(t),onClick:this.onInputClick,onBlur:this.handleBlur,onKeyDown:this.createKeyDownHandler(i),onPaste:this.handlePaste})),i<this.inputOrder.length-1&&e("span",{"aria-hidden":"true",class:"r-input-date--delimiter"},this.delimiter)))),e("input",Object.assign({key:"2c181871c97962a35988eb406c09a05c8f27181d",type:"hidden"},m,{value:this.value,ref:t=>this.nativeElement=t}))),e("div",{key:"8c694c11cc7ea4ecc23484d3f014cc865e0c56ad",class:"r-input-date--trailing"},this.readonly&&e("r-icon",{key:"8ed65eaef19f280381b7c0fae206163f3adeb5f4",class:"r-input-date--readonly-icon",name:"pen-disabled",size:"s"}),v&&e("r-icon",{key:"aef55123b4b001576b482e0be4eff0df6dc97930",name:"circled-check",size:"s",color:"var(--r-status-success-regular)"}),this.hasTrailingSlot&&e("slot",{key:"d92dcda80b7434af1f8ed781329ce8f2e6734225",name:"trailing"}))),e("div",{key:"139792ccc090b29f041e3a731f65e5916379b911",id:`${f}-message`,"aria-live":"polite",class:"r-input-date--message"},this.hasMessage&&e("r-hint",{key:"74d444c9748c032e844c0772b8758873bdaef391",variant:"error"},this.message))))}get host(){return a(this)}static get watchers(){return{format:["handleFormatChange"],value:["handleValueChange"]}}};g.style=":host{display:inline-flex;flex-direction:column;vertical-align:top;--r-label--margin-bottom:0}:host slot{display:contents}:host([readonly]:not([readonly=false])){--r-input-date--container--background-color:var(--r-background-soft, #f3f1f0);--r-input-date--container--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-input-date--container--cursor:text}:host(:hover:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))){--r-input-date--container--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host(:active:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))){--r-input-date--container--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([full-width]:not([full-width=false])){display:flex}:host([disabled]:not([disabled=false])){cursor:not-allowed;--r-input-date--container--opacity:0.4;--r-input-date--container--cursor:not-allowed;--r-input-date--container--pointer-events:none;--r-input-date--container--background-color:transparent}:host([invalid]:not([invalid=false])){--r-input-date--container--border-color:var(--r-status-error-regular, #b00c15);--r-input-date--container--background-color:var(--r-status-error-soft, #fef6f6)}.r-input-date{padding:var(--r-input-date--padding, 0);margin:var(--r-input-date--margin, 0);border:var(--r-input-date--border, none)}.r-input-date--legend-container{display:var(--r-input-date--legend-container--display, flex);gap:var(--r-input-date--legend-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-input-date--legend-container--align-items, center);justify-content:var(--r-input-date--label-container--align-items, space-between)}.r-input-date--legend-container ::slotted([slot=popover]){display:var(--r-input-date--popover--display, inline-flex);height:var(--r-input-date--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-input-date--popover--align-items, center);justify-content:var(--r-input-date--popover--justify-content, center);margin-right:var(--r-input-date--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-input-date--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-input-date--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-input-date--legend{padding:var(--r-input-date--label--padding, 0)}.r-input-date--container{position:var(--r-input-date--container--position, relative);display:var(--r-input-date--container--display, flex);align-items:var(--r-input-date--container--align-items, center);height:var(--r-input-date--container--height, var(--r-spacing-275, 2.75rem));font-family:var(--r-input-date--container--font-family, var(--r-font-family-text, system-ui));background-color:var(--r-input-date--container--background-color, var(--r-background-softest, #fff));border-width:var(--r-input-date--container--border-width, 1px);border-style:var(--r-input-date--container--border-style, solid);border-color:var(--r-input-date--container--border-color, var(--r-border-soft, #686868));box-sizing:var(--r-input-date--container--box-sizing, border-box);box-shadow:var(--r-input-date--container--box-shadow, none);outline:var(--r-input-date--container--outline, none);outline-offset:var(--r-input-date--container--outline-offset, 0);padding-right:var(--r-input-date--container--padding-right, 0.7em);padding-left:var(--r-input-date--container--padding-left, 0.7em);opacity:var(--r-input-date--container--opacity, 1);pointer-events:var(--r-input-date--container--pointer-events, auto);cursor:var(--r-input-date--container--cursor, inherit);margin-top:var(--r-input-date--container--margin-top, var(--r-spacing-025, 0.25rem));gap:var(--r-input-date--leading--gap, 0.625rem)}.r-input-date--container:has(input:focus-within){--r-input-date--container--box-shadow:0 0 0 6px var(--r-border-focused-outlined);--r-input-date--container--outline:2px solid var(--r-border-focused);--r-input-date--container--outline-offset:2px}.r-input-date--calendar-icon{color:var(--r-input-date--leading--color, var(--r-icon-soft, #686868))}.r-input-date--inputs{display:var(--r-input-date--inputs--display, flex);align-items:var(--r-input-date--inputs--align-items, center)}.r-input-date--input{max-width:var(--r-input-date--input--max-width, 2.625rem);field-sizing:var(--r-input-date--input--field-sizing, content);outline:var(--r-input-date--input--outline, none);height:var(--r-input-date--input--height, 100%);font-family:var(--r-input-date--input--font-family, inherit);font-size:var(--r-input-date--input--font-size, var(--r-font-size-400, 1rem));background-color:var(--r-input-date--input--background-color, transparent);border:var(--r-input-date--input--border, none);padding:var(--r-input-date--input--padding, 0)}.r-input-date--input[data-date-type=DD]{--r-input-date--input--max-width:1.5rem}.r-input-date--input[data-date-type=MM]{--r-input-date--input--max-width:1.75rem}.r-input-date--delimiter{padding-inline:var(--r-input-date--delimiter--padding-inline, var(--r-spacing-025, 0.25rem));margin-top:var(--r-input-date--delimiter--margin-top, -0.25rem);color:var(--r-input-date--delimiter--color, var(--r-border-regular, #282828));font-size:var(--r-input-date--delimiter--font-size, var(--r-spacing-150, 1.5rem));font-weight:var(--r-input-date--delimiter--font-weight, 200)}.r-input-date--message{margin-top:var(--r-input-date--message--margin-top, var(--r-spacing-025, 0.25rem))}.r-input-date--message:empty{--r-input-date--message--margin-top:0}.r-input-date--trailing{display:var(--r-input-date--trailing--display, flex);margin-left:var(--r-input-date--trailing--margin-left, auto);align-items:var(--r-input-date--trailing--align-items, center);gap:var(--r-input-date--trailing--gap, 0.625rem)}.r-input-date--readonly-icon{color:var(--r-input-date--readonly-icon--color, var(--r-icon-soft, #686868))}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";export{g as r_input_date}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,H as r,g as n}from"./p-Da7qOBFr.js";import{a}from"./p-DvLT8-y3.js";const o=class{constructor(e){t(this,e),this.rChange=i(this,"rChange"),this.rValidate=i(this,"rValidate"),this.rReset=i(this,"rReset"),this.name="input-code",this.length=4,this.label="Verification code",this.tooShortMessage=`All ${this.length} characters must be filled.`,this.value="",this.values=new Array(this.length).fill(""),this.validityState="",this.validityMessage="",this.inputs=[],this.handleInput=(t,i)=>{var e;if(this.readonly)return;const r=i.target.value.slice(-1);this.values[t]=r,this.values=[...this.values],r&&t<this.length-1&&(null===(e=this.inputs[t+1])||void 0===e||e.focus()),this.rChange.emit({value:this.values.join("")})},this.handleKeyDown=(t,i)=>{var e,r,n;if(this.readonly)return;const a=i.key;"Backspace"===a&&!this.values[t]&&t>0&&(this.values[t-1]="",this.values=[...this.values],null===(e=this.inputs[t-1])||void 0===e||e.focus()),"ArrowLeft"===a&&t>0&&(null===(r=this.inputs[t-1])||void 0===r||r.focus(),this.values[t-1]&&setTimeout((()=>{var i;null===(i=this.inputs[t-1])||void 0===i||i.setSelectionRange(0,1)}),0)),"ArrowRight"===a&&t<this.length-1&&(null===(n=this.inputs[t+1])||void 0===n||n.focus(),this.values[t+1]&&setTimeout((()=>{var i;null===(i=this.inputs[t+1])||void 0===i||i.setSelectionRange(0,1)}),0))},this.createInputHandler=t=>i=>this.handleInput(t,i),this.createKeyDownHandler=t=>i=>this.handleKeyDown(t,i),this.handlePaste=async t=>{var i;if(this.readonly)return;t.preventDefault();const e=t.clipboardData.getData("text").slice(0,this.length);this.values=e.split("").concat(new Array(this.length).fill("")).slice(0,this.length),this.values=[...this.values],this.rChange.emit({value:this.values.join("")});const r=this.values.findIndex((t=>!t));null===(i=this.inputs[-1===r?this.length-1:r])||void 0===i||i.focus()},this.onHostClick=()=>{const t=this.firstEmptyInput||this.inputs[this.inputs.length-1];null==t||t.focus(),null===this.firstEmptyInput&&setTimeout((()=>{null==t||t.setSelectionRange(0,1)}),0)},this.uniqueId=`r-input-code-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g,""),this.nativeElement=null,this.getValidityStateData=t=>{let i="",e="";return this.required&&0===t.value.length?(i="valueMissing",e=this.valueMissingMessage,{validityState:i,validityMessage:e}):t.value.length>0&&t.value.length<this.length?(i="tooShort",e=this.tooShortMessage,{validityState:i,validityMessage:e}):(i="valid",{validityState:i,validityMessage:e})},this.validateFormElement=t=>{if(null===t)return;if(this.isNoValidate)return;const{validityState:i,validityMessage:e}=this.getValidityStateData(t);this.validityState=i,this.validityMessage=e;const r="valid"===this.validityState;this.valid=r,this.invalid=!r,this.rValidate.emit({state:this.validityState,message:this.validityMessage})},this.onResetForm=async()=>{if(this.readonly)return;this.reset(),this.validityState=null,this.validityMessage=null,this.invalid=null,this.valid=null;const{host:t}=this;this.rReset.emit({element:t,value:this.values.join("")})},this.onSubmitForm=t=>{this.isNoValidate||this.disabled||(this.validateFormElement(this.nativeElement),this.invalid&&(t.preventDefault(),t.stopPropagation()))},this.contributeToFormData=t=>{a(this.nativeElement||this.host,t.formData)}}async getValue(){return this.values.join("")}async reset(){var t;this.readonly||(this.values=new Array(this.length).fill(""),null===(t=this.inputs[0])||void 0===t||t.focus())}async setValue(t){if(!t)return void(this.values=new Array(this.length).fill(""));const i=Array.from(t).slice(0,this.length).map((t=>String(t)));this.values=i,this.rChange.emit({value:this.values.join("")})}async checkValidity(){const{validityState:t}=this.getValidityStateData(this.nativeElement);return"valid"===t}handleValuesChange(){this.value=this.values.join("")}get firstEmptyInput(){return this.inputs.find((t=>!t.value))||null}get message(){return this.invalid&&this.error?this.error:this.valid||"valid"===this.validityState?null:this.validityState&&"valid"!==this.validityState?this.customErrorMessage||this.validityMessage:null}get ariaDescribedBy(){const t=this.message?`${this.uniqueId}-message`:null;return this.hint?`${this.uniqueId}-hint ${t}`:t}get parentFormEl(){return this.host.closest("form")||document.querySelector(`#${this.form}`)||null}get isNoValidate(){var t,i;return(null===(t=this.parentFormEl)||void 0===t?void 0:t.hasAttribute("novalidate"))||this.novalidate||this.disabled||(null===(i=this.error)||void 0===i?void 0:i.length)>0||!1}connectFormEventListeners(){var t,i,e;null===(t=this.parentFormEl)||void 0===t||t.addEventListener("formdata",this.contributeToFormData),null===(i=this.parentFormEl)||void 0===i||i.addEventListener("submit",this.onSubmitForm,{capture:!0}),null===(e=this.parentFormEl)||void 0===e||e.addEventListener("reset",this.onResetForm)}disconnectFormEventListeners(){var t,i,e;null===(t=this.parentFormEl)||void 0===t||t.removeEventListener("formdata",this.contributeToFormData),null===(i=this.parentFormEl)||void 0===i||i.removeEventListener("submit",this.onSubmitForm),null===(e=this.parentFormEl)||void 0===e||e.removeEventListener("reset",this.onResetForm)}connectedCallback(){this.connectFormEventListeners()}disconnectedCallback(){this.disconnectFormEventListeners()}get hasMessage(){return!!this.message}get groupDescribedby(){const{uniqueId:t,hint:i,hasMessage:e}=this;return e&&i?`${t}-message ${t}-hint`:e?`${t}-message`:i?`${t}-hint`:null}get hasTrailingSlot(){return!!this.host.querySelector('[slot="trailing"]')}componentWillLoad(){this.setValue(this.value)}render(){const{form:t,name:i,novalidate:n,required:a,disabled:o,label:s,fieldIndicator:d,hint:l,uniqueId:c,valid:h,readonly:u}=this,p={id:c,readonly:u,form:t,name:i,novalidate:n,required:a,disabled:o,"aria-describedby":this.ariaDescribedBy,minlength:this.length,maxlength:this.length};return e(r,{key:"2babfeef172a7d6b76c734f3170ede3a7a8d3392",value:this.value,onClick:this.onHostClick},e("div",{key:"712d241caa9d80f982f831633009a8452c472a3c",class:"r-input-code--label-container"},e("label",{key:"5a6be87bb1ab122cea9e2c7cefaf2781c39a9465",htmlFor:c},s?e("r-label",Object.assign({},s?{id:`${c}-label`,fieldIndicator:d}:{}),s):e("slot",{name:"label"})),e("slot",{key:"d7afacaedc1741fdf703f5263eda57dc3591b36d",name:"popover"})),l&&e("r-hint",{key:"d49faa30ca4ebbefe7e88217392ef7f6a9487e7f",id:`${c}-hint`,role:"note"},l),e("div",{key:"89deb68a39134cdacc1009e83113c589aafc311e",class:"r-input-code--container",role:"group","aria-labelledby":`${c}-label`,"aria-describedby":this.groupDescribedby},e("slot",{key:"170f25027ccf4d3603474a77a92c5ff24579e46e",name:"leading"}),Array.from({length:this.length}).map(((t,i)=>e("input",{class:"r-input-code--input",key:i,id:`${c}-input-section-${i}`,"aria-label":`${this.ariaCharacterLabel||"Character"}: ${i+1}`,"aria-invalid":`${this.invalid||!1}`,value:this.values[i],ref:t=>this.inputs[i]=t,maxlength:1,disabled:this.disabled,required:this.required,readonly:u,onInput:this.createInputHandler(i),onKeyDown:this.createKeyDownHandler(i),onPaste:this.handlePaste}))),e("input",Object.assign({key:"482c544b68d48b089f7177846cee7f5fc279bbd9",type:"hidden"},p,{value:this.values.join(""),ref:t=>this.nativeElement=t})),e("div",{key:"73f393a98b3ca5e830e7b35c360cd9e242564d8e",class:"r-input-code--trailing"},this.readonly&&e("r-icon",{key:"751fb71619d0d0ea808332de4cc9e1b1f2dff59d",class:"r-input-code--readonly-icon",name:"pen-disabled",size:"s"}),this.hasTrailingSlot&&e("slot",{key:"072e2f141e1ef3fbf931e9c0abf24d6c42f64ec5",name:"trailing"},h&&e("r-icon",{key:"45b17f30472b9a5cc2e2101261f7884bd96d1d72",name:"circled-check",size:"s",color:"var(--r-status-success-regular)"})))),e("slot",{key:"b8be9bc6d2c14fa04312313709a7911d8339c735",name:"message"},this.hasMessage&&e("r-hint",{key:"f76a1e5aa6d542790bdc01c7e931eda9a986a14b","aria-live":"polite",id:`${c}-message`,variant:"error"},this.message)))}get host(){return n(this)}static get watchers(){return{values:["handleValuesChange"]}}};o.style=":host{display:inline-flex;flex-direction:column;vertical-align:top;--r-label--margin-bottom:0}:host slot{display:contents}:host slot[name=trailing]{display:flex;margin-left:auto}:host([readonly]:not([readonly=false])){--r-input-code--container--background-color:var(--r-background-soft, #f3f1f0);--r-input-code--container--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-input-code--container--cursor:text}:host(:hover:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))){--r-input-code--container--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host(:focus-within:not([disabled]:not([disabled=false]))){--r-input-code--container--box-shadow:0 0 0 6px var(--r-border-focused-outlined);--r-input-code--container--outline:2px solid var(--r-border-focused);--r-input-code--container--outline-offset:2px}:host(:active:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))){--r-input-code--container--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([full-width]:not([full-width=false])){display:flex}:host([disabled]:not([disabled=false])){cursor:not-allowed;--r-input-code--container--opacity:0.4;--r-input-code--container--cursor:not-allowed;--r-input-code--container--pointer-events:none;--r-input-code--container--background-color:transparent}:host([invalid]:not([invalid=false])){--r-input-code--container--border-color:var(--r-status-error-regular, #b00c15);--r-input-code--container--background-color:var(--r-status-error-soft, #fef6f6)}.r-input-code--label-container{display:var(--r-input-code--label-container--display, flex);gap:var(--r-input-code--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-input-code--label-container--align-items, center);justify-content:var(--r-input-code--label-container--align-items, space-between)}.r-input-code--label-container ::slotted([slot=popover]){display:var(--r-input-code--popover--display, inline-flex);height:var(--r-input-code--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-input-code--popover--align-items, center);justify-content:var(--r-input-code--popover--justify-content, center);margin-right:var(--r-input-code--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-input-code--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-input-code--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-input-code--container{position:var(--r-input-code--container--position, relative);display:var(--r-input-code--container--display, flex);align-items:var(--r-input-code--container--align-items, center);gap:var(--r-input-code--container--gap, 0.625em);height:var(--r-input-code--container--height, var(--r-spacing-275, 2.75rem));background-color:var(--r-input-code--container--background-color, var(--r-background-softest, #fff));border-width:var(--r-input-code--container--border-width, 1px);border-style:var(--r-input-code--container--border-style, solid);border-color:var(--r-input-code--container--border-color, var(--r-border-soft, #686868));box-sizing:var(--r-input-code--container--box-sizing, border-box);box-shadow:var(--r-input-code--container--box-shadow, none);outline:var(--r-input-code--container--outline, none);outline-offset:var(--r-input-code--container--outline-offset, 0);padding-top:var(--r-input-code--container--padding-top, 0.8em);padding-right:var(--r-input-code--container--padding-right, 0.7em);padding-bottom:var(--r-input-code--container--padding-bottom, 0.8em);padding-left:var(--r-input-code--container--padding-left, 0.7em);opacity:var(--r-input-code--container--opacity, 1);pointer-events:var(--r-input-code--container--pointer-events, auto);line-height:var(--r-input-code--container--line-height, 1);cursor:var(--r-input-code--container--cursor, inherit);margin-top:var(--r-input-code--container--margin-top, var(--r-spacing-025, 0.25rem));margin-bottom:var(--r-input-code--container--margin-bottom, var(--r-spacing-025, 0.25rem))}.r-input-code--input{width:var(--r-input-code--input--width, 0.725rem);outline:var(--r-input-code--input--outline, none);font-size:var(--r-input-code--input--font-size, 1rem);text-align:var(--r-input-code--input--text-align, center);background-color:var(--r-input-code--input--background-color, transparent);border-width:var(--r-input-code--input--border-width, 0 0 1px 0);border-style:var(--r-input-code--input--border-style, solid);border-color:var(--r-input-code--input--border-color, var(--r-text-soft))}.r-input-code--trailing{display:var(--r-input-code--trailing--display, flex);margin-left:var(--r-input-code--trailing--margin-left, auto);align-items:var(--r-input-code--trailing--align-items, center);gap:var(--r-input-code--trailing--gap, 0.625rem)}.r-input-code--readonly-icon{color:var(--r-input-code--readonly-icon--color, var(--r-icon-soft, #686868))}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";export{o as r_input_code}
@@ -0,0 +1 @@
1
+ import{r,c as o,h as t,H as e,g as a}from"./p-Da7qOBFr.js";const i=class{constructor(t){r(this,t),this.popoverOpenChange=o(this,"popoverOpenChange"),this.hidePopover=o(this,"hidePopover"),this.showPopover=o(this,"showPopover"),this.focusPopover=o(this,"focusPopover"),this.dismissMode="auto",this.triggerAction="toggle",this.vertical="bottom",this.horizontal="center",this.isOpen=!1,this._focusOnElement=r=>{var o,t;if(r){if("function"!=typeof r.setFocus)return null===(t=null==r?void 0:r.focus)||void 0===t||t.call(r),this.focusPopover.emit(),this;null===(o=null==r?void 0:r.setFocus)||void 0===o||o.call(r)}},this.uniqueId=`r-popover-${Date.now().toString(16)}${Math.random().toString(32)}`.replace(/\./g,""),this.onToggle=r=>{if("open"===r.newState)return this.isOpen=!0,requestAnimationFrame((()=>{this.renderPosition(),this.setFocus()})),this;this.isOpen=!1,requestAnimationFrame((()=>{this.setBlur(),this.triggerElement.focus()}))},this.onClickDismiss=()=>{this.hide()},this.onKeyDown=async r=>{if("Tab"===r.key){r.preventDefault();const o=r.target,t=await this._getFocusable(),e=t.indexOf(o);this._focusOnElement(r.shiftKey?e?t[e-1]:t[t.length-1]:e<t.length-1?t[e+1]:t[0])}}}async show(){this.isOpen=!0}async hide(){this.isOpen=!1}async toggle(){this.isOpen?this.hide():this.show()}async setFocus(){if(!this.isOpen)return this;const r=await this._getFocusable();return this._focusOnElement(r[0]),this}async _getFocusable(){const{dismissElement:r}=this,o=this.host.querySelector("r-popover-content"),t=this.host.querySelector("r-popover-action");return[r,...await o.getActiveElements(),...await t.getActiveElements()].filter((r=>void 0!==r))}async setBlur(){if(!this.isOpen)return this;const{dismissElement:r}=this,o=this.host.querySelector("r-popover-content"),t=this.host.querySelector("r-popover-action"),e=this.host.querySelector("r-popover-trigger");return null==r||r.setBlur(),null==o||o.setBlur(),null==t||t.setBlur(),null==e||e.setBlur(),this.host.blur(),this}handleOpenChange(){this.open?this.show():this.hide()}watchOpen(){var r,o,t,e,a,i,p,v,n,s;this.isOpen?(null===(o=null===(r=this.boardElement)||void 0===r?void 0:r.showPopover)||void 0===o||o.call(r),null===(e=null===(t=this.showPopover)||void 0===t?void 0:t.emit)||void 0===e||e.call(t)):(null===(i=null===(a=this.boardElement)||void 0===a?void 0:a.hidePopover)||void 0===i||i.call(a),null===(v=null===(p=this.hidePopover)||void 0===p?void 0:p.emit)||void 0===v||v.call(p)),null===(s=null===(n=this.popoverOpenChange)||void 0===n?void 0:n.emit)||void 0===s||s.call(n)}handlePreferredPositionChange(){this.renderPosition()}onKeyup(r){if(!this.isOpen)return this;"Escape"===r.key&&this.hide()}onResize(){this.isOpen&&this.renderPosition()}onScroll(){this.isOpen&&this.renderPosition()}get hasDismiss(){return"manual"===this.dismissMode}get triggerRect(){var r;return null===(r=this.triggerElement)||void 0===r?void 0:r.getBoundingClientRect()}get boardRect(){var r;return null===(r=this.boardElement)||void 0===r?void 0:r.getBoundingClientRect()}renderPosition(){if(!this.triggerRect)return this;const{triggerRect:r,boardRect:o,vertical:t,horizontal:e}=this,a=window.innerWidth,i=window.innerHeight;if(r.bottom<0||r.right<0||r.top>i||r.left>a)return this.hide(),this;this.host.setAttribute("style",`\n --r-popover--trigger--width: ${r.width}px;\n --r-popover--trigger--height: ${r.height}px;\n --r-popover--trigger--left: ${r.left}px;\n --r-popover--trigger--top: ${r.top}px;\n `);const p=r.top,v=a-r.right,n=i-r.bottom,s=r.left,h=r=>getComputedStyle(this.host).getPropertyValue(r),d=r=>r.includes("rem")?parseFloat(r)*parseFloat(getComputedStyle(document.documentElement).fontSize):parseFloat(r),l=d(h("--board--shift"))||0,c=d(h("--pointer--height"))||0,g=o.height+c;let b=o.width-r.width-l;const f=r=>Object.values(r).filter(Boolean).length>0,m=r=>Object.keys(r).find((o=>r[o])),u={vertical:{},horizontal:{}};u.vertical={top:p>=g,bottom:n>=g,middle:n>(o.height-r.height-c)/2&&p>(o.height-r.height)/2},!u.vertical.middle&&f(u.vertical)||(b=o.width+l),u.horizontal={left:s>=b,right:v>o.width-r.width-l,center:s>o.width/2&&v>o.width/2};let w="cover";u.vertical[t]?w=t:f(u.vertical)&&(w=m(u.vertical));let x="cover";if(u.horizontal[e]?x=e:f(u.horizontal)&&(x=m(u.horizontal)),"cover"===w){const r=this.triggerRect.top+this.triggerRect.height;if(r>this.boardRect.height){const o=r-this.boardRect.height;this.host.style.setProperty("--r-popover--board--top",`${o}px`),this.host.style.setProperty("--r-popover--pointer--top",this.triggerRect.top+this.triggerRect.height/2-c/2-o+"px")}}return this.host.setAttribute("data-vertical",w),this.host.setAttribute("data-horizontal",x),this}componentDidLoad(){this.open?this.show():this.hide()}render(){return t(e,{key:"da45eae6a21cc01596344d33afc5def4da57967f",id:this.uniqueId,"data-position":this.positionState,"data-open":`${this.isOpen}`,open:this.isOpen},t("div",{key:"ad832de894e0af250cc93bdf3158032bc252740f",class:"r-popover"},t("button",{key:"28c4938bb02cb7c4eaed074178dda00c2c39a0b7",class:"r-popover--trigger","aria-label":this.triggerAriaLabel,ref:r=>this.triggerElement=r,popoverTarget:`${this.uniqueId}-board`,popoverTargetAction:this.triggerAction},t("slot",{key:"0a74ac9d6a7ecdba54771e733f8db5af1709e7fb",name:"trigger"})),t("div",{key:"dbdb43df6a9823f5d8c954146347f40438bbf053",class:"r-popover--board",id:`${this.uniqueId}-board`,popover:this.dismissMode,ref:r=>this.boardElement=r,onToggle:this.onToggle,onKeyDown:this.onKeyDown},this.hasDismiss&&t("r-icon-button",{key:"99cb4c1c050cdf197346ef84f7c610f5f6ed0b4c",ref:r=>this.dismissElement=r,class:"r-popover--dismiss",name:"cross",onClick:this.onClickDismiss,label:this.dismissAriaLabel}),t("div",{key:"fe7e18bd38a4f3879aada14169bfa50f84cd2eac",class:"r-popover--board-content"},t("slot",{key:"b5674f8f2f72340cf5af712f513a20bda9e04b47",name:"headline"}),t("slot",{key:"024ce9cc17f041df172d853176d09f4ec493df20",name:"content"}),t("slot",{key:"437ca7707856b7c6db59240d7b4378c74dc8fda8",name:"action"})),t("div",{key:"93184bd493520dbea03c7c63bbfe8c4ae788cde3",class:"r-popover--board-pointer","aria-hidden":"true"},t("svg",{key:"779d8b7df8f92ea14517ce9ce5099a73a4fdeac8",width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"53b9fee3e6a34cf184d8818ac272122f04193ff6",d:"M8 8L0 0L16 0L8 8Z",fill:"currentColor"}))))))}get host(){return a(this)}static get watchers(){return{open:["handleOpenChange"],isOpen:["watchOpen"],horizontal:["handlePreferredPositionChange"],vertical:["handlePreferredPositionChange"]}}};i.style=":host{position:relative;overflow:visible;color:var(--r-text-inverse);font-family:var(--r-font-family-text, system-ui);font-weight:var(--r-font-weight-regular, 400);font-size:var(--r-font-size-400, 1rem);text-align:left}:host slot{display:contents}:host{--board--shift:1rem;--board--min-width:304px;--board--max-width:504px;--board--max-height:320px;--pointer--width:1rem;--pointer--height:0.5rem;--pointer--spacer:0.25rem}:host([size=s]){--r-popover--board--max-width:375px}:host([size=l]){--r-popover--board--max-width:500px}:host([data-open=true]){--r-popover--pointer--display:block;--r-popover--board--visibility:visible;--r-popover--board--left:var(--r-popover--trigger--left);--r-popover--board--top:var(--r-popover--trigger--top)}:host([data-open=true]) ::slotted([slot=trigger]){--r-popover--trigger--display:none}:host([data-vertical=top]){--r-popover--pointer--top:100%;--r-popover--pointer--transform:rotate(0deg) translate(0,-1px)}:host([data-vertical=bottom]){--r-popover--pointer--bottom:100%;--r-popover--pointer--transform:rotate(180deg)}:host([data-vertical=middle]){--r-popover--pointer--top:calc(50% - var(--pointer--height)/2);--r-popover--pointer--bottom:auto}:host([data-horizontal=left]){--r-popover--board--left:calc(var(--r-popover--trigger--left, 0) + var(--r-popover--trigger--width, 0) + var(--board--shift));--r-popover--pointer--left:calc(100% - var(--r-popover--trigger--width, 0)/2 - var(--board--shift) - var(--pointer--width)/2)}:host([data-horizontal=right]){--r-popover--pointer--left:calc(var(--r-popover--trigger--width, 0)/2 + var(--pointer--width)/2)}:host([data-horizontal=center]){--r-popover--pointer--left:calc(50% - var(--pointer--width)/2)}:host([data-vertical=top][data-horizontal=left]){--r-popover--board--transform:translate(-100%, calc(-100% - var(--pointer--spacer) - var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=top][data-horizontal=right]){--r-popover--board--transform:translate(calc(0px - var(--board--shift)), calc(-100% - var(--pointer--spacer) - var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=top][data-horizontal=center]){--r-popover--board--transform:translate(calc(-50% + var(--r-popover--trigger--width, 0)/2), calc(-100% - var(--pointer--spacer) - var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=top][data-horizontal=cover]){--r-popover--pointer--left:calc(var(--r-popover--trigger--left, 0) + var(--r-popover--trigger--width, 0)/2 - var(--r-popover--pointer--width, var(--pointer--width))/2);--r-popover--board--left:0;--r-popover--board--transform:translate(0, calc(-100% - var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=middle][data-horizontal=left]){--r-popover--board--left:var(--r-popover--trigger--left, 0);--r-popover--board--transform:translate(calc(-100% - var(--pointer--height) - var(--pointer--spacer)), calc(-50% + var(--r-popover--trigger--height, 0)/2));--r-popover--pointer--left:100%;--r-popover--pointer--right:auto;--r-popover--pointer--transform:rotate(-90deg) translate(0, calc(0px - var(--pointer--spacer)))}:host([data-vertical=middle][data-horizontal=right]){--r-popover--board--left:calc(var(--r-popover--trigger--left, 0) + var(--r-popover--trigger--width, 0) + var(--pointer--height) + var(--pointer--spacer));--r-popover--board--transform:translate(0, calc(-50% + var(--r-popover--trigger--height, 0)/2));--r-popover--pointer--top:calc(50% - var(--pointer--height)/2);--r-popover--pointer--left:auto;--r-popover--pointer--right:100%;--r-popover--pointer--transform:rotate(90deg) translate(0, calc(0px - var(--pointer--spacer)))}:host([data-vertical=middle][data-horizontal=center]){--r-popover--pointer--display:none;--r-popover--board--transform:translate(calc(-50% + var(--r-popover--trigger--width, 0)/2), calc(-50% + var(--r-popover--trigger--height, 0)/2))}:host([data-vertical=middle][data-horizontal=cover]){--r-popover--pointer--display:none;--r-popover--board--left:0;--r-popover--board--transform:translate(0, calc(-50% + var(--r-popover--trigger--height, 0)/2))}:host([data-vertical=bottom][data-horizontal=left]){--r-popover--board--transform:translate(-100%, calc(var(--r-popover--trigger--height, 0) + var(--pointer--spacer) + var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=bottom][data-horizontal=right]){--r-popover--board--transform:translate(calc(0px - var(--board--shift)), calc(var(--r-popover--trigger--height, 0) + var(--r-popover--pointer--height, var(--pointer--height)) + var(--pointer--spacer)))}:host([data-vertical=bottom][data-horizontal=center]){--r-popover--board--transform:translate(calc(-50% + var(--r-popover--trigger--width, 0)/2), calc(var(--r-popover--trigger--height, 0) + var(--pointer--spacer) + var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=bottom][data-horizontal=cover]){--r-popover--pointer--left:calc(var(--r-popover--trigger--left, 0) + var(--r-popover--trigger--width, 0)/2 - var(--r-popover--pointer--width, var(--pointer--width))/2);--r-popover--board--left:0;--r-popover--board--transform:translate(0, calc(var(--r-popover--trigger--height, 0) + var(--r-popover--pointer--height, var(--pointer--height))))}:host([data-vertical=cover]){--r-popover--board--top:0;--r-popover--board--height:100%;--r-popover--board-content--height:100%;--r-popover--pointer--top:calc(var(--r-popover--trigger--top, 0) + var(--r-popover--trigger--height)/2 - var(--pointer--height)/2);--r-popover--pointer--bottom:auto}:host([data-vertical=cover][data-content-has-scroll=false]){--r-popover--board--top:var(--r-popover--trigger--top, 0)}:host([data-vertical=cover][data-horizontal=left]){--r-popover--board--left:var(--r-popover--trigger--left, 0);--r-popover--board--transform:translate(calc(-100% - var(--pointer--spacer) - var(--pointer--height)), 0);--r-popover--pointer--left:100%;--r-popover--pointer--right:auto;--r-popover--pointer--transform:rotate(-90deg) translate(0, calc(0px - var(--pointer--spacer)))}:host([data-vertical=cover][data-horizontal=right]){--r-popover--board--left:calc(var(--r-popover--trigger--left, 0) + var(--r-popover--trigger--width, 0) + var(--pointer--width));--r-popover--pointer--left:auto;--r-popover--pointer--right:100%;--r-popover--pointer--transform:rotate(90deg) translate(0, calc(0px - var(--pointer--spacer)))}:host([data-vertical=cover][data-horizontal=center]),:host([data-vertical=cover][data-horizontal=cover]){--r-popover--pointer--display:none;--r-popover--board--transform:translate(calc(-50% + var(--r-popover--trigger--width, 0)/2), 0)}:host([data-vertical=cover][data-horizontal=cover]){--r-popover--pointer--display:none;--r-popover--board--transform:none;--r-popover--board--height:100%;--r-popover--board--width:100%;--r-popover--board--left:0}:host([data-fixed-top=true]){--r-popover--board-container--height:var(--r-popover--trigger--top, var(--board--max-height))}:host([dismiss-mode=manual]){--r-popover--board-content--padding:1.5rem 3.5rem 1.5rem 1.5rem}.r-popover{position:var(--r-popover--position, relative);display:var(--r-popover--display, inline-flex)}.r-popover--dismiss{position:var(--r-popover--dismiss--position, absolute);top:var(--r-popover--dismiss--top, 20px);right:var(--r-popover--dismiss--right, 20px);color:var(--r-text-inverse)}.r-popover--dismiss:hover{--r-icon-button--background-color:var(--r-background-interactive-hovered-inverse, rgba(243, 241, 240, 0.04))}.r-popover--dismiss:active{--r-icon-button--background-color:var(--r-background-interactive-pressed-inverse, rgba(243, 241, 240, 0.12))}.r-popover--trigger{border:var(--r-popover--trigger--border, none);background:var(--r-popover--trigger--background, none);padding:var(--r-popover--trigger--padding, 0);cursor:var(--r-popover--trigger--cursor, pointer);display:var(--r-popover--trigger--display, inline-flex);align-items:var(--r-popover--trigger--align-items, center);justify-content:var(--r-popover--trigger--justify-content, center);min-width:var(--r-popover--trigger--min-width, unset);min-height:var(--r-popover--trigger--min-height, unset)}.r-popover--trigger:focus{box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);outline:2px solid var(--r-border-focused, #0071e3);outline-offset:2px}.r-popover--board{position:var(--r-popover--board--position, fixed);top:var(--r-popover--board--top, -1000em);right:var(--r-popover--board--right, auto);bottom:var(--r-popover--board--bottom, auto);left:var(--r-popover--board--left, -1000em);visibility:var(--r-popover--board--visibility, hidden);width:var(--r-popover--board--width, 100%);min-width:var(--r-popover--board--max-width, var(--board--min-width));max-width:var(--r-popover--board--max-width, var(--board--max-width));height:var(--r-popover--board--height, auto);max-height:var(--r-popover--board--max-height, var(--board--max-height));background-color:var(--r-popover--board--background-color, var(--r-background-inverse));color:var(--r-popover--board--color, var(--r-text-inverse));border:var(--r-popover--board--border, none);transform:var(--r-popover--board--transform, none);box-sizing:var(--r-popover--board--box-sizing, border-box);padding:var(--r-popover--board--padding, 0);margin:var(--r-popover--board--margin, 0);overflow:var(--r-popover--board--overflow, visible)}.r-popover--board-content{display:var(--r-popover--board-content--display, flex);flex-direction:var(--r-popover--board-content--flex-direction, column);gap:var(--r-popover--board-content--gap, 1.5rem);overflow:var(--r-popover--board-content--overflow, auto);height:var(--r-popover--board-content--height, auto);max-height:var(--r-popover--board-content--max-height, var(--board--max-height));padding:var(--r-popover--board-content--padding, 1.5rem);box-sizing:var(--r-popover--board-content--box-sizing, border-box)}.r-popover--board-pointer{display:var(--r-popover--pointer--display, flex);width:var(--r-popover--pointer--width, var(--pointer--width));height:var(--r-popover--pointer--height, var(--pointer--height));position:var(--r-popover--pointer--position, absolute);top:var(--r-popover--pointer--top, auto);right:var(--r-popover--pointer--right, auto);bottom:var(--r-popover--pointer--bottom, auto);left:var(--r-popover--pointer--left, auto);color:var(--r-popover--pointer--color, var(--r-background-inverse));transform:var(--r-popover--pointer--transform, none);transform-origin:var(--r-popover--pointer--transform-origin, center)}.r-popover--board-pointer>svg{display:flex}";export{i as r_popover}