telpick 1.0.6 → 1.0.8

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.

Potentially problematic release.


This version of telpick might be problematic. Click here for more details.

Files changed (262) hide show
  1. package/dist/assets/country-code.json +94 -0
  2. package/dist/assets/flags/ad.webp +0 -0
  3. package/dist/assets/flags/ae.webp +0 -0
  4. package/dist/assets/flags/af.png +0 -0
  5. package/dist/assets/flags/ag.webp +0 -0
  6. package/dist/assets/flags/ai.webp +0 -0
  7. package/dist/assets/flags/al.webp +0 -0
  8. package/dist/assets/flags/am.webp +0 -0
  9. package/dist/assets/flags/ao.webp +0 -0
  10. package/dist/assets/flags/aq.webp +0 -0
  11. package/dist/assets/flags/ar.webp +0 -0
  12. package/dist/assets/flags/as.webp +0 -0
  13. package/dist/assets/flags/at.webp +0 -0
  14. package/dist/assets/flags/au.webp +0 -0
  15. package/dist/assets/flags/aw.webp +0 -0
  16. package/dist/assets/flags/ax.webp +0 -0
  17. package/dist/assets/flags/az.webp +0 -0
  18. package/dist/assets/flags/ba.webp +0 -0
  19. package/dist/assets/flags/bb.webp +0 -0
  20. package/dist/assets/flags/bd.webp +0 -0
  21. package/dist/assets/flags/be.webp +0 -0
  22. package/dist/assets/flags/bf.webp +0 -0
  23. package/dist/assets/flags/bg.webp +0 -0
  24. package/dist/assets/flags/bh.webp +0 -0
  25. package/dist/assets/flags/bi.webp +0 -0
  26. package/dist/assets/flags/bj.webp +0 -0
  27. package/dist/assets/flags/bl.webp +0 -0
  28. package/dist/assets/flags/bm.webp +0 -0
  29. package/dist/assets/flags/bn.webp +0 -0
  30. package/dist/assets/flags/bo.webp +0 -0
  31. package/dist/assets/flags/bq.webp +0 -0
  32. package/dist/assets/flags/br.webp +0 -0
  33. package/dist/assets/flags/bs.webp +0 -0
  34. package/dist/assets/flags/bt.webp +0 -0
  35. package/dist/assets/flags/bv.webp +0 -0
  36. package/dist/assets/flags/bw.webp +0 -0
  37. package/dist/assets/flags/by.webp +0 -0
  38. package/dist/assets/flags/bz.webp +0 -0
  39. package/dist/assets/flags/ca.webp +0 -0
  40. package/dist/assets/flags/cc.webp +0 -0
  41. package/dist/assets/flags/cd.webp +0 -0
  42. package/dist/assets/flags/cf.webp +0 -0
  43. package/dist/assets/flags/cg.webp +0 -0
  44. package/dist/assets/flags/ch.webp +0 -0
  45. package/dist/assets/flags/ci.webp +0 -0
  46. package/dist/assets/flags/ck.webp +0 -0
  47. package/dist/assets/flags/cl.webp +0 -0
  48. package/dist/assets/flags/cm.webp +0 -0
  49. package/dist/assets/flags/cn.webp +0 -0
  50. package/dist/assets/flags/co.webp +0 -0
  51. package/dist/assets/flags/cr.webp +0 -0
  52. package/dist/assets/flags/cu.webp +0 -0
  53. package/dist/assets/flags/cv.webp +0 -0
  54. package/dist/assets/flags/cw.webp +0 -0
  55. package/dist/assets/flags/cx.webp +0 -0
  56. package/dist/assets/flags/cy.webp +0 -0
  57. package/dist/assets/flags/cz.webp +0 -0
  58. package/dist/assets/flags/de.webp +0 -0
  59. package/dist/assets/flags/dj.webp +0 -0
  60. package/dist/assets/flags/dk.webp +0 -0
  61. package/dist/assets/flags/dm.webp +0 -0
  62. package/dist/assets/flags/do.webp +0 -0
  63. package/dist/assets/flags/dz.webp +0 -0
  64. package/dist/assets/flags/ec.webp +0 -0
  65. package/dist/assets/flags/ee.webp +0 -0
  66. package/dist/assets/flags/eg.webp +0 -0
  67. package/dist/assets/flags/eh.webp +0 -0
  68. package/dist/assets/flags/er.webp +0 -0
  69. package/dist/assets/flags/es.webp +0 -0
  70. package/dist/assets/flags/et.webp +0 -0
  71. package/dist/assets/flags/fi.webp +0 -0
  72. package/dist/assets/flags/fj.webp +0 -0
  73. package/dist/assets/flags/fk.webp +0 -0
  74. package/dist/assets/flags/fm.webp +0 -0
  75. package/dist/assets/flags/fo.webp +0 -0
  76. package/dist/assets/flags/fr.webp +0 -0
  77. package/dist/assets/flags/ga.webp +0 -0
  78. package/dist/assets/flags/gb-eng.webp +0 -0
  79. package/dist/assets/flags/gb-nir.webp +0 -0
  80. package/dist/assets/flags/gb-sct.webp +0 -0
  81. package/dist/assets/flags/gb-wls.webp +0 -0
  82. package/dist/assets/flags/gb.webp +0 -0
  83. package/dist/assets/flags/gd.webp +0 -0
  84. package/dist/assets/flags/ge.webp +0 -0
  85. package/dist/assets/flags/gf.webp +0 -0
  86. package/dist/assets/flags/gg.webp +0 -0
  87. package/dist/assets/flags/gh.webp +0 -0
  88. package/dist/assets/flags/gi.webp +0 -0
  89. package/dist/assets/flags/gl.webp +0 -0
  90. package/dist/assets/flags/gm.webp +0 -0
  91. package/dist/assets/flags/gn.webp +0 -0
  92. package/dist/assets/flags/gp.webp +0 -0
  93. package/dist/assets/flags/gq.webp +0 -0
  94. package/dist/assets/flags/gr.webp +0 -0
  95. package/dist/assets/flags/gs.webp +0 -0
  96. package/dist/assets/flags/gt.webp +0 -0
  97. package/dist/assets/flags/gu.webp +0 -0
  98. package/dist/assets/flags/gw.webp +0 -0
  99. package/dist/assets/flags/gy.webp +0 -0
  100. package/dist/assets/flags/hk.webp +0 -0
  101. package/dist/assets/flags/hm.webp +0 -0
  102. package/dist/assets/flags/hn.webp +0 -0
  103. package/dist/assets/flags/hr.webp +0 -0
  104. package/dist/assets/flags/ht.webp +0 -0
  105. package/dist/assets/flags/hu.webp +0 -0
  106. package/dist/assets/flags/id.webp +0 -0
  107. package/dist/assets/flags/ie.webp +0 -0
  108. package/dist/assets/flags/il.webp +0 -0
  109. package/dist/assets/flags/im.webp +0 -0
  110. package/dist/assets/flags/in.webp +0 -0
  111. package/dist/assets/flags/io.webp +0 -0
  112. package/dist/assets/flags/iq.webp +0 -0
  113. package/dist/assets/flags/ir.webp +0 -0
  114. package/dist/assets/flags/is.webp +0 -0
  115. package/dist/assets/flags/it.webp +0 -0
  116. package/dist/assets/flags/je.webp +0 -0
  117. package/dist/assets/flags/jm.webp +0 -0
  118. package/dist/assets/flags/jo.webp +0 -0
  119. package/dist/assets/flags/jp.webp +0 -0
  120. package/dist/assets/flags/ke.webp +0 -0
  121. package/dist/assets/flags/kg.webp +0 -0
  122. package/dist/assets/flags/kh.webp +0 -0
  123. package/dist/assets/flags/ki.webp +0 -0
  124. package/dist/assets/flags/km.webp +0 -0
  125. package/dist/assets/flags/kn.webp +0 -0
  126. package/dist/assets/flags/kp.webp +0 -0
  127. package/dist/assets/flags/kr.webp +0 -0
  128. package/dist/assets/flags/kw.webp +0 -0
  129. package/dist/assets/flags/ky.webp +0 -0
  130. package/dist/assets/flags/kz.webp +0 -0
  131. package/dist/assets/flags/la.webp +0 -0
  132. package/dist/assets/flags/lb.webp +0 -0
  133. package/dist/assets/flags/lc.webp +0 -0
  134. package/dist/assets/flags/li.webp +0 -0
  135. package/dist/assets/flags/lista.txt +0 -0
  136. package/dist/assets/flags/lk.webp +0 -0
  137. package/dist/assets/flags/lr.webp +0 -0
  138. package/dist/assets/flags/ls.webp +0 -0
  139. package/dist/assets/flags/lt.webp +0 -0
  140. package/dist/assets/flags/lu.webp +0 -0
  141. package/dist/assets/flags/lv.webp +0 -0
  142. package/dist/assets/flags/ly.webp +0 -0
  143. package/dist/assets/flags/ma.webp +0 -0
  144. package/dist/assets/flags/mc.webp +0 -0
  145. package/dist/assets/flags/md.webp +0 -0
  146. package/dist/assets/flags/me.webp +0 -0
  147. package/dist/assets/flags/mf.webp +0 -0
  148. package/dist/assets/flags/mg.webp +0 -0
  149. package/dist/assets/flags/mh.webp +0 -0
  150. package/dist/assets/flags/mk.webp +0 -0
  151. package/dist/assets/flags/ml.webp +0 -0
  152. package/dist/assets/flags/mm.webp +0 -0
  153. package/dist/assets/flags/mn.webp +0 -0
  154. package/dist/assets/flags/mo.webp +0 -0
  155. package/dist/assets/flags/mp.webp +0 -0
  156. package/dist/assets/flags/mq.webp +0 -0
  157. package/dist/assets/flags/mr.webp +0 -0
  158. package/dist/assets/flags/ms.webp +0 -0
  159. package/dist/assets/flags/mt.webp +0 -0
  160. package/dist/assets/flags/mu.webp +0 -0
  161. package/dist/assets/flags/mv.webp +0 -0
  162. package/dist/assets/flags/mw.webp +0 -0
  163. package/dist/assets/flags/mx.webp +0 -0
  164. package/dist/assets/flags/my.webp +0 -0
  165. package/dist/assets/flags/mz.webp +0 -0
  166. package/dist/assets/flags/na.webp +0 -0
  167. package/dist/assets/flags/nc.webp +0 -0
  168. package/dist/assets/flags/ne.webp +0 -0
  169. package/dist/assets/flags/nf.webp +0 -0
  170. package/dist/assets/flags/ng.webp +0 -0
  171. package/dist/assets/flags/ni.webp +0 -0
  172. package/dist/assets/flags/nl.webp +0 -0
  173. package/dist/assets/flags/no.webp +0 -0
  174. package/dist/assets/flags/np.webp +0 -0
  175. package/dist/assets/flags/nr.webp +0 -0
  176. package/dist/assets/flags/nu.webp +0 -0
  177. package/dist/assets/flags/nz.webp +0 -0
  178. package/dist/assets/flags/om.webp +0 -0
  179. package/dist/assets/flags/pa.webp +0 -0
  180. package/dist/assets/flags/pe.webp +0 -0
  181. package/dist/assets/flags/pf.webp +0 -0
  182. package/dist/assets/flags/pg.webp +0 -0
  183. package/dist/assets/flags/ph.webp +0 -0
  184. package/dist/assets/flags/pk.webp +0 -0
  185. package/dist/assets/flags/pl.webp +0 -0
  186. package/dist/assets/flags/pm.webp +0 -0
  187. package/dist/assets/flags/pn.webp +0 -0
  188. package/dist/assets/flags/pr.webp +0 -0
  189. package/dist/assets/flags/ps.webp +0 -0
  190. package/dist/assets/flags/pt.webp +0 -0
  191. package/dist/assets/flags/pw.webp +0 -0
  192. package/dist/assets/flags/py.webp +0 -0
  193. package/dist/assets/flags/qa.webp +0 -0
  194. package/dist/assets/flags/re.webp +0 -0
  195. package/dist/assets/flags/ro.webp +0 -0
  196. package/dist/assets/flags/rs.webp +0 -0
  197. package/dist/assets/flags/ru.webp +0 -0
  198. package/dist/assets/flags/rw.webp +0 -0
  199. package/dist/assets/flags/sa.webp +0 -0
  200. package/dist/assets/flags/sb.webp +0 -0
  201. package/dist/assets/flags/sc.webp +0 -0
  202. package/dist/assets/flags/sd.webp +0 -0
  203. package/dist/assets/flags/se (1).webp +0 -0
  204. package/dist/assets/flags/se.webp +0 -0
  205. package/dist/assets/flags/sg.webp +0 -0
  206. package/dist/assets/flags/sh.webp +0 -0
  207. package/dist/assets/flags/si.webp +0 -0
  208. package/dist/assets/flags/sj.webp +0 -0
  209. package/dist/assets/flags/sk.webp +0 -0
  210. package/dist/assets/flags/sl.webp +0 -0
  211. package/dist/assets/flags/sm.webp +0 -0
  212. package/dist/assets/flags/sn.webp +0 -0
  213. package/dist/assets/flags/so.webp +0 -0
  214. package/dist/assets/flags/sr.webp +0 -0
  215. package/dist/assets/flags/ss.webp +0 -0
  216. package/dist/assets/flags/st.webp +0 -0
  217. package/dist/assets/flags/sv.webp +0 -0
  218. package/dist/assets/flags/sx.webp +0 -0
  219. package/dist/assets/flags/sy.webp +0 -0
  220. package/dist/assets/flags/sz.webp +0 -0
  221. package/dist/assets/flags/tc.webp +0 -0
  222. package/dist/assets/flags/td.webp +0 -0
  223. package/dist/assets/flags/tf.webp +0 -0
  224. package/dist/assets/flags/tg.webp +0 -0
  225. package/dist/assets/flags/th.webp +0 -0
  226. package/dist/assets/flags/tj.webp +0 -0
  227. package/dist/assets/flags/tk.webp +0 -0
  228. package/dist/assets/flags/tl.webp +0 -0
  229. package/dist/assets/flags/tm.webp +0 -0
  230. package/dist/assets/flags/tn.webp +0 -0
  231. package/dist/assets/flags/to.webp +0 -0
  232. package/dist/assets/flags/tr.webp +0 -0
  233. package/dist/assets/flags/tt.webp +0 -0
  234. package/dist/assets/flags/tv.webp +0 -0
  235. package/dist/assets/flags/tw.webp +0 -0
  236. package/dist/assets/flags/tz.webp +0 -0
  237. package/dist/assets/flags/ua.webp +0 -0
  238. package/dist/assets/flags/ug.webp +0 -0
  239. package/dist/assets/flags/um.webp +0 -0
  240. package/dist/assets/flags/us.webp +0 -0
  241. package/dist/assets/flags/uy.webp +0 -0
  242. package/dist/assets/flags/uz.webp +0 -0
  243. package/dist/assets/flags/va.webp +0 -0
  244. package/dist/assets/flags/vc.webp +0 -0
  245. package/dist/assets/flags/ve.webp +0 -0
  246. package/dist/assets/flags/vg.webp +0 -0
  247. package/dist/assets/flags/vi.webp +0 -0
  248. package/dist/assets/flags/vn.webp +0 -0
  249. package/dist/assets/flags/vu.webp +0 -0
  250. package/dist/assets/flags/wf.webp +0 -0
  251. package/dist/assets/flags/ws.webp +0 -0
  252. package/dist/assets/flags/xk.webp +0 -0
  253. package/dist/assets/flags/ye.webp +0 -0
  254. package/dist/assets/flags/yt.webp +0 -0
  255. package/dist/assets/flags/za.webp +0 -0
  256. package/dist/assets/flags/zm.webp +0 -0
  257. package/dist/assets/flags/zw.webp +0 -0
  258. package/dist/telpick.es.js +642 -82
  259. package/dist/telpick.umd.js +1 -0
  260. package/dist/telpick.vue.es.js +22 -19
  261. package/package.json +3 -2
  262. package/src/telpick.js +16 -6
