PageSourceSearch

https://www.esmartcity.es/wp-content/themes/magazine-pro/gtr/assets/js/mailchimp.js?ver=1.9.1

js esmartcity.es collected 2026-10-02 04:55:37 UTC 28,314 bytes, 468 lines download raw bytes

1(function($) {
2
3	window.fnames = new Array();
4	window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[3]='ADDRESS';ftypes[3]='address';fnames[4]='PHONE';ftypes[4]='phone';fnames[5]='SIGNUP';ftypes[5]='text';fnames[6]='MMERGE6';ftypes[6]='dropdown';/*
5
6	* Translated default messages for the $ validation plugin.
7	* Locale: ES
8	*/
9	$.extend($.validator.messages, {
10	required: "Este campo es obligatorio.",
11	remote: "Por favor, rellena este campo.",
12	email: "Por favor, escribe una dirección de correo válida",
13	url: "Por favor, escribe una URL válida.",
14	date: "Por favor, escribe una fecha válida.",
15	dateISO: "Por favor, escribe una fecha (ISO) válida.",
16	number: "Por favor, escribe un número entero válido.",
17	digits: "Por favor, escribe sólo dígitos.",
18	creditcard: "Por favor, escribe un número de tarjeta válido.",
19	equalTo: "Por favor, escribe el mismo valor de nuevo.",
20	accept: "Por favor, escribe un valor con una extensión aceptada.",
21	maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."),
22	minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."),
23	rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."),
24	range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."),
25	max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."),
26	min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}.")
27});}(jQuery));
28
29var $mcj = jQuery.noConflict(true);
30
31// SMS Phone Multi-Country Functionality
32if(!window.MC) {
33	window.MC = {};
34}
35window.MC.smsPhoneData = {
36	defaultCountryCode: 'ES',
37	programs: [],
38	smsProgramDataCountryNames: []
39};
40
41function getCountryUnicodeFlag(countryCode) {
42	return countryCode.toUpperCase().replace(/./g, (char) => String.fromCodePoint(char.charCodeAt(0) + 127397))
43};
44
45// HTML sanitization function to prevent XSS
46function sanitizeHtml(str) {
47	if (typeof str !== 'string') return '';
48	return str
49	.replace(/&/g, '&')
50	.replace(/</g, '&lt;')
51	.replace(/>/g, '&gt;')
52	.replace(/"/g, '&quot;')
53	.replace(/'/g, '&#x27;')
54	.replace(/\//g, '&#x2F;');
55}
56
57// URL sanitization function to prevent javascript: and data: URLs
58function sanitizeUrl(url) {
59	if (typeof url !== 'string') return '';
60	const trimmedUrl = url.trim().toLowerCase();
61	if (trimmedUrl.startsWith('javascript:') || trimmedUrl.startsWith('data:') || trimmedUrl.startsWith('vbscript:')) {
62	return '#';
63	}
64	return url;
65}
66
67const getBrowserLanguage = () => {
68	if (!window?.navigator?.language?.split('-')[1]) {
69	return window?.navigator?.language?.toUpperCase();
70	}
71	return window?.navigator?.language?.split('-')[1];
72};
73
74function getDefaultCountryProgram(defaultCountryCode, smsProgramData) {
75	if (!smsProgramData || smsProgramData.length === 0) {
76	return null;
77	}
78
79	const browserLanguage = getBrowserLanguage();
80
81	if (browserLanguage) {
82	const foundProgram = smsProgramData.find(
83		(program) => program?.countryCode === browserLanguage,
84	);
85	if (foundProgram) {
86		return foundProgram;
87	}
88	}
89
90	if (defaultCountryCode) {
91	const foundProgram = smsProgramData.find(
92		(program) => program?.countryCode === defaultCountryCode,
93	);
94	if (foundProgram) {
95		return foundProgram;
96	}
97	}
98
99	return smsProgramData[0];
100}
101
102function updateSmsLegalText(countryCode, fieldName) {
103	if (!countryCode || !fieldName) {
104	return;
105	}
106
107	const programs = window?.MC?.smsPhoneData?.programs;
108	if (!programs || !Array.isArray(programs)) {
109	return;
110	}
111
112	const program = programs.find(program => program?.countryCode === countryCode);
113	if (!program || !program.requiredTemplate) {
114	return;
115	}
116
117	const legalTextElement = document.querySelector('#legal-text-' + fieldName);
118	if (!legalTextElement) {
119	return;
120	}
121
122	// Remove HTML tags and clean up the text
123	const divRegex = new RegExp('</?[div][^>]*>', 'gi');
124	const fullAnchorRegex = new RegExp('<a.*?</a>', 'g');
125	const anchorRegex = new RegExp('<a href="(.*?)" target="(.*?)">(.*?)</a>');
126
127	const requiredLegalText = program.requiredTemplate
128	.replace(divRegex, '')
129	.replace(fullAnchorRegex, '')
130	.slice(0, -1);
131
132	const anchorMatches = program.requiredTemplate.match(anchorRegex);
133
134	if (anchorMatches && anchorMatches.length >= 4) {
135	// Create link element safely using DOM methods instead of innerHTML
136	const linkElement = document.createElement('a');
137	linkElement.href = sanitizeUrl(anchorMatches[1]);
138	linkElement.target = sanitizeHtml(anchorMatches[2]);
139	linkElement.textContent = sanitizeHtml(anchorMatches[3]);
140
141	legalTextElement.textContent = requiredLegalText + ' ';
142	legalTextElement.appendChild(linkElement);
143	legalTextElement.appendChild(document.createTextNode('.'));
144	} else {
145	legalTextElement.textContent = requiredLegalText + '.';
146	}
147}
148
149function generateDropdownOptions(smsProgramData) {
150	if (!smsProgramData || smsProgramData.length === 0) {
151	return '';
152	}
153
154	return smsProgramData.map(program => {
155	const flag = getCountryUnicodeFlag(program.countryCode);
156	const countryName = getCountryName(program.countryCode);
157	const callingCode = program.countryCallingCode || '';
158	// Sanitize all values to prevent XSS
159	const sanitizedCountryCode = sanitizeHtml(program.countryCode || '');
160	const sanitizedCountryName = sanitizeHtml(countryName || '');
161	const sanitizedCallingCode = sanitizeHtml(callingCode || '');
162	return '<option value="' + sanitizedCountryCode + '">' + sanitizedCountryName + ' ' + sanitizedCallingCode + '</option>';
163	}).join('');
164}
165
166function getCountryName(countryCode) {
167	if (window.MC?.smsPhoneData?.smsProgramDataCountryNames && Array.isArray(window.MC.smsPhoneData.smsProgramDataCountryNames)) {
168	for (let i = 0; i < window.MC.smsPhoneData.smsProgramDataCountryNames.length; i++) {
169		if (window.MC.smsPhoneData.smsProgramDataCountryNames[i].code === countryCode) {
170		return window.MC.smsPhoneData.smsProgramDataCountryNames[i].name;
171		}
172	}
173	}
174	return countryCode;
175}
176
177function getDefaultPlaceholder(countryCode) {
178	if (!countryCode || typeof countryCode !== 'string') {
179	return '+1 000 000 0000'; // Default US placeholder
180	}
181
182	const mockPlaceholders = [
183	{
184	countryCode: 'US',
185	placeholder: '+1 000 000 0000',
186	helpText: 'Include the US country code +1 before the phone number',
187},
188{
189	countryCode: 'GB',
190	placeholder: '+44 0000 000000',
191	helpText: 'Include the GB country code +44 before the phone number',
192},
193{
194	countryCode: 'CA',
195	placeholder: '+1 000 000 0000',
196	helpText: 'Include the CA country code +1 before the phone number',
197},
198{
199	countryCode: 'AU',
200	placeholder: '+61 000 000 000',
201	helpText: 'Include the AU country code +61 before the phone number',
202},
203{
204	countryCode: 'DE',
205	placeholder: '+49 000 0000000',
206	helpText: 'Fügen Sie vor der Telefonnummer die DE-Ländervorwahl +49 ein',
207},
208{
209	countryCode: 'FR',
210	placeholder: '+33 0 00 00 00 00',
211	helpText: 'Incluez le code pays FR +33 avant le numéro de téléphone',
212},
213{
214	countryCode: 'ES',
215	placeholder: '+34 000 000 000',
216	helpText: 'Incluya el código de país ES +34 antes del número de teléfono',
217},
218{
219	countryCode: 'NL',
220	placeholder: '+31 0 00000000',
221	helpText: 'Voeg de NL-landcode +31 toe vóór het telefoonnummer',
222},
223{
224	countryCode: 'BE',
225	placeholder: '+32 000 00 00 00',
226	helpText: 'Incluez le code pays BE +32 avant le numéro de téléphone',
227},
228{
229	countryCode: 'CH',
230	placeholder: '+41 00 000 00 00',
231	helpText: 'Fügen Sie vor der Telefonnummer die CH-Ländervorwahl +41 ein',
232},
233{
234	countryCode: 'AT',
235	placeholder: '+43 000 000 0000',
236	helpText: 'Fügen Sie vor der Telefonnummer die AT-Ländervorwahl +43 ein',
237},
238{
239	countryCode: 'IE',
240	placeholder: '+353 00 000 0000',
241	helpText: 'Include the IE country code +353 before the phone number',
242},
243{
244	countryCode: 'IT',
245	placeholder: '+39 000 000 0000',
246	helpText:
247	'Includere il prefisso internazionale IT +39 prima del numero di telefono',
248},
249	];
250
251	const selectedPlaceholder = mockPlaceholders.find(function(item) {
252	return item && item.countryCode === countryCode;
253	});
254
255	return selectedPlaceholder ? selectedPlaceholder.placeholder : mockPlaceholders[0].placeholder;
256}
257
258function updatePlaceholder(countryCode, fieldName) {
259	if (!countryCode || !fieldName) {
260	return;
261	}
262
263	const phoneInput = document.querySelector('#mce-' + fieldName);
264	if (!phoneInput) {
265	return;
266	}
267
268	const placeholder = getDefaultPlaceholder(countryCode);
269	if (placeholder) {
270	phoneInput.placeholder = placeholder;
271	}
272}
273
274function updateCountryCodeInstruction(countryCode, fieldName) {
275	updatePlaceholder(countryCode, fieldName);
276
277}
278
279function getDefaultHelpText(countryCode) {
280	const mockPlaceholders = [
281	{
282		countryCode: 'US',
283		placeholder: '+1 000 000 0000',
284		helpText: 'Include the US country code +1 before the phone number',
285	},
286	{
287		countryCode: 'GB',
288		placeholder: '+44 0000 000000',
289		helpText: 'Include the GB country code +44 before the phone number',
290	},
291	{
292		countryCode: 'CA',
293		placeholder: '+1 000 000 0000',
294		helpText: 'Include the CA country code +1 before the phone number',
295	},
296	{
297		countryCode: 'AU',
298		placeholder: '+61 000 000 000',
299		helpText: 'Include the AU country code +61 before the phone number',
300	},
301	{
302		countryCode: 'DE',
303		placeholder: '+49 000 0000000',
304		helpText: 'Fügen Sie vor der Telefonnummer die DE-Ländervorwahl +49 ein',
305	},
306	{
307		countryCode: 'FR',
308		placeholder: '+33 0 00 00 00 00',
309		helpText: 'Incluez le code pays FR +33 avant le numéro de téléphone',
310	},
311	{
312		countryCode: 'ES',
313		placeholder: '+34 000 000 000',
314		helpText: 'Incluya el código de país ES +34 antes del número de teléfono',
315	},
316	{
317		countryCode: 'NL',
318		placeholder: '+31 0 00000000',
319		helpText: 'Voeg de NL-landcode +31 toe vóór het telefoonnummer',
320	},
321	{
322		countryCode: 'BE',
323		placeholder: '+32 000 00 00 00',
324		helpText: 'Incluez le code pays BE +32 avant le numéro de téléphone',
325	},
326	{
327		countryCode: 'CH',
328		placeholder: '+41 00 000 00 00',
329		helpText: 'Fügen Sie vor der Telefonnummer die CH-Ländervorwahl +41 ein',
330	},
331	{
332		countryCode: 'AT',
333		placeholder: '+43 000 000 0000',
334		helpText: 'Fügen Sie vor der Telefonnummer die AT-Ländervorwahl +43 ein',
335	},
336	{
337		countryCode: 'IE',
338		placeholder: '+353 00 000 0000',
339		helpText: 'Include the IE country code +353 before the phone number',
340	},
341	{
342		countryCode: 'IT',
343		placeholder: '+39 000 000 0000',
344		helpText: 'Includere il prefisso internazionale IT +39 prima del numero di telefono',
345	},
346	];
347
348	if (!countryCode || typeof countryCode !== 'string') {
349	return mockPlaceholders[0].helpText;
350	}
351
352	const selectedHelpText = mockPlaceholders.find(function(item) {
353		return item && item.countryCode === countryCode;
354	});
355
356	return selectedHelpText ? selectedHelpText.helpText : mockPlaceholders[0].helpText;
357}
358
359function setDefaultHelpText(countryCode) {
360	const helpTextSpan = document.querySelector('#help-text');
361	if (!helpTextSpan) {
362	return;
363	}
364
365
366}
367
368function updateHelpTextCountryCode(countryCode, fieldName) {
369	if (!countryCode || !fieldName) {
370	return;
371	}
372
373	setDefaultHelpText(countryCode);
374}
375
376function initializeSmsPhoneDropdown(fieldName) {
377	if (!fieldName || typeof fieldName !== 'string') {
378	return;
379	}
380
381	const dropdown = document.querySelector('#country-select-' + fieldName);
382	const displayFlag = document.querySelector('#flag-display-' + fieldName);
383
384	if (!dropdown || !displayFlag) {
385	return;
386	}
387
388	const smsPhoneData = window.MC?.smsPhoneData;
389	if (smsPhoneData && smsPhoneData.programs && Array.isArray(smsPhoneData.programs)) {
390	dropdown.innerHTML = generateDropdownOptions(smsPhoneData.programs);
391	}
392
393	const defaultProgram = getDefaultCountryProgram(smsPhoneData?.defaultCountryCode, smsPhoneData?.programs);
394	if (defaultProgram && defaultProgram.countryCode) {
395	dropdown.value = defaultProgram.countryCode;
396
397	const flagSpan = displayFlag?.querySelector('#flag-emoji-' + fieldName);
398	if (flagSpan) {
399		flagSpan.textContent = getCountryUnicodeFlag(defaultProgram.countryCode);
400		flagSpan.setAttribute('aria-label', sanitizeHtml(defaultProgram.countryCode) + ' flag');
401	}
402
403	updateSmsLegalText(defaultProgram.countryCode, fieldName);
404	updatePlaceholder(defaultProgram.countryCode, fieldName);
405	updateCountryCodeInstruction(defaultProgram.countryCode, fieldName);
406	}
407
408
409	var smsNotRequiredRemoveCountryCodeEnabled = true;
410	var smsField = Object.values({"EMAIL":{"name":"EMAIL","label":"Tú Email","helper_text":"","type":"email","required":true,"audience_field_name":"Tú Email","merge_id":0,"help_text_enabled":false,"enabled":true,"order":"0","field_type":"merge"},"FNAME":{"name":"FNAME","label":"First Name","helper_text":"","type":"text","required":false,"audience_field_name":"First Name","enabled":false,"order":null,"field_type":"merge","merge_id":1},"LNAME":{"name":"LNAME","label":"Last Name","helper_text":"","type":"text","required":false,"audience_field_name":"Last Name","enabled":false,"order":null,"field_type":"merge","merge_id":2},"ADDRESS":{"name":"ADDRESS","label":"Address","helper_text":"","type":"address","required":false,"audience_field_name":"Address","enabled":false,"order":null,"field_type":"merge","merge_id":3,"countries":{"2":"Albania","3":"Algeria","4":"Andorra","5":"Angola","6":"Argentina","7":"Armenia","8":"Australia","9":"Austria","10":"Azerbaijan","11":"Bahamas","12":"Bahrain","13":"Bangladesh","14":"Barbados","15":"Belarus","16":"Belgium","17":"Belize","18":"Benin","19":"Bermuda","20":"Bhutan","21":"Bolivia","22":"Bosnia and Herzegovina","23":"Botswana","24":"Brazil","25":"Bulgaria","26":"Burkina Faso","27":"Burundi","28":"Cambodia","29":"Cameroon","30":"Canada","31":"Cape Verde","32":"Cayman Islands","33":"Central African Republic","34":"Chad","35":"Chile","36":"China","37":"Colombia","38":"Congo","40":"Croatia","41":"Cyprus","42":"Czech Republic","43":"Denmark","44":"Djibouti","45":"Ecuador","46":"Egypt","47":"El Salvador","48":"Equatorial Guinea","49":"Eritrea","50":"Estonia","51":"Ethiopia","52":"Fiji","53":"Finland","54":"France","56":"Gabon","57":"Gambia","58":"Georgia","59":"Germany","60":"Ghana","61":"Greece","62":"Guam","63":"Guinea","64":"Guinea-Bissau","65":"Guyana","66":"Honduras","67":"Hong Kong","68":"Hungary","69":"Iceland","70":"India","71":"Indonesia","74":"Ireland","75":"Israel","76":"Italy","78":"Japan","79":"Jordan","80":"Kazakhstan","81":"Kenya","82":"Kuwait","83":"Kyrgyzstan","84":"Lao People's Democratic Republic","85":"Latvia","86":"Lebanon","87":"Lesotho","88":"Liberia","90":"Liechtenstein","91":"Lithuania","92":"Luxembourg","93":"Macedonia","94":"Madagascar","95":"Malawi","96":"Malaysia","97":"Maldives","98":"Mali","99":"Malta","100":"Mauritania","101":"Mexico","102":"Moldova","103":"Monaco","104":"Mongolia","105":"Morocco","106":"Mozambique","107":"Namibia","108":"Nepal","109":"Netherlands","110":"Netherlands Antilles","111":"New Zealand","112":"Nicaragua","113":"Niger","114":"Nigeria","116":"Norway","117":"Oman","118":"Pakistan","119":"Panama","120":"Paraguay","121":"Peru","122":"Philippines","123":"Poland","124":"Portugal","126":"Qatar","127":"Reunion","128":"Romania","129":"Russia","130":"Rwanda","132":"Samoa (Independent)","133":"Saudi Arabia","134":"Senegal","135":"Seychelles","136":"Sierra Leone","137":"Singapore","138":"Slovakia","139":"Slovenia","140":"Somalia","141":"South Africa","142":"South Korea","143":"Spain","144":"Sri Lanka","146":"Suriname","147":"Swaziland","148":"Sweden","149":"Switzerland","152":"Taiwan","153":"Tanzania","154":"Thailand","155":"Togo","156":"Tunisia","157":"Turkiye","158":"Turkmenistan","159":"Uganda","161":"Ukraine","162":"United Arab Emirates","163":"Uruguay","164":"USA","165":"Uzbekistan","166":"Vatican City State (Holy See)","167":"Venezuela","168":"Vietnam","169":"Virgin Islands (British)","170":"Yemen","173":"Zambia","174":"Zimbabwe","175":"Antigua And Barbuda","176":"Anguilla","178":"American Samoa","179":"Aruba","180":"Brunei Darussalam","181":"Bouvet Island","183":"Cook Islands","185":"Christmas Island","187":"Dominican Republic","188":"Western Sahara","189":"Falkland Islands","191":"Faroe Islands","192":"Grenada","193":"French Guiana","194":"Gibraltar","195":"Greenland","196":"Guadeloupe","198":"Guatemala","200":"Haiti","202":"Jamaica","203":"Kiribati","204":"C
410omoros","205":"Saint Kitts and Nevis","206":"Saint Lucia","207":"Marshall Islands","208":"Macau","210":"Martinique","212":"Mauritius","213":"New Caledonia","214":"Norfolk Island","215":"Nauru","217":"Niue","219":"Papua New Guinea","221":"Pitcairn","222":"Palau","223":"Solomon Islands","225":"Svalbard and Jan Mayen Islands","227":"San Marino","232":"Tonga","233":"Timor-Leste","234":"Trinidad and Tobago","235":"Tuvalu","237":"Saint Vincent and the Grenadines","238":"Virgin Islands (U.S.)","239":"Vanuatu","241":"Mayotte","242":"Myanmar","255":"Sao Tome and Principe","257":"South Georgia and the South Sandwich Islands","260":"Tajikistan","262":"United Kingdom","268":"Costa Rica","270":"Guernsey","272":"North Korea","274":"Afghanistan","275":"Cote D'Ivoire","276":"Cuba","277":"French Polynesia","278":"Iran","279":"Iraq","281":"Libya","282":"Palestine","285":"Syria","286":"Aaland Islands","287":"Turks & Caicos Islands","288":"Jersey  (Channel Islands)","289":"Dominica","290":"Montenegro","293":"Sudan","294":"Montserrat","298":"Curacao","302":"Sint Maarten","311":"South Sudan","315":"Republic of Kosovo","318":"Congo, Democratic Republic of the","323":"Isle of Man","324":"Saint Martin","325":"Bonaire, Saint Eustatius and Saba","326":"Serbia"},"defaultcountry":164},"PHONE":{"name":"PHONE","label":"Phone Number","helper_text":"","type":"phone","required":false,"audience_field_name":"Phone Number","phoneformat":"","enabled":false,"order":null,"field_type":"merge","merge_id":4},"SIGNUP":{"name":"SIGNUP","label":"Sign up","helper_text":"","type":"text","required":false,"audience_field_name":"Sign up","enabled":false,"order":null,"field_type":"merge","merge_id":5},"MMERGE6":{"name":"MMERGE6","label":"Perfil Profesional","helper_text":"","type":"dropdown","required":false,"audience_field_name":"Perfil Profesional","choices":[{"value":"","label":""},{"value":"Administración Pública","label":"Administración Pública"},{"value":"Arquitecto","label":"Arquitecto"},{"value":"Asociación / Organización","label":"Asociación / Organización"},{"value":"Constructor","label":"Constructor"},{"value":"Docente","label":"Docente"},{"value":"Economista","label":"Economista"},{"value":"Estudiante","label":"Estudiante"},{"value":"Fabricante / Distribuidor","label":"Fabricante / Distribuidor"},{"value":"Gerente / Director","label":"Gerente / Director"},{"value":"Gestor Energético","label":"Gestor Energético"},{"value":"Gestión y Mantenimiento","label":"Gestión y Mantenimiento"},{"value":"Informático","label":"Informático"},{"value":"Ingeniero","label":"Ingeniero"},{"value":"Instalador","label":"Instalador"},{"value":"Integrador de Sistemas","label":"Integrador de Sistemas"},{"value":"Interiorista / Diseñador","label":"Interiorista / Diseñador"},{"value":"Periodista","label":"Periodista"},{"value":"Promotor Inmobiliario","label":"Promotor Inmobiliario"},{"value":"Proveedor de Servicios","label":"Proveedor de Servicios"},{"value":"Secretario","label":"Secretario"},{"value":"Urbanista","label":"Urbanista"},{"value":"Otro","label":"Otro"}],"enabled":false,"order":null,"field_type":"merge","merge_id":6}}).find(function(f) { return f.name === fieldName && f.type === 'smsphone'; });
411	var isRequired = smsField ? smsField.required : false;
412	var shouldAppendCountryCode = smsNotRequiredRemoveCountryCodeEnabled ? isRequired : true;
413
414	var phoneInput = document.querySelector('#mce-' + fieldName);
415	if (phoneInput && defaultProgram.countryCallingCode && shouldAppendCountryCode) {
416	phoneInput.value = defaultProgram.countryCallingCode;
417	}
418
419
420
421	displayFlag?.addEventListener('click', function(e) {
422	dropdown.focus();
423	});
424
425
426	dropdown?.addEventListener('change', function() {
427	const selectedCountry = this.value;
428
429	if (!selectedCountry || typeof selectedCountry !== 'string') {
430		return;
431	}
432
433	const flagSpan = displayFlag?.querySelector('#flag-emoji-' + fieldName);
434	if (flagSpan) {
435		flagSpan.textContent = getCountryUnicodeFlag(selectedCountry);
436		flagSpan.setAttribute('aria-label', sanitizeHtml(selectedCountry) + ' flag');
437	}
438
439
440	const selectedProgram = window.MC?.smsPhoneData?.programs.find(function(program) {
441		return program && program.countryCode === selectedCountry;
442	});
443
444	var smsNotRequiredRemoveCountryCodeEnabled = true;
445	var smsField = Object.values({"EMAIL":{"name":"EMAIL","label":"Tú Email","helper_text":"","type":"email","required":true,"audie
445nce_field_name":"Tú Email","merge_id":0,"help_text_enabled":false,"enabled":true,"order":"0","field_type":"merge"},"FNAME":{"name":"FNAME","label":"First Name","helper_text":"","type":"text","required":false,"audience_field_name":"First Name","enabled":false,"order":null,"field_type":"merge","merge_id":1},"LNAME":{"name":"LNAME","label":"Last Name","helper_text":"","type":"text","required":false,"audience_field_name":"Last Name","enabled":false,"order":null,"field_type":"merge","merge_id":2},"ADDRESS":{"name":"ADDRESS","label":"Address","helper_text":"","type":"address","required":false,"audience_field_name":"Address","enabled":false,"order":null,"field_type":"merge","merge_id":3,"countries":{"2":"Albania","3":"Algeria","4":"Andorra","5":"Angola","6":"Argentina","7":"Armenia","8":"Australia","9":"Austria","10":"Azerbaijan","11":"Bahamas","12":"Bahrain","13":"Bangladesh","14":"Barbados","15":"Belarus","16":"Belgium","17":"Belize","18":"Benin","19":"Bermuda","20":"Bhutan","21":"Bolivia","22":"Bosnia and Herzegovina","23":"Botswana","24":"Brazil","25":"Bulgaria","26":"Burkina Faso","27":"Burundi","28":"Cambodia","29":"Cameroon","30":"Canada","31":"Cape Verde","32":"Cayman Islands","33":"Central African Republic","34":"Chad","35":"Chile","36":"China","37":"Colombia","38":"Congo","40":"Croatia","41":"Cyprus","42":"Czech Republic","43":"Denmark","44":"Djibouti","45":"Ecuador","46":"Egypt","47":"El Salvador","48":"Equatorial Guinea","49":"Eritrea","50":"Estonia","51":"Ethiopia","52":"Fiji","53":"Finland","54":"France","56":"Gabon","57":"Gambia","58":"Georgia","59":"Germany","60":"Ghana","61":"Greece","62":"Guam","63":"Guinea","64":"Guinea-Bissau","65":"Guyana","66":"Honduras","67":"Hong Kong","68":"Hungary","69":"Iceland","70":"India","71":"Indonesia","74":"Ireland","75":"Israel","76":"Italy","78":"Japan","79":"Jordan","80":"Kazakhstan","81":"Kenya","82":"Kuwait","83":"Kyrgyzstan","84":"Lao People's Democratic Republic","85":"Latvia","86":"Lebanon","87":"Lesotho","88":"Liberia","90":"Liechtenstein","91":"Lithuania","92":"Luxembourg","93":"Macedonia","94":"Madagascar","95":"Malawi","96":"Malaysia","97":"Maldives","98":"Mali","99":"Malta","100":"Mauritania","101":"Mexico","102":"Moldova","103":"Monaco","104":"Mongolia","105":"Morocco","106":"Mozambique","107":"Namibia","108":"Nepal","109":"Netherlands","110":"Netherlands Antilles","111":"New Zealand","112":"Nicaragua","113":"Niger","114":"Nigeria","116":"Norway","117":"Oman","118":"Pakistan","119":"Panama","120":"Paraguay","121":"Peru","122":"Philippines","123":"Poland","124":"Portugal","126":"Qatar","127":"Reunion","128":"Romania","129":"Russia","130":"Rwanda","132":"Samoa (Independent)","133":"Saudi Arabia","134":"Senegal","135":"Seychelles","136":"Sierra Leone","137":"Singapore","138":"Slovakia","139":"Slovenia","140":"Somalia","141":"South Africa","142":"South Korea","143":"Spain","144":"Sri Lanka","146":"Suriname","147":"Swaziland","148":"Sweden","149":"Switzerland","152":"Taiwan","153":"Tanzania","154":"Thailand","155":"Togo","156":"Tunisia","157":"Turkiye","158":"Turkmenistan","159":"Uganda","161":"Ukraine","162":"United Arab Emirates","163":"Uruguay","164":"USA","165":"Uzbekistan","166":"Vatican City State (Holy See)","167":"Venezuela","168":"Vietnam","169":"Virgin Islands (British)","170":"Yemen","173":"Zambia","174":"Zimbabwe","175":"Antigua And Barbuda","176":"Anguilla","178":"American Samoa","179":"Aruba","180":"Brunei Darussalam","181":"Bouvet Island","183":"Cook Islands","185":"Christmas Island","187":"Dominican Republic","188":"Western Sahara","189":"Falkland Islands","191":"Faroe Islands","192":"Grenada","193":"French Guiana","194":"Gibraltar","195":"Greenland","196":"Guadeloupe","198":"Guatemala","200":"Haiti","202":"Jamaica","203":"Kiribati","204":"Comoros","205":"Saint Kitts and Nevis","206":"Saint Lucia","207":"Marshall Islands","208":"Macau","210":"Martinique","212":"Mauritius","213":"New Caledonia","214":"Norfolk Island","215":"Nauru","217":"Niue","219":"Papua New Guinea","221":"Pitcairn","222":"Palau","223":"Solomon Islands","225":"Svalbard and Jan Mayen Islands","227":"San Marino","232":"Tonga","233":"Timor-Leste","234":"Trinidad and Tobago","235":"Tuvalu","237":"Saint Vincent and the Grenadines","238":"Virgin Islands (U.S.)","239":"Vanuatu","241":"Mayotte","242":"Myanmar","255":"Sao Tome and Principe","257":"South Georgia and the South Sandwich Islands","260":"Tajikistan","262":"United Kingdom","268":"Costa Rica","270":"Guernsey","272":"North Korea","274":"Afghanistan","275":"Cote D'Ivoire","276":"Cuba","277":"French Polynesia","278":"Iran","279":"Iraq","281":"Libya","282":"Palestine","285":"Syria","286":"Aaland Islands","287":"Turks & Caicos Islands","288":"Jersey  (Channel Islands)","289":"Dominica","290":"Montenegro","293":"Sudan","294":"Montserrat","298":"Curacao","302":"Sint Maarten","311":"South Sudan","315":"Republic of Kosovo","318":"Congo, Democratic Republic of the","323":"Isle of Man","324":"Saint Martin","325":"Bonaire, Saint Eustatius and Saba","326":"Serbia"},"defaultcountry":164},"PHONE":{"name":"PHONE","label":"Phone Number","helper_text":"","type":"phone","required":false,"audience_field_name":"Phone Number","phoneformat":"","enabled":false,"order":null,"field_type":"merge","merge_id":4},"SIGNUP":{"name":"SIGNUP","label":"Sign up","helper_text":"","type":"text","required":false,"audience_field_name":"Sign up","enabled":false,"order":null,"field_type":"merge","merge_id":5},"MMERGE6":{"name":"MMERGE6","label":"Perfil Profesional","helper_text":"","type":"dropdown","required":false,"audience_field_name":"Perfil Profesional","choices":[{"value":"","label":""},{"value":"Administración Pública","label":"Administración Pública"},{"value":"Arquitecto","label":"Arquitecto"},{"value":"Asociación / Organización","label":"Asociación / Organización"},{"value":"Constructor","label":"Constructor"},{"value":"Docente","label":"Docente"},{"value":"Economista","label":"Economista"},{"value":"Estudiante","label":"Estudiante"},{"value":"Fabricante / Distribuidor","label":"Fabricante / Distribuidor"},{"value":"Gerente / Director","label":"Gerente / Director"},{"value":"Gestor Energético","label":"Gestor Energético"},{"value":"Gestión y Mantenimiento","label":"Gestión y Mantenimiento"},{"value":"Informático","label":"Informático"},{"value":"Ingeniero","label":"Ingeniero"},{"value":"Instalador","label":"Instalador"},{"value":"Integrador de Sistemas","label":"Integrador de Sistemas"}
445,{"value":"Interiorista / Diseñador","label":"Interiorista / Diseñador"},{"value":"Periodista","label":"Periodista"},{"value":"Promotor Inmobiliario","label":"Promotor Inmobiliario"},{"value":"Proveedor de Servicios","label":"Proveedor de Servicios"},{"value":"Secretario","label":"Secretario"},{"value":"Urbanista","label":"Urbanista"},{"value":"Otro","label":"Otro"}],"enabled":false,"order":null,"field_type":"merge","merge_id":6}}).find(function(f) { return f.name === fieldName && f.type === 'smsphone'; });
446	var isRequired = smsField ? smsField.required : false;
447	var shouldAppendCountryCode = smsNotRequiredRemoveCountryCodeEnabled ? isRequired : true;
448
449	var phoneInput = document.querySelector('#mce-' + fieldName);
450	if (phoneInput && selectedProgram.countryCallingCode && shouldAppendCountryCode) {
451		phoneInput.value = selectedProgram.countryCallingCode;
452	}
453
454
455	updateSmsLegalText(selectedCountry, fieldName);
456	updatePlaceholder(selectedCountry, fieldName);
457	updateCountryCodeInstruction(selectedCountry, fieldName);
458	});
459}
460
461document.addEventListener('DOMContentLoaded', function() {
462	const smsPhoneFields = document.querySelectorAll('[id^="country-select-"]');
463
464	smsPhoneFields.forEach(function(dropdown) {
465	const fieldName = dropdown?.id.replace('country-select-', '');
466	initializeSmsPhoneDropdown(fieldName);
467	});
468});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.