@@ -1,57 +1,617 @@
1
- class _ {
2
- constructor({ code: o = null, onChange: r = () => {
3
- }, styleOverrides: d = {} } = {}) {
4
- this.code = o, this.onChange = r, this.styleOverrides = d, this.codes = [], this.selectedCode = o, this.isDropdownOpen = !1, this.searchQuery = "", this.container = null, this.dropdown = null, this._outsideHandler = null;
1
+ const A = [
2
+ {
3
+ country: "Afganistán",
4
+ code: "+93",
5
+ flag: "/flags/af.png",
6
+ country_code: "AF"
7
+ },
8
+ {
9
+ country: "Albania",
10
+ code: "+355",
11
+ flag: "/flags/al.webp",
12
+ country_code: "AL"
13
+ },
14
+ {
15
+ country: "Alemania",
16
+ code: "+49",
17
+ flag: "/flags/de.webp",
18
+ country_code: "DE"
19
+ },
20
+ {
21
+ country: "Andorra",
22
+ code: "+376",
23
+ flag: "/flags/ad.webp",
24
+ country_code: "AD"
25
+ },
26
+ {
27
+ country: "Antigua y Barbuda",
28
+ code: "+1",
29
+ flag: "/flags/ag.webp",
30
+ country_code: "AG"
31
+ },
32
+ {
33
+ country: "Arabia Saudita",
34
+ code: "+966",
35
+ flag: "/flags/sa.webp",
36
+ country_code: "SA"
37
+ },
38
+ {
39
+ country: "Argentina",
40
+ code: "+54",
41
+ flag: "/flags/ar.webp",
42
+ country_code: "AR"
43
+ },
44
+ {
45
+ country: "Australia",
46
+ code: "+61",
47
+ flag: "/flags/au.webp",
48
+ country_code: "AU"
49
+ },
50
+ {
51
+ country: "Austria",
52
+ code: "+43",
53
+ flag: "/flags/at.webp",
54
+ country_code: "AT"
55
+ },
56
+ {
57
+ country: "Bahamas",
58
+ code: "+1",
59
+ flag: "/flags/bs.webp",
60
+ country_code: "BS"
61
+ },
62
+ {
63
+ country: "Bangladés",
64
+ code: "+880",
65
+ flag: "/flags/bd.webp",
66
+ country_code: "BD"
67
+ },
68
+ {
69
+ country: "Barbados",
70
+ code: "+1",
71
+ flag: "/flags/bb.webp",
72
+ country_code: "BB"
73
+ },
74
+ {
75
+ country: "Bélgica",
76
+ code: "+32",
77
+ flag: "/flags/be.webp",
78
+ country_code: "BE"
79
+ },
80
+ {
81
+ country: "Belice",
82
+ code: "+501",
83
+ flag: "/flags/bz.webp",
84
+ country_code: "BZ"
85
+ },
86
+ {
87
+ country: "Bielorrusia",
88
+ code: "+375",
89
+ flag: "/flags/by.webp",
90
+ country_code: "BY"
91
+ },
92
+ {
93
+ country: "Bolivia",
94
+ code: "+591",
95
+ flag: "/flags/bo.webp",
96
+ country_code: "BO"
97
+ },
98
+ {
99
+ country: "Bosnia y Herzegovina",
100
+ code: "+387",
101
+ flag: "/flags/ba.webp",
102
+ country_code: "BA"
103
+ },
104
+ {
105
+ country: "Brasil",
106
+ code: "+55",
107
+ flag: "/flags/br.webp",
108
+ country_code: "BR"
109
+ },
110
+ {
111
+ country: "Bulgaria",
112
+ code: "+359",
113
+ flag: "/flags/bg.webp",
114
+ country_code: "BG"
115
+ },
116
+ {
117
+ country: "Canadá",
118
+ code: "+1",
119
+ flag: "/flags/ca.webp",
120
+ country_code: "CA"
121
+ },
122
+ {
123
+ country: "Chile",
124
+ code: "+56",
125
+ flag: "/flags/cl.webp",
126
+ country_code: "CL"
127
+ },
128
+ {
129
+ country: "China",
130
+ code: "+86",
131
+ flag: "/flags/cn.webp",
132
+ country_code: "CN"
133
+ },
134
+ {
135
+ country: "Colombia",
136
+ code: "+57",
137
+ flag: "/flags/co.webp",
138
+ country_code: "CO"
139
+ },
140
+ {
141
+ country: "Corea del Sur",
142
+ code: "+82",
143
+ flag: "/flags/kr.webp",
144
+ country_code: "KR"
145
+ },
146
+ {
147
+ country: "Costa Rica",
148
+ code: "+506",
149
+ flag: "/flags/cr.webp",
150
+ country_code: "CR"
151
+ },
152
+ {
153
+ country: "Croacia",
154
+ code: "+385",
155
+ flag: "/flags/hr.webp",
156
+ country_code: "HR"
157
+ },
158
+ {
159
+ country: "Cuba",
160
+ code: "+53",
161
+ flag: "/flags/cu.webp",
162
+ country_code: "CU"
163
+ },
164
+ {
165
+ country: "Dinamarca",
166
+ code: "+45",
167
+ flag: "/flags/dk.webp",
168
+ country_code: "DK"
169
+ },
170
+ {
171
+ country: "Dominica",
172
+ code: "+1",
173
+ flag: "/flags/dm.webp",
174
+ country_code: "DM"
175
+ },
176
+ {
177
+ country: "Ecuador",
178
+ code: "+593",
179
+ flag: "/flags/ec.webp",
180
+ country_code: "EC"
181
+ },
182
+ {
183
+ country: "Egipto",
184
+ code: "+20",
185
+ flag: "/flags/eg.webp",
186
+ country_code: "EG"
187
+ },
188
+ {
189
+ country: "El Salvador",
190
+ code: "+503",
191
+ flag: "/flags/sv.webp",
192
+ country_code: "SV"
193
+ },
194
+ {
195
+ country: "España",
196
+ code: "+34",
197
+ flag: "/flags/es.webp",
198
+ country_code: "ES"
199
+ },
200
+ {
201
+ country: "Estados Unidos",
202
+ code: "+1",
203
+ flag: "/flags/us.webp",
204
+ country_code: "US"
205
+ },
206
+ {
207
+ country: "Estonia",
208
+ code: "+372",
209
+ flag: "/flags/ee.webp",
210
+ country_code: "EE"
211
+ },
212
+ {
213
+ country: "Filipinas",
214
+ code: "+63",
215
+ flag: "/flags/ph.webp",
216
+ country_code: "PH"
217
+ },
218
+ {
219
+ country: "Finlandia",
220
+ code: "+358",
221
+ flag: "/flags/fi.webp",
222
+ country_code: "FI"
223
+ },
224
+ {
225
+ country: "Francia",
226
+ code: "+33",
227
+ flag: "/flags/fr.webp",
228
+ country_code: "FR"
229
+ },
230
+ {
231
+ country: "Granada",
232
+ code: "+1",
233
+ flag: "/flags/gd.webp",
234
+ country_code: "GD"
235
+ },
236
+ {
237
+ country: "Grecia",
238
+ code: "+30",
239
+ flag: "/flags/gr.webp",
240
+ country_code: "GR"
241
+ },
242
+ {
243
+ country: "Guatemala",
244
+ code: "+502",
245
+ flag: "/flags/gt.webp",
246
+ country_code: "GT"
247
+ },
248
+ {
249
+ country: "Guyana",
250
+ code: "+592",
251
+ flag: "/flags/gy.webp",
252
+ country_code: "GY"
253
+ },
254
+ {
255
+ country: "Haití",
256
+ code: "+509",
257
+ flag: "/flags/ht.webp",
258
+ country_code: "HT"
259
+ },
260
+ {
261
+ country: "Honduras",
262
+ code: "+504",
263
+ flag: "/flags/hn.webp",
264
+ country_code: "HN"
265
+ },
266
+ {
267
+ country: "Hungría",
268
+ code: "+36",
269
+ flag: "/flags/hu.webp",
270
+ country_code: "HU"
271
+ },
272
+ {
273
+ country: "India",
274
+ code: "+91",
275
+ flag: "/flags/in.webp",
276
+ country_code: "IN"
277
+ },
278
+ {
279
+ country: "Indonesia",
280
+ code: "+62",
281
+ flag: "/flags/id.webp",
282
+ country_code: "ID"
283
+ },
284
+ {
285
+ country: "Irak",
286
+ code: "+964",
287
+ flag: "/flags/iq.webp",
288
+ country_code: "IQ"
289
+ },
290
+ {
291
+ country: "Irlanda",
292
+ code: "+353",
293
+ flag: "/flags/ie.webp",
294
+ country_code: "IE"
295
+ },
296
+ {
297
+ country: "Islandia",
298
+ code: "+354",
299
+ flag: "/flags/is.webp",
300
+ country_code: "IS"
301
+ },
302
+ {
303
+ country: "Israel",
304
+ code: "+972",
305
+ flag: "/flags/il.webp",
306
+ country_code: "IL"
307
+ },
308
+ {
309
+ country: "Italia",
310
+ code: "+39",
311
+ flag: "/flags/it.webp",
312
+ country_code: "IT"
313
+ },
314
+ {
315
+ country: "Jamaica",
316
+ code: "+1",
317
+ flag: "/flags/jm.webp",
318
+ country_code: "JM"
319
+ },
320
+ {
321
+ country: "Japón",
322
+ code: "+81",
323
+ flag: "/flags/jp.webp",
324
+ country_code: "JP"
325
+ },
326
+ {
327
+ country: "Kenia",
328
+ code: "+254",
329
+ flag: "/flags/ke.webp",
330
+ country_code: "KE"
331
+ },
332
+ {
333
+ country: "Letonia",
334
+ code: "+371",
335
+ flag: "/flags/lv.webp",
336
+ country_code: "LV"
337
+ },
338
+ {
339
+ country: "Lituania",
340
+ code: "+370",
341
+ flag: "/flags/lt.webp",
342
+ country_code: "LT"
343
+ },
344
+ {
345
+ country: "Luxemburgo",
346
+ code: "+352",
347
+ flag: "/flags/lu.webp",
348
+ country_code: "LU"
349
+ },
350
+ {
351
+ country: "Malasia",
352
+ code: "+60",
353
+ flag: "/flags/my.webp",
354
+ country_code: "MY"
355
+ },
356
+ {
357
+ country: "Malta",
358
+ code: "+356",
359
+ flag: "/flags/mt.webp",
360
+ country_code: "MT"
361
+ },
362
+ {
363
+ country: "México",
364
+ code: "+52",
365
+ flag: "/flags/mx.webp",
366
+ country_code: "MX"
367
+ },
368
+ {
369
+ country: "Mónaco",
370
+ code: "+377",
371
+ flag: "/flags/mc.webp",
372
+ country_code: "MC"
373
+ },
374
+ {
375
+ country: "Nicaragua",
376
+ code: "+505",
377
+ flag: "/flags/ni.webp",
378
+ country_code: "NI"
379
+ },
380
+ {
381
+ country: "Nigeria",
382
+ code: "+234",
383
+ flag: "/flags/ng.webp",
384
+ country_code: "NG"
385
+ },
386
+ {
387
+ country: "Noruega",
388
+ code: "+47",
389
+ flag: "/flags/no.webp",
390
+ country_code: "NO"
391
+ },
392
+ {
393
+ country: "Nueva Zelanda",
394
+ code: "+64",
395
+ flag: "/flags/nz.webp",
396
+ country_code: "NZ"
397
+ },
398
+ {
399
+ country: "Países Bajos",
400
+ code: "+31",
401
+ flag: "/flags/nl.webp",
402
+ country_code: "NL"
403
+ },
404
+ {
405
+ country: "Pakistán",
406
+ code: "+92",
407
+ flag: "/flags/pk.webp",
408
+ country_code: "PK"
409
+ },
410
+ {
411
+ country: "Panamá",
412
+ code: "+507",
413
+ flag: "/flags/pa.webp",
414
+ country_code: "PA"
415
+ },
416
+ {
417
+ country: "Paraguay",
418
+ code: "+595",
419
+ flag: "/flags/py.webp",
420
+ country_code: "PY"
421
+ },
422
+ {
423
+ country: "Perú",
424
+ code: "+51",
425
+ flag: "/flags/pe.webp",
426
+ country_code: "PE"
427
+ },
428
+ {
429
+ country: "Polonia",
430
+ code: "+48",
431
+ flag: "/flags/pl.webp",
432
+ country_code: "PL"
433
+ },
434
+ {
435
+ country: "Portugal",
436
+ code: "+351",
437
+ flag: "/flags/pt.webp",
438
+ country_code: "PT"
439
+ },
440
+ {
441
+ country: "Reino Unido",
442
+ code: "+44",
443
+ flag: "/flags/gb.webp",
444
+ country_code: "GB"
445
+ },
446
+ {
447
+ country: "República Checa",
448
+ code: "+420",
449
+ flag: "/flags/cz.webp",
450
+ country_code: "CZ"
451
+ },
452
+ {
453
+ country: "República Dominicana",
454
+ code: "+1",
455
+ flag: "/flags/do.webp",
456
+ country_code: "DO"
457
+ },
458
+ {
459
+ country: "Rumanía",
460
+ code: "+40",
461
+ flag: "/flags/ro.webp",
462
+ country_code: "RO"
463
+ },
464
+ {
465
+ country: "Rusia",
466
+ code: "+7",
467
+ flag: "/flags/ru.webp",
468
+ country_code: "RU"
469
+ },
470
+ {
471
+ country: "San Cristóbal y Nieves",
472
+ code: "+1",
473
+ flag: "/flags/kn.webp",
474
+ country_code: "KN"
475
+ },
476
+ {
477
+ country: "San Vicente y las Granadinas",
478
+ code: "+1",
479
+ flag: "/flags/vc.webp",
480
+ country_code: "VC"
481
+ },
482
+ {
483
+ country: "Santa Lucía",
484
+ code: "+1",
485
+ flag: "/flags/lc.webp",
486
+ country_code: "LC"
487
+ },
488
+ {
489
+ country: "Singapur",
490
+ code: "+65",
491
+ flag: "/flags/sg.webp",
492
+ country_code: "SG"
493
+ },
494
+ {
495
+ country: "Sudáfrica",
496
+ code: "+27",
497
+ flag: "/flags/za.webp",
498
+ country_code: "ZA"
499
+ },
500
+ {
501
+ country: "Suecia",
502
+ code: "+46",
503
+ flag: "/flags/se.webp",
504
+ country_code: "SE"
505
+ },
506
+ {
507
+ country: "Suiza",
508
+ code: "+41",
509
+ flag: "/flags/ch.webp",
510
+ country_code: "CH"
511
+ },
512
+ {
513
+ country: "Surinam",
514
+ code: "+597",
515
+ flag: "/flags/sr.webp",
516
+ country_code: "SR"
517
+ },
518
+ {
519
+ country: "Tailandia",
520
+ code: "+66",
521
+ flag: "/flags/th.webp",
522
+ country_code: "TH"
523
+ },
524
+ {
525
+ country: "Trinidad y Tobago",
526
+ code: "+1",
527
+ flag: "/flags/tt.webp",
528
+ country_code: "TT"
529
+ },
530
+ {
531
+ country: "Ucrania",
532
+ code: "+380",
533
+ flag: "/flags/ua.webp",
534
+ country_code: "UA"
535
+ },
536
+ {
537
+ country: "Uruguay",
538
+ code: "+598",
539
+ flag: "/flags/uy.webp",
540
+ country_code: "UY"
541
+ },
542
+ {
543
+ country: "Venezuela",
544
+ code: "+58",
545
+ flag: "/flags/ve.webp",
546
+ country_code: "VE"
547
+ },
548
+ {
549
+ country: "Vietnam",
550
+ code: "+84",
551
+ flag: "/flags/vn.webp",
552
+ country_code: "VN"
5
553
  }
6
- async init(o) {
7
- this.container = o;
8
- const d = await (await fetch("src/assets/country-code.json")).json();
9
- if (this.codes = d.sort((c, e) => c.country.localeCompare(e.country, "es")), this.code) {
10
- const c = this.codes.find((e) => e.country_code === this.code);
554
+ ];
555
+ class E {
556
+ constructor({ code: t = null, onChange: d = () => {
557
+ }, styleOverrides: c = {} } = {}) {
558
+ this.code = t, this.onChange = d, this.styleOverrides = c, this.codes = [], this.selectedCode = t, this.isDropdownOpen = !1, this.searchQuery = "", this.container = null, this.dropdown = null, this._outsideHandler = null;
559
+ }
560
+ _getAssetsBase() {
561
+ if (typeof import.meta < "u" && import.meta.url)
562
+ try {
563
+ return new URL("./assets", self.location).href + "/";
564
+ } catch {
565
+ }
566
+ return "";
567
+ }
568
+ async init(t) {
569
+ if (this.container = t, this.codes = [...A].sort((c, a) => c.country.localeCompare(a.country, "es")), this._assetsBase = this._getAssetsBase(), this.code) {
570
+ const c = this.codes.find((a) => a.country_code === this.code);
11
571
  c && (this.selectedCode = c.country_code);
12
572
  } else {
13
573
  const c = [
14
574
  async () => {
15
575
  try {
16
- const s = await (await fetch("https://ip-api.com/json/?fields=countryCode")).json();
17
- if (s.countryCode)
18
- return this.codes.find((t) => t.country_code === s.countryCode);
576
+ const e = await (await fetch("https://ip-api.com/json/?fields=countryCode")).json();
577
+ if (e.countryCode)
578
+ return this.codes.find((r) => r.country_code === e.countryCode);
19
579
  } catch {
20
580
  }
21
581
  return null;
22
582
  },
23
583
  async () => {
24
584
  try {
25
- const s = await (await fetch("https://get.geojs.io/v1/ip/country.json")).json();
26
- if (s.country)
27
- return this.codes.find((t) => t.country_code === s.country);
585
+ const e = await (await fetch("https://get.geojs.io/v1/ip/country.json")).json();
586
+ if (e.country)
587
+ return this.codes.find((r) => r.country_code === e.country);
28
588
  } catch {
29
589
  }
30
590
  return null;
31
591
  },
32
592
  async () => {
33
593
  try {
34
- const s = await (await fetch("https://ipapi.co/json/")).json();
35
- if (s.country_code)
36
- return this.codes.find((t) => t.country_code === s.country_code);
594
+ const e = await (await fetch("https://ipapi.co/json/")).json();
595
+ if (e.country_code)
596
+ return this.codes.find((r) => r.country_code === e.country_code);
37
597
  } catch {
38
598
  }
39
599
  return null;
40
600
  }
41
601
  ];
42
- let e = null;
602
+ let a = null;
43
603
  for (const n of c)
44
604
  try {
45
- if (e = await Promise.race([
605
+ if (a = await Promise.race([
46
606
  n(),
47
- new Promise((s) => setTimeout(() => s(null), 3e3))
48
- ]), e)
607
+ new Promise((e) => setTimeout(() => e(null), 3e3))
608
+ ]), a)
49
609
  break;
50
610
  } catch {
51
611
  }
52
- if (!e)
612
+ if (!a)
53
613
  try {
54
- const n = Intl.DateTimeFormat().resolvedOptions().timeZone, t = {
614
+ const n = Intl.DateTimeFormat().resolvedOptions().timeZone, r = {
55
615
  "America/Lima": "PE",
56
616
  "America/Bogota": "CO",
57
617
  "America/Mexico_City": "MX",
@@ -114,92 +674,92 @@ class _ {
114
674
  "Africa/Nairobi": "KE",
115
675
  "Africa/Lagos": "NG"
116
676
  }[n];
117
- t && (e = this.codes.find((i) => i.country_code === t));
677
+ r && (a = this.codes.find((m) => m.country_code === r));
118
678
  } catch {
119
679
  }
120
- if (e)
121
- this.selectedCode = e.country_code;
680
+ if (a)
681
+ this.selectedCode = a.country_code;
122
682
  else {
123
- const n = this.codes.find((s) => s.country_code === "CO");
683
+ const n = this.codes.find((e) => e.country_code === "CO");
124
684
  n && (this.selectedCode = n.country_code);
125
685
  }
126
686
  }
127
687
  this.render();
128
- const p = this.codes.find((c) => c.country_code === this.selectedCode);
129
- p && this.onChange(p), this._setupOutsideClick();
688
+ const d = this.codes.find((c) => c.country_code === this.selectedCode);
689
+ d && this.onChange(d), this._setupOutsideClick();
130
690
  }
131
691
  render() {
132
692
  this.container.innerHTML = "";
133
- const o = document.createElement("button");
134
- o.className = "telpick-btn", Object.assign(o.style, this.styleOverrides), o.onclick = () => {
693
+ const t = document.createElement("button");
694
+ t.className = "telpick-btn", Object.assign(t.style, this.styleOverrides), t.onclick = () => {
135
695
  this.isDropdownOpen = !this.isDropdownOpen, this.render();
136
696
  };
137
- const r = document.createElement("div");
138
- r.className = "telpick-flag";
139
- const d = this.codes.find((e) => e.country_code === this.selectedCode) || { flag: "", code: "", country: "" };
140
- if (d.flag) {
697
+ const d = document.createElement("div");
698
+ d.className = "telpick-flag";
699
+ const c = this.codes.find((e) => e.country_code === this.selectedCode) || { flag: "", code: "", country: "" };
700
+ if (c.flag) {
141
701
  const e = document.createElement("img");
142
- e.src = "src/assets" + d.flag, e.className = "w-full h-full object-cover", e.alt = "flag", r.appendChild(e);
702
+ e.src = (this._assetsBase || "src/assets") + (c.flag.startsWith("/") ? c.flag : "/" + c.flag), e.className = "w-full h-full object-cover", e.alt = "flag", d.appendChild(e);
143
703
  }
144
- o.appendChild(r);
145
- const p = document.createElement("span");
146
- p.textContent = d.code, o.appendChild(p);
147
- const c = document.createElement("span");
148
- if (c.className = "ml-auto", c.textContent = "▼", o.appendChild(c), this.container.appendChild(o), this.isDropdownOpen) {
149
- this.dropdown = document.createElement("div"), this.dropdown.className = "telpick-dropdown", this.dropdown.onclick = (t) => t.stopPropagation(), this.dropdown.onmousedown = (t) => t.stopPropagation();
704
+ t.appendChild(d);
705
+ const a = document.createElement("span");
706
+ a.textContent = c.code, t.appendChild(a);
707
+ const n = document.createElement("span");
708
+ if (n.className = "ml-auto", n.textContent = "▼", t.appendChild(n), this.container.appendChild(t), this.isDropdownOpen) {
709
+ this.dropdown = document.createElement("div"), this.dropdown.className = "telpick-dropdown", this.dropdown.onclick = (o) => o.stopPropagation(), this.dropdown.onmousedown = (o) => o.stopPropagation();
150
710
  const e = document.createElement("input");
151
- e.className = "telpick-search", e.type = "text", e.placeholder = "Buscar país...", e.value = this.searchQuery, e.oninput = (t) => {
152
- var m;
153
- t.stopPropagation();
154
- const i = t.target, f = i.selectionStart || 0, u = i.value;
711
+ e.className = "telpick-search", e.type = "text", e.placeholder = "Buscar país...", e.value = this.searchQuery, e.oninput = (o) => {
712
+ var g;
713
+ o.stopPropagation();
714
+ const l = o.target, y = l.selectionStart || 0, u = l.value;
155
715
  this.searchQuery = u;
156
- const l = (m = this.dropdown) == null ? void 0 : m.querySelector("ul");
157
- l ? (l.innerHTML = "", (this.searchQuery ? this.codes.filter((a) => a.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((a) => {
158
- const h = document.createElement("li"), w = a.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
159
- h.className = `telpick-item ${w ? "telpick-item-selected" : ""}`, h.onclick = () => {
160
- this.selectedCode = a.country_code, this.onChange(a), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
716
+ const i = (g = this.dropdown) == null ? void 0 : g.querySelector("ul");
717
+ i ? (i.innerHTML = "", (this.searchQuery ? this.codes.filter((s) => s.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((s) => {
718
+ const f = document.createElement("li"), C = s.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
719
+ f.className = `telpick-item ${C ? "telpick-item-selected" : ""}`, f.onclick = () => {
720
+ this.selectedCode = s.country_code, this.onChange(s), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
161
721
  };
162
- const A = document.createElement("div");
163
- A.className = "telpick-flag";
164
- const y = document.createElement("img");
165
- y.src = "src/assets" + a.flag, y.className = "w-full h-full object-cover", y.alt = "flag", A.appendChild(y), h.appendChild(A);
166
- const E = document.createElement("span");
167
- E.textContent = a.country, h.appendChild(E);
168
- const g = document.createElement("span");
169
- g.className = "ml-auto", g.textContent = a.code, h.appendChild(g), l.appendChild(h);
722
+ const w = document.createElement("div");
723
+ w.className = "telpick-flag";
724
+ const h = document.createElement("img");
725
+ h.src = (this._assetsBase || "src/assets") + (s.flag.startsWith("/") ? s.flag : "/" + s.flag), h.className = "w-full h-full object-cover", h.alt = "flag", w.appendChild(h), f.appendChild(w);
726
+ const b = document.createElement("span");
727
+ b.textContent = s.country, f.appendChild(b);
728
+ const _ = document.createElement("span");
729
+ _.className = "ml-auto", _.textContent = s.code, f.appendChild(_), i.appendChild(f);
170
730
  }), requestAnimationFrame(() => {
171
731
  if (e) {
172
732
  e.focus();
173
- const a = Math.min(f + 1, u.length);
174
- e.setSelectionRange(a, a);
733
+ const s = Math.min(y + 1, u.length);
734
+ e.setSelectionRange(s, s);
175
735
  }
176
736
  })) : this.render();
177
- }, e.onclick = (t) => t.stopPropagation(), e.onmousedown = (t) => t.stopPropagation(), this.dropdown.appendChild(e);
178
- const n = document.createElement("ul");
179
- n.style.maxHeight = "130px", n.style.overflowY = "auto", (this.searchQuery ? this.codes.filter((t) => t.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((t) => {
180
- const i = document.createElement("li"), f = t.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
181
- i.className = `telpick-item ${f ? "telpick-item-selected" : ""}`, i.setAttribute("aria-selected", f), i.onclick = () => {
182
- this.selectedCode = t.country_code, this.onChange(t), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
737
+ }, e.onclick = (o) => o.stopPropagation(), e.onmousedown = (o) => o.stopPropagation(), this.dropdown.appendChild(e);
738
+ const r = document.createElement("ul");
739
+ r.style.maxHeight = "130px", r.style.overflowY = "auto", (this.searchQuery ? this.codes.filter((o) => o.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((o) => {
740
+ const l = document.createElement("li"), y = o.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
741
+ l.className = `telpick-item ${y ? "telpick-item-selected" : ""}`, l.setAttribute("aria-selected", y), l.onclick = () => {
742
+ this.selectedCode = o.country_code, this.onChange(o), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
183
743
  };
184
744
  const u = document.createElement("div");
185
745
  u.className = "telpick-flag";
186
- const l = document.createElement("img");
187
- l.src = "src/assets" + t.flag, l.className = "w-full h-full object-cover", l.alt = "flag", u.appendChild(l), i.appendChild(u);
188
- const m = document.createElement("span");
189
- m.textContent = t.country, i.appendChild(m);
190
- const C = document.createElement("span");
191
- C.className = "ml-auto", C.textContent = t.code, i.appendChild(C), n.appendChild(i);
192
- }), this.dropdown.appendChild(n), this.container.appendChild(this.dropdown), requestAnimationFrame(() => {
746
+ const i = document.createElement("img");
747
+ i.src = (this._assetsBase || "src/assets") + (o.flag.startsWith("/") ? o.flag : "/" + o.flag), i.className = "w-full h-full object-cover", i.alt = "flag", u.appendChild(i), l.appendChild(u);
748
+ const g = document.createElement("span");
749
+ g.textContent = o.country, l.appendChild(g);
750
+ const p = document.createElement("span");
751
+ p.className = "ml-auto", p.textContent = o.code, l.appendChild(p), r.appendChild(l);
752
+ }), this.dropdown.appendChild(r), this.container.appendChild(this.dropdown), requestAnimationFrame(() => {
193
753
  e && e.focus();
194
754
  });
195
755
  }
196
756
  }
197
757
  _setupOutsideClick() {
198
- this._outsideHandler && document.removeEventListener("click", this._outsideHandler), this._outsideHandler = (o) => {
199
- const r = o.target;
200
- if (this.isDropdownOpen && this.container && r) {
201
- const d = this.container.querySelector(".telpick-dropdown");
202
- !this.container.contains(r) && (!d || !d.contains(r)) && (this.isDropdownOpen = !1, this.render());
758
+ this._outsideHandler && document.removeEventListener("click", this._outsideHandler), this._outsideHandler = (t) => {
759
+ const d = t.target;
760
+ if (this.isDropdownOpen && this.container && d) {
761
+ const c = this.container.querySelector(".telpick-dropdown");
762
+ !this.container.contains(d) && (!c || !c.contains(d)) && (this.isDropdownOpen = !1, this.render());
203
763
  }
204
764
  }, document.addEventListener("click", this._outsideHandler, !0);
205
765
  }
@@ -207,7 +767,7 @@ class _ {
207
767
  this._outsideHandler && document.removeEventListener("mousedown", this._outsideHandler), this.container.innerHTML = "";
208
768
  }
209
769
  }
210
- window.Telpick = _;
770
+ window.Telpick = E;
211
771
  export {
212
- _ as Telpick
772
+ E as Telpick
213
773
  };